473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to monitor exe and dll interactions?

Hello everyone,
Are there any tool or other methods which could be used to monitor which
class/method exe is accessing a DLL?

Now I met with an issue that when I provide the DLL I developed to a 3rd
parth application, it will crash sometimes and I suspect the 3rd party
application is invoking some class/method which I do not implement the DLL. I
have the full source codes of the DLL, but has no source codes of the exe so
I am wondering whether there are some methods to monitor the interactions --
e.g. I can monitor which class/method the exe is invoking and at the same
time my DLL has not implemented.

I am using Visual Studio 2005 to develop native (unmanaged) C++ DLL, and I
expose the interface of the DLL to exe through COM interface.
thanks in advance,
George
Oct 26 '07 #1
13 8794
>Are there any tool or other methods which could be used to monitor which
>class/method exe is accessing a DLL?
A debugger.

The SysInternals Process Explorer tool can tell you which processes
have a DLL loaded.
>Now I met with an issue that when I provide the DLL I developed to a 3rd
parth application, it will crash sometimes
What sort of crash?
>I am wondering whether there are some methods to monitor the interactions --
e.g. I can monitor which class/method the exe is invoking and at the same
time my DLL has not implemented.
I am using Visual Studio 2005 to develop native (unmanaged) C++ DLL, and I
expose the interface of the DLL to exe through COM interface.
If you've got dummy methods that you fear are being called by the
other application, add some diagnostic logging so you have a better
idea what's going on.

Dave
Oct 26 '07 #2
Hi David,
What do you mean *debugger* and *The SysInternals Process Explorer tool*?
Something in Visual Studio 2005?
regards,
George

"David Lowndes" wrote:
Are there any tool or other methods which could be used to monitor which
class/method exe is accessing a DLL?

A debugger.

The SysInternals Process Explorer tool can tell you which processes
have a DLL loaded.
Now I met with an issue that when I provide the DLL I developed to a 3rd
parth application, it will crash sometimes

What sort of crash?
I am wondering whether there are some methods to monitor the interactions --
e.g. I can monitor which class/method the exe is invoking and at the same
time my DLL has not implemented.
I am using Visual Studio 2005 to develop native (unmanaged) C++ DLL, and I
expose the interface of the DLL to exe through COM interface.

If you've got dummy methods that you fear are being called by the
other application, add some diagnostic logging so you have a better
idea what's going on.

Dave
Oct 26 '07 #3
>What do you mean *debugger* and *The SysInternals Process Explorer tool*?
>Something in Visual Studio 2005?
VS2005 has the debugger integrated - just press F5 to run your program
under the debugger.

Process Explorer is one of the invaluable free tools supplied by
SysInternals (now part of MS).

http://www.microsoft.com/technet/sys...s/default.mspx

Dave
Oct 26 '07 #4

"David Lowndes" <Da****@example.invalidwrote in message
news:kn********************************@4ax.com...
Are there any tool or other methods which could be used to monitor which
class/method exe is accessing a DLL?

A debugger.

The SysInternals Process Explorer tool can tell you which processes
have a DLL loaded.
>>Now I met with an issue that when I provide the DLL I developed to a 3rd
parth application, it will crash sometimes

What sort of crash?
>>I am wondering whether there are some methods to monitor the
interactions --
e.g. I can monitor which class/method the exe is invoking and at the same
time my DLL has not implemented.
I am using Visual Studio 2005 to develop native (unmanaged) C++ DLL, and I
expose the interface of the DLL to exe through COM interface.

If you've got dummy methods that you fear are being called by the
other application, add some diagnostic logging so you have a better
idea what's going on.
For example, force all your dummy functions to call DebugBreak.
>
Dave

Oct 29 '07 #5
Thanks Ben,
Your solution does not work for me. Because in my situation, I do not have
the non-implemented methods -- even an empty skeleton with a single return
statement. So, I do not have a function to set a break point or break
activelt using DebugBreak.
regards,
George

"Ben Voigt [C++ MVP]" wrote:
>
"David Lowndes" <Da****@example.invalidwrote in message
news:kn********************************@4ax.com...
>Are there any tool or other methods which could be used to monitor which
class/method exe is accessing a DLL?
A debugger.

