vb

Why do IDL defaultvalue values look rounded?

I have a COM object with a function with an optional last argument. The IDL is a bit like this: interface ICWhatever: IDispatch { [id(96)] HRESULT SomeFunction([in,defaultvalue(50.6)]float parameter); }; This works fine: if I don't specify the parameter, 50.6 is filled in. But in several development environments (Excel VBA, VB6) the...

vb Writefile zip issue comes as a ashx

I have a ashx page handling file/attachment requests last line of code is System.Web.HttpContext.Current.Response.WriteFile(filename) It ends up downloading a file called GetFile.ashx (which sounds like a page name but if I rename the .ashx to .zip it is actually the correct file... Any reasons why this might be happening and how to...

how to increase character limit for visual basic alert boxes

I have the following code: If Not strValidate ="" Then alert("The following information is required:" + vbLf + strValidate) ValidateDocument = False Exit Function End If The variable "strValidate" contains a long number of characters, so when the alert box shows, it doesn't show the whole string, the remaining characters ...

C# to VB conversion query

This C# code successfully gets the 2 relevant records into _currentUserRegisteredEventIds: ctx.FetchEventsForWhichCurrentUserIsRegistered((op) => { if (!op.HasError) { var items = op.Value; _currentUserRegisteredEventIds = new HashSet<int>(items); ...

Examining MS Access Database Keys using VB6

how to check how many primary key, composite key in existing table using Visual basic 6.0 and ms access as a database? ...

Pass a range into a custom function from within a cell

Hi I'm using VBA in Excel and need to pass in the values from two ranges into a custom function from within a cell's formula. The function looks like this: Public Function multByElement(range1 As String, range2 As String) As Variant Dim arr1() As Variant, arr2() As Variant arr1 = Range(range1).value arr2 = Range(range2).va...

vba: clear entire array

i have an array like this: Dim aFirstArray() As Variant how do i clear the entire array>? what about a collection? ...

Datareceived Serialport event stops raising after some seconds

Hi, I was hoping someone could help me out with this problem. I have a system (VB .NET) where I must read a person's weight (RS232 Sluice) and id (Fingerprint - 2 biometric reader, rs232) and compare it to a database. I have 3 serialports in my app, one for the sluice and the other 2 are to receive the id from the fingerprint readers, bo...

How to break from loop by the cancel button in inputbox

The following VB script check the valid IP by Test function if we get OK from the test function then We break from loop ValidIP=OK If not the inputBox ask the question until ValidIP=OK But sometimes I want to exit from loop by cancel button How to break loop by the cancel button (in order to set the ValidIP as OK) Do Until ValidIP=O...

VB 6.0: How can I see XML variables in Immediate Window

I am debugging a VB 6.0 program that is using XML methods, etc... so I wish to be able to see how these XML variables in my program look like when I am debugging it ... How can I do that? ...

How to run a command on a remote Windows system as a non-admin user with WMI?

I have a script written in Visual Basic that starts a process (given to the script as an argument) on a remote system (again, given as an argument) using WMI. This script works fine when using an Administrator account on the remote system, but when using a non-administrator account, I get the following error: ConnectServer Failed w/ (-2...

Experiences with "language converters"?

I have read a few articles mentioning converters from one language to another. I'm a bit more than skeptical about the use of such kind of tools. Does anyone know or have experiences let's say about Visual Basic to Java or vs converters? Just one example to pick http://www.tvobjects.com/products/products.html, claims to be the "world...

launch two actions in one button ASP.NET

Hey, I'm developing a comment page in asp.net, this my page : <form action="#"> <p><textarea id="textArea" rows="5" cols="30"></textarea></p> <input type="submit" value="Submit" /> </form> <p>Add some comments to the page</p> And this is my javascript code : window.onload = initAll; function initAll() { document.getElementsByTagNam...

vb classic coder to android how to transition?

Hi guys. I'm a VB/vba coder and would like to start android dev. Currently I'm learning Java from scratch and. Its quite tough. I've read about oop but never actually written any OO code. Java syntax is also quite foreign but I'm getting the hang of it. My question is, which is absolutely the best transition path for a vb old dog to writ...

ASP.NET MVC - How do I implement validation when using Data Repositories? (Visual Basic)

I've built a UserRepository interface to communicate with my LINQ to SQL Data layer, but I'm trying to figure out how to implement validation. Here is what my AddUser subroutine looks like Public Sub AddUser(ByVal about As String, ByVal birthdate As DateTime, ByVal openid As String, ByVal regionid As Integer, ByVal website As String) I...

Is there a universal way to get a nice textual representation of a variable in VBA?

In VBA, is there a nice way to get a textual representation of a variable / object? Like Java's various String.valueOf(...) methods. ...

Naming Optional Parameters in VSB

In Visual Basic, I have Functions with a lot of Optional arguments. I would like to be able to pass just a few of these Optional arguments to a Function without having to use numerous commas and spaces to get to the ones I want. Somewhere I saw a way to name params such as OptVar:=val, but that does not seem to work. Just wondering if th...

about visual basic 2005 browser with imagaes

the browser of visiual basic 2005 doesn't display JPEG images , it only displays PNG and GIF is there any way to display it? ...

VB script + change the first value of the first param in txt file

hi how to replace only the first value of MODE parameter in the bash script from "ON" to "OFF" by VB script? the bash script location: C:\folder_scripts\script.bash THX Yael the bash script (txt file): !/bin/bash MODE=ON if [[ $MODE = ON ]] then echo "the machine is on line" elif [[ $MODE = OFF ]] echo "the machine is OFF ...

VB script + create select BOX in VB script to select one of two questions from window

Hi How to create select box or check box window in VB script In order to select one of the following questions and put the answer in to My_Answer parameter? My_Answer param Should get ON or OFF need to select ON or OFF : ON <*> OFF <*> THX Yael ...