vb6

How do I know if my program needs MDAC?

I have a set of Windows programs that is mostly created with VB6 and VC++ 6. Its installer is created using InstallShield. A couple users have recently reported a problem trying to install it on Vista. It is complaining that "MDAC 2.6 Sp2 cannot be installed on this machine. MDAC 2.6 Sp2 requires any one of the following configuratio...

Visual Basic 6.0 Passing by reference problem

In the following code, I get a compile time error: ByRef Argument type mismatch. But if I change the declaration of i,j to : Dim i As Integer Dim j As Integer The error goes away. Why? Private Sub Command2_Click() Dim i, j As Integer i = 5 j = 7 Call Swap(i, j) End Sub Public Sub Swap(ByRef X As Integer, ByRef Y As In...

Visual Basic 6.0 Passing by Value Reference difference

In the following code, I get a compile time error because i is treated as a variant. The error is: "ByRef Argument type mismatch.". But if I pass the parameters ByVal, there is no error why? Private Sub Command2_Click() Dim i, j As Integer i = 5 j = 7 Call Swap(i, j) End Sub Public Sub Swap(ByRef X As Integer, ByRef Y...

Installing VB6 app causes IE6 errors???

I have a VB 6 app that I've inherited, and made some small updates to, but now when it is scripted to install (for SMS, using BITS_INST.exe) and I install it from that script, I get the following javascript error on our portal on links that are attempting to open new windows: Error: 'window.open(...)' is null or not an object This app ...

How do I migrate a VB6 ActiveX control to VB.net?

I have a legacy VB6 ActiveX control used in IE to provide control of a parallel-port device from a browser application. I wrote this thing about five years ago; It's a pretty simple control, and it doesn't require a lot of maintenance. However, I've noticed that running the VB6 tools is becoming more and more painful over time, so I'm ...

Exception handling: how granular would you go when it comes to argument validation?

I'm coding a simple little class with a single method send an email. My goal is to implement it in a legacy Visual Basic 6 project, exposing it as a COM object via the COM Interop facility. There's a detail I'm finding difficult to resolve, that being how granular should I be at validating parameters. On that light, a thing I'm really n...

Once I run the project, How to display a previously selected file in the text box.

Using VB 6 Once I run the project, How to display a previously selected file in the text box. Am using open dialog in my project, once am selecting the file from browse, then selected file is display in the text box. Then I executed the project and closed the project. Next time I am opening the project, previously selected path and fi...

Escaping quotes in a string in VB6

Hello, I am trying to make some small changes to an old VB web app I need to add quotes inside of a string I've had no luck so far. The string is Dim sql As String = "Select * from Usertask Where UserId = " & Session("UserId") & " and JobID=" & ddlReqTask.SelectedValue I need to add quotes around the Session("UserID") value. ...

How to print a value in the text box from the text file?

How to print a value in the text box from the text file? Using VB 6 While executing the program, text box should show the saved text file value Need VB 6 code Help. ...

VB6+SQL-Server: How can I execute a Query with named parameters using ADODB.Command?

I've been trying to execute a parametrized query with ADODB.Command. I know I can use "?" for parameters, but my queries are rather large and I really don't want to track the exact order of the parameters. I tried something like the following: objCmd.CommandType = adCmdText objCmd.CommandText = "SELECT ... WHERE field1=@p_Field1 ...." ...

How to Save a TextField Content to a File in VB

Hello, I'm trying to know how to save a content of a TextField to a File, like a .txt, using a Common Dialog, only a command dialog in Visual Basic 6, i need this using a only a common dialog, because i'm trying to do the same aplication in eVB, and eVB does not support this methods: Dim objFSO As New Scripting.FileSystemObject D...

How To Put a Menu Bar in an Application

I'm having some problems with eVB. How can I put a menu bar in an eVB project? I can't see any components to do that, and I don't know how to do this. Here is an example of a menu bar made in eVB, but it's not my program. I found this image in Google: ...

ActiveX for Browser. Which one should be choose VB6 or .NET?

Hi, I've to create an activeX control that need to run without any prerequisit (like .net). When user come by using IE, s/he just click and start using. No .net and anything else need to be installed. Actually, this query is about a print activeX control that just send a print directly without popup any window. I've created a .NET Comp...

VB6 Vertical Sync for Emulator

This is maybe an oblique question: I'm writing an emulator in VB6 (silly me). For smooth window refreshing in the emulator itself, I would like to grab the vertical sync of the monitor. Are there any Windows API calls I can use? Or is this an impossible request? ...

How to check the entered filename in the textbox is correct or not

How to check the entered filename in the textbox is correct or not? Am new to VB 6 In Text Box am entering or selecting the path and filename from local machine or remote machine, once I selected the filename then i want to check the entered file name is correct or not. I cannot give like textbox = “Selected Path”, because I can sel...

properties of c# class is not visible at visual basic 6.0

I have created a class in c# and made the com visible property is true. But, i could not see the its properties at visual basic 6.0. what could be a problem? please help me ...

How can I pretty-print XML source using VB6 and MSXML?

I've been looking after this for months now and I mostly found sites asking the same question. The answers I did found were always for .NET or C++ or involved XSLT. ...

SetWindowSubclass is leaking user objects

I'm using Bear to inspect user objects and the WindowProc count is never decreasing upon RemoveWindowSubclass. So does the total in USER which is the User Objects in Task Manager. I read Raymond's Safer subclassing comment on removing subclassing before destroying the window but my test is done w/o destroying it at all. The same subcla...

How to open a file and put its contents In a TextField?

I'm trying to learn how to open a file, and put its contents in a TextField, using a Common Dialog, only a command dialog in Visual Basic 6. I need this using a only a common dialog, because I'm trying to do the same application in eVB, and eVB does not support things like these, that makes the VB6 development more simple: Dim objFSO A...

VB6 Error - Cannot load .ocx File

Good afternoon, I have been trying to load a OCX file into one of my VB6 projects for most of the day today. I've tried checking the COM registration in the registry the best that I know how, and have attempted several times using REGSVR32 on the file to no avail. All I keep getting from VB6 when I try to load the component (Under Pro...