Solved

Debugging COM Dll

Posted on 2002-04-18
6
534 Views
Last Modified: 2010-04-04
Hi,
  I read in so many sites that it's possible to debug a dll in delphi by giving the host appln in Run parameters -and setting the breakpoint in code..But i'm not able to do it..
My dll is an activex dll that uses an ISAPI Dll..
I set the output dir to the virtual folder and set the host appln as internetexplorer.exe..
But it's not working..?
There are detailed docs available for debugging ISAPI dlls.but not for COM objects..
Kindly help..

Thanks and Regards
Latha
0
Comment
Question by:premaa
6 Comments
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 6951386
in delphi IDE set the projects Run->Parameters
set the Host Application to explorer.exe
then run Task Manager and terminate explorers process
then in delphi IDE simply run the project
it will then launch explorer as shell
you should be able to debug COM then

if your shell isn't explorer.exe then change it to your shell
sometimes when terminating the explorer shell it gets relaunched ..
0
 

Author Comment

by:premaa
ID: 6952959
Hi ,

 Thanks for the immediate response..
I meant the internet explorer..iexplorer.exe
The explorer is launced and the asp file is
also opened..the asp file calls the dll function
when i set the breakpoint it's not stopping..
I've set the output dir to the virtual folder..
is that the problem? or shld i make the working
folder itself virtual and then try?
getting an access violation at bordbk50.dll when i do a program reset..

Thanks and Regards
Prema
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 6953287
dunno bout this
but if you have a com object then I guess it's the same
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:premaa
ID: 6953299
Thanks for trying to help....

Regards
Prema
0
 

Accepted Solution

by:
MimsyBoro earned 100 total points
ID: 7927890
To Debug A COM Object:
1. Compile with all the debug options (No Optimization, Frame Stacking, Debug Info, Map Symbols, Remote Debug Info the works...)
2. Set your breakpoints,
3. Run the application calling your COM Object

If the application running your COM Object is an ISAPI DLL or maybe a ASP Page you have two options:
a. Make another version of the COM Object that is Out-Of-Process (You do this by creating a new Appication and then calling New\Com Object).
Then you run this program before loading the ASP of ISAPI and they will connect to your COM Object

if you don't want to make an out-of-proc version there is an easier but longer method:
0. First make another virtual directory that points to the same location. Give it the same name but add on the word "Debug" (or anything else you like to distinguish the two)
1. Select the Virtual Directory you created that are calling this COM Object in the IIS control panel
2. Change it's Application Level to High. Make sure it can execute scripts.
3. Open up the Control Panel\Component Services
4. Find your Virtual Directory (usually under Component Services\Computers\My Computer\IIS MyVirtualDir) and open the property sheet
5. Under Identity Change the Identity to Interactive User
6. Under Advanced check launch in Debugger
7. Copy from the text-box "Debugger Path" the command line paramaters (usaully somthing like "/ProcessID:{3D14228D-FBE1-11D0-995D-00C04FD919C1}"
8. Set the run paramaters in Delphi to
Application: C:\winnt\system32\dllhost.exe
Paramaters: <the paramters you copied above>
Now run...
good luck
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9003530
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from MimsyBoro

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now