Thread: LoadLibrary returns error code 998 - Access violation

  1. #1
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607

    LoadLibrary returns error code 998 - Access violation

    A call to LoadLibrary() in my game project is now suddenly causing an Access Violation to occur. This is very strange b/c no code in the DLL is being ran since the DLL has not loaded correctly. Also I am not using a DLLMain so I am not sure what is going on.

    I enabled first chance exceptions for C000005: Access Violation and the stack trace lands me knee deep in assembly code.


    Any ideas what is causing this? Note that the DLL has worked before. I verified the DLL exists and that it is compiled using the same type of runtime as all others in the project.

    EDIT:
    N/m I found it. It finally broke where it was dying. I was performing a less than safe strcat on a global path variable in the main game DLL. It broke inside of the strcat assembly code.
    Last edited by VirtualAce; 04-10-2012 at 07:00 PM.

  2. #2
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    For the sake of clarity, you are saying that `LoadLibrary' ultimately failed because the parameter passed to it was invalid due to an earlier misuse?

    Soma

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Access violation error?
    By rousse09 in forum C++ Programming
    Replies: 2
    Last Post: 12-21-2011, 09:42 AM
  2. Access violation error
    By kulfon in forum C++ Programming
    Replies: 2
    Last Post: 12-14-2011, 05:31 PM
  3. Prolog code causing Access Violation error in VS2008
    By HJoshy in forum General AI Programming
    Replies: 13
    Last Post: 04-21-2010, 01:27 PM
  4. Access Violation Error
    By Neurofiend in forum C Programming
    Replies: 3
    Last Post: 08-22-2005, 06:19 PM
  5. Access Violation Error
    By Scott in forum C++ Programming
    Replies: 6
    Last Post: 07-24-2003, 05:00 AM