Results 1 to 6 of 6

Thread: If you've got some time...could you have a look?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    UK
    Posts
    222

    Angry If you've got some time...could you have a look?

    I've put together a program that was working at one point, but
    now gives me a fatal exception...and not being the greatest programmer of win32 yet I don't know what kind of thing I am
    looking for that would cause or solve this problem!!


    I have atached my source files which run from
    d:\development\key32

    if you use another path you have to change the settings as it copies a dll to the release directory of the main program!

    The program should istall windows hooks, but as i said i get a fatal exception and have no idea how to solve it!!

    Could anybody maybe have a look and tell me where i have gone wrong?!

    Cheers in advance

    Andy
    Attached Files Attached Files

  2. #2
    amac
    Guest
    I haven't used LoadLibrary() very much... and I am sure someone else here could give you a better answer than I... but...

    Your call to ProcPaintHooksDll() in WM_PAINT is where its crashing... I dont know if you knew that or not but... I moved the call to FreeLibrary() to the end of WinMain()... and it didnt crash when it tried to call it... there seems to be another error having to do with calling conventions...

  3. #3
    amac
    Guest
    Alright I found the other problem...

    change
    Code:
    typedef VOID (*PROCPTR1)(LPTSTR);
    typedef int (*PROCPTR2)(HWND, int);
    typedef int (*PROCPTR3)(HDC);
    typedef int (*PROCPTR4)(int, int);
    to
    Code:
    typedef VOID (WINAPI *PROCPTR1)(LPTSTR);
    typedef int (WINAPI *PROCPTR2)(HWND, int);
    typedef int (WINAPI *PROCPTR3)(HDC);
    typedef int (WINAPI *PROCPTR4)(int, int);

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    more

    I don't think you are allowed to free a library if you want to use it's functions. Don't forget, freeing a library means that it's functions are no longer available to the program! You would most likely get an access violation with the first call to a library function. Also I would use linking on load time (includeing the import library, declaring function prototypes) since it makes live far easier for you and you don't have to mess with function pointers. This isthe better choice since you use the library functions throughout the program.

    My browser goes crazy!!!!!!!!!
    AAAAAAAHHHHHHHHHHHHHHHH!!!!!!!!!!
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    UK
    Posts
    222

    Dlls

    Thank you very much for the advice..


    I'm pretty new to this c++ win32 lark, so far i have only done console applications and that kind of thing.

    How easy is it to do what you said? about using the lib and stuff like that? and do you have any examples? that could give me a helping hand?!

    cheers again

    Andy

  6. #6
    amac
    Guest
    Try this out...
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width