GIDForums

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 04-Mar-2008, 00:42
bix2702 bix2702 is offline
New Member
 
Join Date: Feb 2008
Posts: 2
bix2702 is on a distinguished road
Exclamation

Open a FLTK window in a DLL


Hello,

I wrote a application which loads a (also self-programmed) dynamic library (.dll) and import a function which creates a FLTK window (from the DLL). But the problem is that the window is not attached to the application main window and not redrawed proberly. The content of the window (button etc.) are also not shown.
Does anyone has an idea? Is it a bug?
  #2  
Old 04-Mar-2008, 04:29
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,102
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough

Re: Open a FLTK window in a DLL


Hello and Welcome to GIDForums™ FLTK Forum bix2702.

We will need a little more information to possibly help. What version of FLTK are you using. Some posted code on how you are creating your window etc.

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #3  
Old 04-Mar-2008, 04:58
bix2702 bix2702 is offline
New Member
 
Join Date: Feb 2008
Posts: 2
bix2702 is on a distinguished road
Wink

Re: Open a FLTK window in a DLL


Thanks for quick anser
My fltk version is v1.1.7

Ok, here comes example code for dll.cpp:
CPP / C++ / C Code:
Fl_Double_Window *wnd_config = 0;

// DLL entry
BOOL APIENTRY DllMain(HANDLE hmodule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
	switch(ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
				break;
	}
	return TRUE;
}

Fl_Double_Window *showGUI()
{
	wnd_config = make_window();
	return wnd_config;
}

Here is the DLL header dll.h:
CPP / C++ / C Code:
//... some includes...

#define DLLExport extern "C" __declspec(dllexport)
DLLExport Fl_Double_Window *showGUI();

Here is the code in main application, a click on a button should open the DLL window:
CPP / C++ / C Code:
void btn_system_cb(class Fl_Button *,void *)
{
	Fl_Double_Window *wnd;

        // showGUI() is the imported DLL function from dll.dll
        // the DLL (dll.dll) is loaded dynamically with LoadLibrary and GetProcAddress etc.
	wnd = showGUI();
        wnd->show();
}

Hope this is enough. write if you need more info. but i think now its clear what I want to do: I want to load a dll dynamically into an application. the dll has a function which built a window wich should be shown in main application.
(The window in dll was made with fluid).
 

Recent GIDBlogMaster?s Degree by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FLTK && fluid In Motion cable_guy_67 FLTK Forum 4 20-Mar-2008 03:52
Transparent FLTK Window yilmaz FLTK Forum 6 23-May-2007 08:01
need help with a console menu system BullBuchanan CPP / C++ Forum 6 20-Aug-2006 14:46
[Tutorial] GUI programming with FLTK dsmith FLTK Forum 10 03-Oct-2005 15:41
log window in fltk podarok FLTK Forum 5 11-May-2005 02:23

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 12:45.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.