The SysInternals Process Explorer tool can tell you which processes
have a DLL loaded.
>Now I met with an issue that when I provide the DLL I developed to a 3rd
parth application, it will crash sometimes
What sort of crash?
>I am wondering whether there are some methods to monitor the
interactions --
e.g. I can monitor which class/method the exe is invoking and at the same
time my DLL has not implemented.
I am using Visual Studio 2005 to develop native (unmanaged) C++ DLL, and I
expose the interface of the DLL to exe through COM interface.
If you've got dummy methods that you fear are being called by the
other application, add some diagnostic logging so you have a better
idea what's going on.

For example, force all your dummy functions to call DebugBreak.

Dave


Oct 29 '07 #6
Thanks Dave,
I have downloaded process monitor tool and it looks great! So many cool
figures and dynamic. :-)

For my original question, I think it should be better that I solve it by
myself mostly from my own efforts, but to tell the truth I have no experience
of this tool and it is highly appreciated if you could give me some start
point of this tool, e.g. which menu and which function item I should use from
this tool to monitor the interactions between EXE and COM DLL. Then, from
your directed start point, I will do some research work by myself to make my
hands dirty.
regards,
George

"David Lowndes" wrote:
What do you mean *debugger* and *The SysInternals Process Explorer tool*?
Something in Visual Studio 2005?

VS2005 has the debugger integrated - just press F5 to run your program
under the debugger.

Process Explorer is one of the invaluable free tools supplied by
SysInternals (now part of MS).

http://www.microsoft.com/technet/sys...s/default.mspx

Dave
Oct 29 '07 #7
>For my original question, I think it should be better that I solve it by
>myself mostly from my own efforts, but to tell the truth I have no experience
of this tool and it is highly appreciated if you could give me some start
point of this tool, e.g. which menu and which function item I should use from
this tool to monitor the interactions between EXE and COM DLL.
I won't let you monitor the interactions of your COM DLL, but it will
let you find which processes have it loaded - use the Find menu item
to find the name of your DLL and it'll show any processes that
currently have it loaded.

Dave
Oct 29 '07 #8

"George" <Ge****@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.com...
Thanks Ben,
Your solution does not work for me. Because in my situation, I do not have
the non-implemented methods -- even an empty skeleton with a single return
statement. So, I do not have a function to set a break point or break
activelt using DebugBreak.
What does exist? There must be something... because if the function didn't
exist at all there would be no way to compile a call to it.

So what does this non-implemented method look like? A coclass that doesn't
implement a particular interface (break on the failure path of
IUnknown::QueryInterface)? A dispinterface with some DISPIDs not
implemented (break on the failure path of IDispatch::Invoke)?
>

regards,
George

Oct 29 '07 #9
Thanks Dave,
I have tried with process explorer, but it could only get the list of the
DLL which is loaded by an EXE, and can not monitor the interactions between
EXE and DLL (e.g. function call), right?
regards,
George

"David Lowndes" wrote:
For my original question, I think it should be better that I solve it by
myself mostly from my own efforts, but to tell the truth I have no experience
of this tool and it is highly appreciated if you could give me some start
point of this tool, e.g. which menu and which function item I should use from
this tool to monitor the interactions between EXE and COM DLL.

I won't let you monitor the interactions of your COM DLL, but it will
let you find which processes have it loaded - use the Find menu item
to find the name of your DLL and it'll show any processes that
currently have it loaded.

Dave
Oct 30 '07 #10
Thanks Ben,
There are some optional interface, which I do not implement (means no
skeleton functions -- e.g. only a return value in implementation body).

Have I made myself understood? Any comments?
regards,
George

"Ben Voigt [C++ MVP]" wrote:
>
"George" <Ge****@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.com...
Thanks Ben,
Your solution does not work for me. Because in my situation, I do not have
the non-implemented methods -- even an empty skeleton with a single return
statement. So, I do not have a function to set a break point or break
activelt using DebugBreak.

What does exist? There must be something... because if the function didn't
exist at all there would be no way to compile a call to it.

So what does this non-implemented method look like? A coclass that doesn't
implement a particular interface (break on the failure path of
IUnknown::QueryInterface)? A dispinterface with some DISPIDs not
implemented (break on the failure path of IDispatch::Invoke)?


regards,
George


Oct 30 '07 #11
>I have tried with process explorer, but it could only get the list of the
>DLL which is loaded by an EXE, and can not monitor the interactions between
EXE and DLL (e.g. function call), right?
Yes.

