Solved

debugging a COM dll

Posted on 2003-11-26
7
658 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
best sources to up-to-date in C++? 8 80
Post a good COM tutorial 1 54
Copy output image from TWindowsMediaPlayer 6 41
PL SQL Developer 7 34
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

770 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