How to debug COM objects in VC ++

zhaozj2021-02-16  45

How to debug COM objects in VC

Debugging Out-of-Process Server

Because the service method and event implementation depends on the customer to trigger, the debug service must start the customer program first.

method one:

1. Enter a client in Project àsetting debug TAB;

2. Set the breakpoint to be adjusted in the service program code.

Method 2: (Start the debug task in the customer engineering)

1. Open the customer engineering, set to debug compilation mode; open the JIT (JST-IN-TIME) option.

[ToolàOptionàDebug Tab] Select "Just-in-Time Debugging" and

"OLE RPC DEBUGGING" option.

2. In the code, set the breakpoint at the line code of the service, start the Debugger running the customer;

3. When debugging is stopped at the breakpoint (call service), followP INTO) call, if your application

The program is connected to the MFC, and the VC will automatically open the entry to the correct and appropriate code;

4. Use Step over to debug until the assembly is displayed, marked at the beginning of the customer stub DLL;

5. Continue to run through STUB and Proxy single-step debugging, when stepped into the service method, the VC will automatically start

Another example of Debugger.

Debug The Message ActiveX Control

[Project àsetting à debug tab, in "Executable for Debug Session"

Select the appropriate procedure]

Debug remote object (Debug Remote Object)

Attaching the debugger to a remote process

1. Open the customer program and set a breakpoint;

2. Use the Debugge running the program until the breakpoint is triggered, determine this at this time the server is activated;

3. Start the VC on the machine where the component is located, activate the attach to process command, from the list of procedures

Select Components or Her Surrogate in the box to enable Debugger to the object's process.

4. Open the component source code in the VC environment and set a breakpoint;

5. On the client, restore the running program, stop when the remote object is running to the breakpoint.

转载请注明原文地址:https://www.9cbs.com/read-26958.html

New Post(0)