Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

view DLL code in ejecution

Status
Not open for further replies.

MarKes

Programmer
May 3, 2001
18
0
0
ES
hi
I don´t know, if I can view the code of a Dll while I`m running my program from VB6, (like I can view the code of my aplication with F8...)
When I`m running my program, shows me an error in DLL, but I can`t know where exactly the error occurs.
How can I see in wich line is the Error in DLL?

thanks in advance
 
Yes,

Run the Dll in another instance of VB. Then place a breakpoint in your exe project and run that. As the Dll is called the debugging will switch to the Dll project and you can step through that.

Regards,

Codefish
 
I don't understand what CodeFish means!

You can open your DLL as the original VB project that it was comiled from along side the project you are accessing the DLL from. This will create a project group. Then goto Tools|Options and in the general tab check 'Break in Class Module'. Then any errors that occur inside the DLL code will break in the code allowing you to debug as usual. You can also do all the usual watches and step throughs.

If this is what CodeFish meant then I'm sorry to reiterate. If this is not what you meant then can you explain what you mean!?

Otherwise, if you MUST use the code COMPILED into an actual DLL (as I often do) then the best alternative I have found is to use the erl function which will return the line number of any error. We actually use a third party tool called ErrorAssist as its cheap and saves a lot of hassel. If you want any more info on erl or ErrorAssist just ask.

Hope this helped,

elziko
 
Let me explain further.

elziko was quite right, to debug a dll component the easiest way is to add its source code project along side the 'exe' project to create a project group.

However another way you can debug a dll component:-
Is buy running the dll source code project in its own separate instance of VB. Then Add a reference to this in the calling exe project and run this exe project with a breakpoint in the code (Hence 2 instances of VB open and running).

When the exe project calls a method or property of the Dll the focus will switch to the other instance of VB(dll project) and you can step through the code.

(N.B I believe this method is mainly used to debug ActiveX exe's.)

For further info see "Debugging Components" on MSDN

The reason why we use this method is because we use this method all the time to Debug Dll's in Web Applications -Instances of VB(dlls) running with an instance of InterDev.

Codefish
 
I personally prefer to debug components in separate instances of VB. I have friends who use Project Groups -- It comes down to a question of style, flip a coin!

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top