How to implement a global error handler VB6?

The VB6 global error handler product, mentioned in the following link, states that "set a small callback to the VBE6 debugger":

http://www.everythingaccess.com/simplyvba/globalerrorhandler/howitworks.htm

I would like to implement this product myself, because I would like to have more control over what it does. How can the above product achieve what it does?

+3
source share
1 answer

The product you are looking at is a COM component. From the documentation that is available on the website, it appears that the COM component implements certain classes of components. The first thing to do if you already have a product is to run SysInternals procmon, run regsvr32in the DLL and find out which component classes are implemented from the generated registry entries. Once you know this, MSDN will be able to tell you which interfaces correspond to these component classes.

Microsoft has developed an infrastructure called Active Scripting, which allows you to host the script engine and implement debugging capabilities. Assuming VB6 creates an exe that is associated with this card, you can do:

  • Create a COM component that implements IApplicationDebugger
  • IApplicationDebugger::onHandleBreakPoint, VB
  • MSDN KB Q222966, , VB onHandleBreakPoint

, ErrEx, IActiveScript::AddNamedItem. , IActiveScriptSite::GetItemInfo COM, ( TypeInfo ) COM-, , ErrEx. ErrEx.EnableGlobalErrorHandler :

  • CoCreateInstance inproc Process Debug Manager
  • IRemoteDebugApplication
  • IApplicationDebugger, IRemoteDebugApplication::ConnectDebugger

IActiveScript::AddNamedItem, , IActiveScript . , , Process Debug Manager, - .

, , waaay ...

Active Scripting API MSDN.

+1

All Articles