开发者

How to debug a COM dll in Delphi?

I try to debug a COM dll (TAutoObject) in Delphi and my break point are not green.

开发者_高级运维I put my option like this :

  • host : c:\Program Files\Internet Explorer\iexplore.exe
  • param : c:\software\test.html

My test is well lanched but no breakpoint in Delphi

what is the way to to this ?


You have to run the program which launches the COM+ object and then attach it to the process.


IE launches a sub-process which hosts non-trusted code. this is probably why your debugging settings are not working, and why attaching to the process once launched works.


Since the debugger doesn't start the file, that won't work.

IIRC you can try to "attach to process" to the process running it (iexplorer.exe), but the problem is that that doesn't allow to debug through the start of the component. (since it costs time to manually attach)

I had a different setup where I instantiated a very slightly differently compiled .ocx on a panel of a delphi app, and used that to debug. Which worked fine.d


This link Breakpoint not honored while debugging a DLL helped me debug my com dll in Delphi 5. Go to Project -> Options -> Linker -> check mark "Include remote debug symbols". I couldn't tell you why it worked. Delphi 5's help provided the following description:

Include remote debug symbols Check this if you are using remote debugging.


You also need to have integrated debugging turned on. Its on the general tab of the debugger options.

In the past what I have done is to create a separate program which invoked my COM object and used it as the target for debugging rather than the standard host. This simplifies things and also allows you to create specific repeatable tests of known issues to aid in smoke testing later.


you can also use tools like CodeSite.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