Solved

debugging a COM dll

Posted on 2003-11-26
7
652 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

758 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

23 Experts available now in Live!

Get 1:1 Help Now