The Delphi7 Application has two EXE. One main EXE and other Secondry EXE. Main Exe loads this Secondry Exe when it runs(executed) as I have checked it in the EVENT LOG.

I want to debug this secondry exe. At present I am able to debug only main exe. The functionalities of Secondry Exe are called using the interface from Main Exe.

When I set the debug points in Secondry Exe and execute the Main Exe. The debug points in the Secondry Exe are marked checked with green color(Not the cross). But the debugger is not coming to the Secondry Exe it is confined to the Main Exe only.

Three options I have already set in both project 0n Project -> Options

1 Checked Use debug DCUs option on compiler page

2 Include TD32 debug info on Linker page

3 Include remote debug symbols on Linker page

This Delphi7 Application was built by some one else. I have to carry out certain changes.

So if anyone aware of above problem (debugging one Exe from other Exe) kindly help me out.

Recommended Answers

All 3 Replies

If I have understood your question correctly what you are trying to do is this

  • You have two Delphi applications
  • You want to run App A from App B
  • You want to debug App B

From what I can tell you are going about this by running App A in your Delphi IDE, perhaps leaving App B open in another instance of D7 and then you expect that the instance running App A will somehow stop at breakpoints you have set in App B?

Now that isn't logical is it.

What you need to do is this

  1. Go to the instance of Delphi where you have opened App B
  2. From the Run menu select Run Parameters
  3. In the Host Application edit box enter the full path to AppA.exe - you should have this compiled and ready
  4. If AppA takes any parameters make sure you supply them

This typically is the way one debugs a DLL called by an app. Not sure what you are trying to do but this is the general area in which you should be looking. If this does not help write back with a clear description of your problem.

Thanx for response,
I had tried this also earlier but this does'nt worked.
This concept worked on the dll which my application is using. And I had already debugged the dll on this very concept.
See, my application consists of two Exe, One dll, and one OCX.
When Main.Exe runs it loads the dll and Secondry.Exe. It is using interface in the Type libray declared in the Main.Exe to use the functionality of Secondry.Exe.
In the Secondry.Exe this type library is included in the Uses section. The interfaces of the type library are defined in the Secondry.Exe project.
My main aim is to debug the Secondry.Exe

the code through which type libray is loaded is
constructor TServiceConnStateSink.Create(MsgWnd: HWND);
var
TypeLib: ITypeLib;
begin
OleCheck(LoadTypeLib(PWideChar(WideString(FindServiceLibPath)), TypeLib));
inherited Create(TypeLib, IID_IServiceTaskSink);
FMsgWnd := MsgWnd;
end;
Hope I am able to clear problem little bit.
Do you have nay mail or chat Id? So that I explain you in better way.

I see. I can think of one rather elegant way of doing what you are after but don't have the time to test it out and explain it right now. Will try and do so soon. In the mean time might I suggest that you use OutputDebugString in your second EXE to help with debugging? If you are running in the Delphi IDE the debug messages will ususally be available in the Debug Event Log window (CTRL + ALT + V). If you are running a standalone EXE you could try getting DebugView from SysInternals - now part of Microsoft but still a freebie.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.