#include <CtrlLib/CtrlLib.h>
#include <windows.h>
#include "UppDll.h"
using namespace Upp;
BOOL APIENTRY DllMain(HANDLE hModule, DWORD reason, LPVOID lpReserved)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
Ctrl::InitWin32(AppGetHandle());
AppInitEnvironment__();
break;
case DLL_PROCESS_DETACH:
Ctrl::ExitWin32();
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
DLLIMPORT void PromptOK2(char* str)
{
PromptOK(str);
}
This should work. See Ctrl::InitWin32(AppGetHandle()); and AppInitEnvironment__(); in DLL_PROCESS_ATTACH and Ctrl::ExitWin32() in DLL_PROCESS_DETACH. If you don't have to put anything else in DllMain you may use DLL_APP_MAIN to hide U++ initialization and cleanup.
When you use it don't forget to add path to directory where *.lib file of dll is.
#include <CtrlLib/CtrlLib.h>
#include <windows.h>
#include "UppDll.h"
using namespace Upp;
BOOL APIENTRY DllMain(HANDLE hModule, DWORD reason, LPVOID lpReserved)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
Ctrl::InitWin32(AppGetHandle());
AppInitEnvironment__();
break;
case DLL_PROCESS_DETACH:
Ctrl::ExitWin32();
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
DLLIMPORT void PromptOK2(char* str)
{
PromptOK(str);
}
This should work. See Ctrl::InitWin32(AppGetHandle()); and AppInitEnvironment__(); in DLL_PROCESS_ATTACH and Ctrl::ExitWin32() in DLL_PROCESS_DETACH. If you don't have to put anything else in DllMain you may use DLL_APP_MAIN to hide U++ initialization and cleanup.
When you use it don't forget to add path to directory where *.lib file of dll is.
Regards,
Andrei[/quote]
You seem to find other problems with the code.. That is good, thanks
However, one problem seems to be
unresolved external symbol "void __cdecl Upp::PromptOK(char const *)" (?PromptOK@Upp@@YAXPBD@Z) referenced in function _P
romptOK2
meaning some libraries and I mean part of standard upp library is not added to the linker as far I can see it.
That is why I thought it could be a bug or i did not use a compilation flag...
What do you think why?