It sounds like you need some sort of COM spy utility. The only one I
can immediately see is here:
http://staff.develop.com/jasonw/comspy/default.htm - but it doesn't
appear to be maintained :(

Dave
Oct 30 '07 #12

"George" <Ge****@discussions.microsoft.comwrote in message
news:52**********************************@microsof t.com...
Thanks Ben,
There are some optional interface, which I do not implement (means no
skeleton functions -- e.g. only a return value in implementation body).

Have I made myself understood? Any comments?
If you are not implementing an optional interface, then you return failure
from IUnknown::QueryInterface when that IID is requested, correct?
Therefore just make QueryInterface write a log message or call
OutputDebugString when it sees an unsupported IID, then you can find out
which interfaces the application is trying to use.
>

regards,
George

"Ben Voigt [C++ MVP]" wrote:
>>
"George" <Ge****@discussions.microsoft.comwrote in message
news:25**********************************@microso ft.com...
Thanks Ben,
Your solution does not work for me. Because in my situation, I do not
have
the non-implemented methods -- even an empty skeleton with a single
return
statement. So, I do not have a function to set a break point or break
activelt using DebugBreak.

What does exist? There must be something... because if the function
didn't
exist at all there would be no way to compile a call to it.

So what does this non-implemented method look like? A coclass that
doesn't
implement a particular interface (break on the failure path of
IUnknown::QueryInterface)? A dispinterface with some DISPIDs not
implemented (break on the failure path of IDispatch::Invoke)?
>

regards,
George



Nov 1 '07 #13
Thanks Ben,
Seems that some implementation of the methods are not correct, since all the
IID are implemented in QueryInterface.
regards,
George

"Ben Voigt [C++ MVP]" wrote:
>
"George" <Ge****@discussions.microsoft.comwrote in message
news:52**********************************@microsof t.com...
Thanks Ben,
There are some optional interface, which I do not implement (means no
skeleton functions -- e.g. only a return value in implementation body).

Have I made myself understood? Any comments?

If you are not implementing an optional interface, then you return failure
from IUnknown::QueryInterface when that IID is requested, correct?
Therefore just make QueryInterface write a log message or call
OutputDebugString when it sees an unsupported IID, then you can find out
which interfaces the application is trying to use.


regards,
George

"Ben Voigt [C++ MVP]" wrote:
>
"George" <Ge****@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.com...
Thanks Ben,
Your solution does not work for me. Because in my situation, I do not
have
the non-implemented methods -- even an empty skeleton with a single
return
statement. So, I do not have a function to set a break point or break
activelt using DebugBreak.

What does exist? There must be something... because if the function
didn't
exist at all there would be no way to compile a call to it.

So what does this non-implemented method look like? A coclass that
doesn't
implement a particular interface (break on the failure path of
IUnknown::QueryInterface)? A dispinterface with some DISPIDs not
implemented (break on the failure path of IDispatch::Invoke)?

regards,
George



Nov 29 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: fournij | last post by:
Hi I'm writing a MFC C++ application using Visual .NET. I'm using a Dual Head video card with 2 monitors. I want to start my application in the first monitor but open a dialog box in the...
2
by: www.brook | last post by:
I have a VC++.net code. Two threads are created, one thread keeps appending elements to the queue, another keeps deleting an element from the queue. I tried to use monitor, but it seems that the...
12
by: Perecli Manole | last post by:
I am having some strange thread synchronization problems that require me to better understand the intricacies of Monitor.Wait/Pulse. I have 3 threads. Thread 1 does a Monitor.Wait in a SyncLock...
4
by: Raj | last post by:
Can we create an event monitor for statements in a partitioned environment? CREATE EVENT MONITOR stmt_event FOR STATEMENTS WRITE TO FILE '/home/rajm/event' ON PARTITION 0 GLOBAL DB21034E ...
1
by: NachosRancheros | last post by:
Ok so I just started to program with Python about a week ago and I am trying to make a program that will take the path of a file and a shortcut command and save it to a text file. Eventually I want...
1
by: Thomas Strauss, SRS | last post by:
Hi, I have a really hard time to find the access rights required for monitoring a printing queue or share in windows XP or Win2000/2003 server. We have an application that will remote control...
3
by: =?Utf-8?B?RGFuaWVs?= | last post by:
I'm working with the FileSystemWatcher which has a Created event. But this event is raised as soon as the new file begins to be written on disk. What I want is a notification after a file being...
3
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I am trying to figure out how to monitor user input. I have the user typing in a textbox where I fire a method on the text changes event but this fires on every letter and it fies mant...
5
by: jbenner | last post by:
I have opened a PMR for this with IBM, and am not asking for advice from the DB2 DBA community. I am posting this as an FYI that DB2 Health Monitor, even at the latest version of DB2, still can cause...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.