| | |
Debug an Exe from other Exe which loads it in Delphi7
Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2007
Posts: 2
Reputation:
Solved Threads: 0
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.
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.
•
•
Join Date: Sep 2007
Posts: 69
Reputation:
Solved Threads: 7
If I have understood your question correctly what you are trying to do is this
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
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.
- 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
- Go to the instance of Delphi where you have opened App B
- From the Run menu select Run Parameters
- In the Host Application edit box enter the full path to AppA.exe - you should have this compiled and ready
- 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.
•
•
Join Date: Jul 2007
Posts: 2
Reputation:
Solved Threads: 0
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 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.
•
•
Join Date: Sep 2007
Posts: 69
Reputation:
Solved Threads: 7
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.
![]() |
Similar Threads
- svchost.exe using 100% cpu! (Windows NT / 2000 / XP)
- COM exe server and database (C#)
- Help what is mezenofaz22011.exe and vundo (Viruses, Spyware and other Nasties)
- Windows 2000 pro - svchost.exe using 100% cpu (Windows NT / 2000 / XP)
- lsas.exe (Viruses, Spyware and other Nasties)
- Special calculator help (C++)
- How Important is rundll32.exe? (Windows NT / 2000 / XP)
- "MiCr0s0ft.exe", "Microsoftx.exe" & "ns.exe" viruses?Please Help (Viruses, Spyware and other Nasties)
- exe application (C++)
- Error Linking KeyLogger.exe (C++)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: FTP get (with wildcards) in Delphi?
- Next Thread: Installing design packages in Delphi 8.0 for .NET
Views: 2534 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Pascal and Delphi





