Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

debugging a COM dll

Posted on 2003-11-26
7
Medium Priority
?
675 Views
Last Modified: 2013-12-14
I have a C++ COM dll in Visual Studio 6. I want to add a simple console application project to the same workspace to call functions in the dll and be able to step through all the lines of code. How can I do this?
0
Comment
Question by:MrNed
  • 3
  • 3
7 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 400 total points
ID: 9823340
If you have client (exe) and server (Dll) project, you can debug server Dll by two ways:

1) From client project.
Project - Settings - Debug. Select "Additional Dlls" from combo box and add server Dll to the list. Set breakpoint in the client project, where you call server's function. Run the program using Go command. When program stopped on breakpoint, use Step Into command to debug server code.

2) From server project.
Project - Settings - Debug. Select Executable for debug session (select server exe program). Set breakpoint in the server code. Run the program using Go command. Client is executed, when it enters the server function with breakpoint, debugger stops on it.
0
 
LVL 7

Author Comment

by:MrNed
ID: 9823369
Great, thanks - easy when you know how!

Now sorry but I wasnt too clear in my question, but how do I call a COM dll from my c code? Ive seen examples of normal dll's but I cant get it to work.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9823405
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
LVL 7

Author Comment

by:MrNed
ID: 9823540
That example has code like

const CLSID CLSID_CGreet = {0x242C8BCE,0x8D72,0x11D4,
                                {0xAC,0x91,0x00,0xB0,0xD0,0x69,0x54,0x6F}};
const IID IID_ICGreet = {0x242C8BCD,0x8D72,0x11D4,
                             {0xAC,0x91,0x00,0xB0,0xD0,0x69,0x54,0x6F}};

but I dont know where to get these numbers for the COM server component. I dont have a x_i.c file.
0
 
LVL 3

Expert Comment

by:Madz
ID: 9824377
You can get the CLSIDs and IIDs that are resident in a DLL using the OLE View tool that is shipped with Visual studio. in OLE View, use the
File->View Tylelib option to choose your DLL. The tool will then show you then type library that is contained within the DLL. You should get whatever info you need to get started from here.

Hope this helps,
Madz
0
 
LVL 48

Assisted Solution

by:AlexFM
AlexFM earned 400 total points
ID: 9824457
0
 
LVL 7

Author Comment

by:MrNed
ID: 9830148
Thanks, that got me there.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

885 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