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

what is the better way to handle errors in VB6

First of all, go get MZTools for Visual Basic 6, its free and invaluable. Second add a custom error handler on every function (yes, every function). The error handler we use looks something like this: On Error GoTo {PROCEDURE_NAME}_Error {PROCEDURE_BODY} On Error GoTo 0 Exit {PROCEDURE_TYPE} {PROCEDURE_NAME}_Error: LogError “Error ” & Err.Number & ” (” … Read more

Self Inspection of VB6 UDTs

Contrary to what others have said, it IS possible to get run-time type information for UDT’s in VB6 (although it is not a built-in language feature). Microsoft’s TypeLib Information Object Library (tlbinf32.dll) allows you to programmatically inspect COM type information at run-time. You should already have this component if you have Visual Studio installed: to … Read more