VB6: I Can’t Figure Out Why This Code Works

VB6/A uses implicit two-way UTF16-ASCII translation when reading / writing files using built-in operators. Line Input treats the file as being in ASCII (a series of bytes, each represents a character), using the current system codepage for non-Unicode programs. The read characters are converted to UTF-16. When you read a UTF-8 file in this way, … Read more

How do I create a manifest file to launch application with admin privileges?

You don’t actually create the manifest file in VB. A Windows application manifest is a standard text document, formatted as XML. You can create it in Notepad and save it with the appropriate file name in your application’s directory (YourAppName.exe.manifest). Microsoft has more information available here: Application Manifests. It even includes a sample manifest that … Read more

Making a C# kill event for a vb6 app?

Here is a pretty standard scheme for asynchronous background processing with VB6 clients and VB6 servers. (For instance it’s in Dan Appleman’s book and Microsoft’s VB6 samples.) I think it should work for a C# client too. The VB6 ActiveX EXE object should expose an event CheckQuitDoStuff(). This takes a ByRef Boolean called Quit. The … Read more

Download File – VB6

If you want to do it with code only (no Internet Transfer Control), VBNet.mvps.org has a really good how-to article that uses the URLDownloadToFile API call. From the article: The URLDownloadToFile API is available on all versions of the Windows operating system (except Win3, WinNT3.x). By passing the remote file name and the local file … Read more