Re: LoadLibrary returns 0
Quote:
Originally Posted by
funkmonkey
Hi, I'm trying to generate a DLL that is just a simple timer like routine for activating when a System DLG box pops up.
Tripped across your other post in C++ & Win API, where the code looks more complete. Have to admit, I cannot see a timer thing in there. Instead, I can see you have absolutely no idea what your EPIQ_ExecuteTimer() really does. You'd better stop fumbling with DLL and pay some attention to your main logic of timed execution, for whatever reason you're up to..
Re: LoadLibrary returns 0
Re: LoadLibrary returns 0
Quote:
Originally Posted by
Igor Vartanov
Code:
#ifdef EPIQUTIL_EXPORTS
#define EPIQUTIL_API __declspec(dllexport)
#else
#define EPIQUTIL_API __declspec(dllimport)
#endif
My best guess is EPIQUTIL_EXPORTS is not defined when the DLL gets built, thus no exporting occurs.
Thanks. What would the define look like? Using _stdcall? as the definition? In all the examples I have looked at this is how the code has been and I have not seen a defenition for the maco. Unless it's in another file or they just did not post it with the question/answer.
Re: LoadLibrary returns 0
Actually I do know. ExecuteTimer is the equivilent of set timer, but very crude. It is a circular call that is simple and calls the EPIQ_TimerProc every second from the Sleep Delay. I figured this was easier than generating a thread with a timer. It's a really simple/stupid form of a timer. It may be crude but it does work and the only reason I need it is to press a system dialog button when obj.click function is called as this function freezes until the system dialog box is dismissed then it picks back up and continues to the next routing.
Re: LoadLibrary returns 0
Quote:
Originally Posted by
Igor Vartanov
Tripped across your
other post in C++ & Win API, where the code looks more complete. Have to admit, I cannot see a timer thing in there. Instead, I can see you have absolutely no idea what your EPIQ_ExecuteTimer() really does. You'd better stop fumbling with DLL and pay some attention to your main logic of timed execution, for whatever reason you're up to..
DIdn't reply with quotes so here is what I said from below.
Actually I do know. ExecuteTimer is the equivilent of set timer, but very crude. It is a circular call that is simple and calls the EPIQ_TimerProc every second from the Sleep Delay. I figured this was easier than generating a thread with a timer. It's a really simple/stupid form of a timer. It may be crude but it does work and the only reason I need it is to press a system dialog button when obj.click function is called as this function freezes until the system dialog box is dismissed then it picks back up and continues to the next routing.
But hey, let's insult the person because you can't figure it out with a circular operation.
Re: LoadLibrary returns 0
Quote:
Originally Posted by
Igor Vartanov
Code:
#ifdef EPIQUTIL_EXPORTS
#define EPIQUTIL_API __declspec(dllexport)
#else
#define EPIQUTIL_API __declspec(dllimport)
#endif
My best guess is EPIQUTIL_EXPORTS is not defined when the DLL gets built, thus no exporting occurs.
Thanks. Your are probably correct as I don't define that until it is defined in the ifdef statement. Should I be using __Stdcall or __cdecl with the macro?
The LoadLibrary issue is somewhat resolved and now working on a similar issue with getprocaddress. The one issue I had is that the DLL will only be loaded in the debug directory, which is fine for now but will need to resolve this later after the code is more functional. Can't place the DLL in the system directory as this is for a company team project for processing records using VBA but with the C developed DLL for pressing a system dialog button in order to move the program on as the program freezes until the dismissal of the system dialog box occurs.
Moderators...... I guess you can close this post as I am no longer fighting a LoadLibrary issue but a GetProcAddress issue which is a different topic and I do have another thread for this. Thanks.
Re: LoadLibrary returns 0
Quote:
Originally Posted by
funkmonkey
Thanks. What would the define look like? Using _stdcall? as the definition? In all the examples I have looked at this is how the code has been and I have not seen a defenition for the maco. Unless it's in another file or they just did not post it with the question/answer.
In the C++ code that generates the .dll (exports) you have at the top:
Code:
#define EPIQUTIL_EXPORTS
In the code that uses the .dll (imports) you don't have this definition.
Re: LoadLibrary returns 0
Quote:
Originally Posted by
Igor Vartanov
Code:
#ifdef EPIQUTIL_EXPORTS
#define EPIQUTIL_API __declspec(dllexport)
#else
#define EPIQUTIL_API __declspec(dllimport)
#endif
My best guess is EPIQUTIL_EXPORTS is not defined when the DLL gets built, thus no exporting occurs.
For the LoadLibrary issue it was that I moved the DLL to another directory, but even with the path defined LoadLibrary would not load the DLL. For now LoadLibrary is not an issue and I will figure out this problem later, as I just leave the DLL where it was compiled and LoadLibrary works. Scratching my head over that one though since the DLL can't seem to be placed elsewhere. Moving on to my other issue now GetProcAddress, with the same results but the DLL seems to not be applying __declspec(dllexport) macro for the compilation.
Re: LoadLibrary returns 0
Moderators, you may close this post as the LoadLibrary issue is sort of resolved. Will visit the issue at a later date as in the DLL debug location the DLL works, but not in another location. Will resolve, attempt, at a later date.