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 #43567 is a reply to message #43566] Mon, 01 September 2014 14:44 Go to previous messageGo to previous message
andreincx is currently offline  andreincx
Messages: 15
Registered: March 2014
Promising Member
Hi aftershock,

Could you please post also the content of 'ultimatewindll.h'?

#ifndef _UppDll_UppDll_h
#define _UppDll_UppDll_h

#define DllImport extern "C" __declspec(dllimport)
#define DllExport extern "C" __declspec(dllexport)

#ifdef flagDLL
	#define DLLIMPORT __declspec(dllexport)
#else
	#define DLLIMPORT __declspec(dllimport)
#endif

DLLIMPORT void PromptOK2(char* str);

#endif


#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
 
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 03:20:55 CEST 2024

Total time taken to generate the page: 0.02602 seconds