Re: How to debug an ActiveX DLL



You don't even need the main application in the IDE Dag. Hence, you don't
need its source and it doesn't even have to be a VB app

Just loaded the VB project for the DLL into the IDE, set the 'project start'
properties to 'Wait for Components to be Created', and just run it. It will
then wait until the main application tries to instantiate one of its
classes.

The VB IDE messes with the registry, and is itself a sort of DCOM server. It
redirects the relevant entries for a component to vb6debug.dll, which then
relays calls, etc., back to the IDE session currently executing a p-code
copy of that component.

In fact, in the Debugging tab of the project properties, you can even
instruct it to run your main app whenever you want to debug the VB DLL. This
is what makes it possible to debug VB DLLs loaded by ASP, or the SQLServer
DTS tasks, or MMC snap-ins, etc. They're not really very different from the
OP's scenario

Tony Proctor

"Dag Sunde" <me@xxxxxxxxxxxx> wrote in message
news:444de8f7$1@xxxxxxxxxxxxxxxxxx
"Roy Lewallen" <w7el@xxxxxxxxx> skrev i melding
news:124rpqga1ptn1a@xxxxxxxxxxxxxxxxxxxxx
Jon Ripley wrote:
Hi,

I have been searching for a few months for concrete advice on how to
debug an ActiveX DLL written in VB6. None of the advice I have seen
and
followed so far has achieved anything and I'm hoping that someone here
will be able to point me to a resource or give me some instructions on
how to do what I need.

I have written a DLL called xyz.dll which is a plug in for a closed
source application called abc.exe. The plug in works fine except for a
few known cases where there is a runtime error 5, I know what routine
the
error occurs in but can glean no further information - such as which
statement is generating the error and what the state of the variables
are
at the time of the error.

The only solution I can currently see, as no other solutions seem to
exist, is to rewrite from observation enough of abc.exe in VB as a form
in an exe version of my project so that I can interactively debug the
code. I'd rather not have to do this as I would have to spend several
weeks reengineering a lot of code from abc.exe.

There has to be a simpler way, but what is it?

I'm a real novice when it comes to ActiveX DLLs, but you might be able
to
do what I do. The DLLs I've made consist entirely of classes. I simply
temporarily add the classes to the main exe (in your case abc.exe) and
run
the exe in the environment.

Open the ActiveX project in one instance of vb, and the application
in another instance of vb.

In the app, make sure the References points to the activeX's .vbp file,
and not the registered dll.

Now, set the breakpoints you need in the activeX source, and hit F5.
Switch to the vb-instance containing the application project and run it.

You can now singlestep and have breakpoints in both, and jump from the app
and into methods running in the other vb (activeX project)

--
Dag.




.



Relevant Pages

  • Re: Detecting debug mode
    ... Application The Dll itself Report Truth ... A Runs compiled Runs compiled Standalone App True, ... B Runs compiled Runs in IDE In IDE App False, ...
    (microsoft.public.vb.general.discussion)
  • Re: Detecting debug mode
    ... Application The Dll itself Report Truth ... A Runs compiled Runs compiled Standalone App True, ... B Runs compiled Runs in IDE In IDE App False, ...
    (microsoft.public.vb.general.discussion)
  • Re: Where threading difference betwen VB 6.0 IDE debug mode and EXE mode.
    ... I'm using Thread Pool = 1 and GlobalMultiUse. ... The App goes about it's own business until it sees a Flag ... I would assume the same would apply if only the App was run in the IDE. ... ActiveX EXE uses just one thread for everything. ...
    (microsoft.public.vb.general.discussion)
  • Re: Window 7
    ... The error message named the dll and it was ... Anyway, my point is that when your app shows an error about ActiveX, ... Interactive Computer Services Inc. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: How to debug an ActiveX DLL
    ... The VB IDE messes with the registry, and is itself a sort of DCOM server. ... instruct it to run your main app whenever you want to debug the VB DLL. ... is what makes it possible to debug VB DLLs loaded by ASP, ...
    (comp.lang.basic.visual.misc)