473,503 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debug a C DLL

Hello,

I have an exe that calls a dll. The dll is dynamically loaded and I
use getprocaddress to get the address of the funciton I want to call.

Everything seems to work fine in debug mode but in release mode it is
blowing up at the first call to the dll. Does anybody have any advice
on how to narrow down the problem. I put popups into the exe code to
narrow down the issue to the first dll call but I am at a loss as to
what would cause debug dll to work and the release version not to work.
I can generate a map but I am terrible at reading it and I function a
lot better when the error occurs in debug mode because then I can use
the debug tool. Would the map be the best approach or is there a
better method. If I generate a map could someone help me find the
correct location in the dll?

Thanks
Jake

Jan 12 '06 #1
5 1848
On 12 Jan 2006 15:13:21 -0800, in comp.lang.c , "Jake Thompson"
<re***********@hotmail.com> wrote:
Hello,

I have an exe that calls a dll. The dll is dynamically loaded and I
use getprocaddress to get the address of the funciton I want to call.

Everything seems to work fine in debug mode but in release mode it is
blowing up at the first call to the dll.


You should ask this question again in a Windows programming group,
where the experts at this sort of stuff hang out. My guess is that
you're corrupting memory by overruning an array, or using unitialised
variables or something, and in debug mode you get away with it because
your debug build is more tolerant.

Mark McIntyre
--

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jan 12 '06 #2

Mark McIntyre wrote:
On 12 Jan 2006 15:13:21 -0800, in comp.lang.c , "Jake Thompson"
<re***********@hotmail.com> wrote:
Hello,

I have an exe that calls a dll. The dll is dynamically loaded and I
use getprocaddress to get the address of the funciton I want to call.

Everything seems to work fine in debug mode but in release mode it is
blowing up at the first call to the dll.


You should ask this question again in a Windows programming group,
where the experts at this sort of stuff hang out. My guess is that
you're corrupting memory by overruning an array, or using unitialised
variables or something, and in debug mode you get away with it because
your debug build is more tolerant.


Actually, you have this backward. The debug build has more error
checking. karl m

Jan 12 '06 #3
In article <11**********************@f14g2000cwb.googlegroups .com>,
Jake Thompson <re***********@hotmail.com> wrote:
Hello,

I have an exe that calls a dll. The dll is dynamically loaded and I
use getprocaddress to get the address of the funciton I want to call.


Allow me to be the first to say this - and I say it from the deepness of my
heart, with all the kindness and love one has come to associate with the
helpful posts you get in this newsgroup:

Not portable. Can't discuss it here. Blah, blah, blah.

Jan 13 '06 #4
Jake Thompson wrote:
I have an exe that calls a dll. The dll is dynamically loaded and I
use getprocaddress to get the address of the funciton I want to call.


Try microsoft.public.win32.programmer.*
Jan 13 '06 #5
On 12 Jan 2006 15:34:05 -0800, in comp.lang.c , "Karl Malbrain"
<ma******@yahoo.com> wrote:

Mark McIntyre wrote:
On 12 Jan 2006 15:13:21 -0800, in comp.lang.c , "Jake Thompson"
<re***********@hotmail.com> wrote:
>Hello,
>
>I have an exe that calls a dll. The dll is dynamically loaded and I
>use getprocaddress to get the address of the funciton I want to call.
>
>Everything seems to work fine in debug mode but in release mode it is
>blowing up at the first call to the dll.


You should ask this question again in a Windows programming group,
where the experts at this sort of stuff hang out. My guess is that
you're corrupting memory by overruning an array, or using unitialised
variables or something, and in debug mode you get away with it because
your debug build is more tolerant.


Actually, you have this backward. The debug build has more error
checking. karl m


No, I have it forward. The debug build typically has more tolerance of
faults, eg it initialises auto variables to zero, puts in overflow
space round arrays and structs, etc etc.
Mark McIntyre
--

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jan 14 '06 #6

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

Similar topics

8
2676
by: Davy | last post by:
Hi all, I use VC and gcc/gdb to compile and debug C/C++ files. But I found some of the debug version of the compiled files are too large to be run in a small RAM. Can I compile C/C++ Debug...
4
4508
by: emma middlebrook | last post by:
I have a question regarding asserting ... here's some code: string GetAssertMessage() { ... prepare a message string and return it... } void SomeMethod() { ...
7
2883
by: Srinivasa Rao | last post by:
I have read in one article that when we compile the application in release mode, all the debug classes and properties will be automatically removed from the code. I tried to implement this thing by...
9
1985
by: dee | last post by:
Hi I'm about to upload my site and I have switched to release version. Is that enough or do I still need to disable <compilation defaultLanguage="vb" debug="true" /> the debug="true" in the .pdb...
6
4093
by: swartzbill2000 | last post by:
Hello, I have a VB 2005 Express project with a TraceListener-derived class to route Debug.Print output to a log file. It works fine for Debug builds. What is the correct combination of changes to...
6
3651
by: pauldepstein | last post by:
To help me debug, I am writing a lot of information into a stream which I call debug. However, because of the large amount of time taken to print this information, I only want this printed while...
6
9117
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++...
0
1783
by: BA | last post by:
I posted on this once before and could not get a solution, I am hoping someone can help. I have a very strange code debug behavior that I cannot make heads or tails of: I have c# code being...
1
1710
by: gfergo | last post by:
Good Morning, I seem to be having a problem. I thought I could display detailed debugging information (including file name and line number) on a page using two different methods: 1.)...
3
3244
by: rorni | last post by:
Hi, I'm porting code from Windows to HP-UX 11, compiling with g++. I'm getting a compilation error on the system's debug.h include file, which is included very indirectly through a series of...
0
7282
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,...
1
6998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7464
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...
0
5586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4680
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1516
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.