Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » gui in dll does not compile
Re: gui in dll does not compile [message #43569 is a reply to message #43567] Mon, 01 September 2014 15:42 Go to previous messageGo to previous message
aftershock is currently offline  aftershock
Messages: 143
Registered: May 2008
Experienced Member

#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?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: mixed RichEdit widget with MFC Dialog.
Next Topic: ColumnList multi select mode: weird behavior
Goto Forum:
  


Current Time: Wed May 15 19:44:49 CEST 2024

Total time taken to generate the page: 0.01503 seconds