-
April 17th, 2013, 02:23 PM
#19
Re: LoadLibrary giving system err 183 while loading Crypto dll
How did you create the crypto.dll? cryptopp version 5.6.1.0 is available from Wei Dai's home page as a set of source files to be compiled to produce a .dll. Using their standard build produces cryptopp.dll and cryptopp.lib files. If you have (or can make) the .lib file why are you bothering using LoadLibrary etc when you could just link with the .lib file and include the .h file with your program? This would be my preferred way of doing it when these files are available.
However, as the source of the dll is available then if you build a debug version then you can use the debugger to debug into the dll when dllmain(..) is called to find the problem.
Code:
int code = (decryptAddress)((char *) pswd, (char *) out, (char*)key);
This is not the usual way that a C++ (or C) programmer calls a function. Why are there parentheses around the name of the function?
Because decryptAddress is variable containing a pointer to a function and not a function name. It could have been written
Code:
int code = (*decryptAddress)((char *) pswd, (char *) out, (char*)key);
but the '*' is now optional.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|