vb6

How do you migrate a large app from VB6 to VB .net ?

My company makes a monolithic piece of software that our customers use to run their car dealerships. The original app was written in VB6, and it has grown substantially over the last few years. Until now, there hasn't really been a business case for switching to the .net framework. Sure, it's newer, considerably better at certain things,...

Unload a COM control when working in VB6 IDE

Part of my everyday work is maintaining and extending legacy VB6 applications. A common engine is written in C/C++ and VB6 uses these functions in order to improve performance. When it comes to asynchronous programming, a C interface is not enough and we rely on COM controls to fire events to VB6. My problem is that when I register th...

How to use a mutex in Visual Basic

OK - I have imported the kernel32 library so I have the createMutex function available, but I am not quite sure of the various parameters and return values. This is classic Visual Basic, not Visual Basic.NET - but I can probably work with either code set in the form of an answer....

'Break' equivalent keyword for VB

Just moved over to the VB team here at work. Quick easy one for my 1st question. What is the equivalent keyword to break in VB, i.e., to exit a loop early but not the method? Cheers! ...

How do I best share an embeddable form in VB6?

Is there a good way to create a form in VB6 that can easily be embedded inside other forms? On a few occasions recently, I've wanted to design and code a Form object that I could plug into several other "parent" forms. My goal is to create a centralized piece of code for managing several UI components in a particular way, and then be a...

How to parse XML in VBA

Hi, I work in VBA, and want to parse a string eg <PointN xsi:type='typens:PointN' xmlns:xsi='<http://www.w3.org/2001/XMLSchema-instance&gt;' xmlns:xs='<http://www.w3.org/2001/XMLSchema&gt;'&gt;&lt;X&gt;24.365&lt;/X&gt;&lt;Y&gt;78.63&lt;/Y&gt;&lt;/PointN&gt; and get the X & Y values into two separate integer variables. I'm a newbie ...

Prevent a TreeView from firing events in VB6?

In some VB6 code, I have a handler for a TreeView's Collapse event: Private Sub MyTree_Collapse(ByVal Node as MSComCtlLib.Node) This is called whenever a node in the tree is collapsed, whether by the user or programmatically. As it turns out, through some roundabout execution, it may happen that this handler will wind up telling a no...

Copying Files over an Intermittent Network Connection

I am looking for a robust way to copy files over a Windows network share that is tolerant of intermittent connectivity. The application is often used on wireless, mobile workstations in large hospitals, and I'm assuming connectivity can be lost either momentarily or for several minutes at a time. The files involved are typically about 20...

Local Currency String conversion VB6

I am maintaining an app for a client that is used in two locations. One in England and one in Poland. The database is stored in England and uses the format £1000.00 for currency, but the information is being gathered locally in Poland where 1000,00 is the format. My question is, in VB6 is there a function that takes a currency string i...

How to filter by 2 fields when loading data into an access database table from an excel spreadsheet

OK, here is my problem, without being too specific for reasons of being fired for putting company practices on the internet. There are spreadsheets made. These are uploaded to the database. I need to filter out duplicates from uploading. The only way to do this is by making sure that for each and every entry that two fields aren't the s...

Using Subversion with VB6

My team is moving from Visual SourceSafe to Subversion soon, while developing/supporting a legacy project in VB6, so I have a couple of questions: What's the best tool for Subversion IDE integration in Visual Studio 6? (or is it not worth the trouble...) Are there any best practices for using Subversion with VB6? (file types to ignore,...

When must I set a variable to "Nothing" in VB6?

In one of my VB6 forms, I create several other Form objects and store them in member variables. Private m_frm1 as MyForm Private m_frm2 as MyForm // Later... Set m_frm1 = New MyForm Set m_frm2 = New MyForm I notice that I'm leaking memory whenever this (parent) form is created and destroyed. Is it necessary for me to assign these me...

How would you extract data from a MS Project .mpp file?

I need to extract data from a .mpp file on the network and combine it with other data from several different databases. The application can be written in Perl, VB6, VB.net or C# but must be easily scheduled from a Windows based server. What would you recommend to extract the MS Project data with no user intervention? Is there any ODBC...

Calling DLL functions from VB6.

I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years and I don't even have it installed. What could be th...

What's the simplest .NET equivalent of a VB6 control array?

Maybe I just don't know .NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in .NET (assume this code is on a form with N CommandButtons in array Command1() and N TextBoxes in array Text1()): Private Sub Command1_Click(Index As Integer) Text1(Index).Text = Timer End Sub I know i...

Check if a record exists in a VB6 collection?

I've inherited a large VB6 app at my current workplace. I'm kinda learning VB6 on the job and there are a number of problems I'm having. The major issue at the moment is I can't figure out how to check if a key exists in a Collection object. Can anyone help? ...

VB6 NegotiateMenus

I have a vb6 form that I've put an ocx control on. Setting NegotiateMenus on the form displays the ocx's control (which is what I want). I then add my own control to the form. When that control has focus, the menu from the ocx disappears. How can I always keep the menu from the ocx displayed, regardless of who has focus? ...

How do I click a button on a vb6 form?

I have a vb6 form with an ocx control on it. The ocx control has a button on it that I want to press from code. How do I do this? I have: Dim b As CommandButton Set b = ocx.GetButton("btnPrint") SendMessage ocx.hwnd, WM_COMMAND, GetWindowLong(b.hwnd, GWL_ID), b.hwnd but it doesn't seem to work. ...

ActiveX control default property discovery

Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default! /EDIT: Without having source to the object itself ...

Classes in VB6

Yeah, I'm stuck maintaining some legacy software. Does anyone know of any good tutorials on creating classes and whatnot in VB6? My Google-fu seems to be failing me. :-/ ...