Solved

debugging a COM dll

Posted on 2003-11-26
7
656 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 100 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 100 total points
ID: 9824457
0
 
LVL 7

Author Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

919 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now