Debug a C DLL

Discussion in 'C Programming' started by Jake Thompson, Jan 12, 2006.

  1. 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
     
    Jake Thompson, Jan 12, 2006
    #1
    1. Advertising

  2. On 12 Jan 2006 15:13:21 -0800, in comp.lang.c , "Jake Thompson"
    <> 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 =----
     
    Mark McIntyre, Jan 12, 2006
    #2
    1. Advertising

  3. Mark McIntyre wrote:
    > On 12 Jan 2006 15:13:21 -0800, in comp.lang.c , "Jake Thompson"
    > <> 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
     
    Karl Malbrain, Jan 12, 2006
    #3
  4. In article <>,
    Jake Thompson <> 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.
     
    Kenny McCormack, Jan 13, 2006
    #4
  5. Jake Thompson

    Grumble Guest

    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.*
     
    Grumble, Jan 13, 2006
    #5
  6. On 12 Jan 2006 15:34:05 -0800, in comp.lang.c , "Karl Malbrain"
    <> wrote:

    >
    >Mark McIntyre wrote:
    >> On 12 Jan 2006 15:13:21 -0800, in comp.lang.c , "Jake Thompson"
    >> <> 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 =----
     
    Mark McIntyre, Jan 14, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    9,002
  2. Dave
    Replies:
    0
    Views:
    683
  3. RonL
    Replies:
    0
    Views:
    776
  4. ringos75
    Replies:
    0
    Views:
    998
    ringos75
    Apr 14, 2005
  5. H. Simpson
    Replies:
    4
    Views:
    343
    H. Simpson
    Aug 3, 2004
Loading...

Share This Page