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 » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » Dynamic library load works rare in Linux
Dynamic library load works rare in Linux [message #6217] Thu, 02 November 2006 19:41 Go to next message
nicomesas is currently offline  nicomesas
Messages: 104
Registered: September 2006
Location: Barcelona, Spain
Experienced Member
Hello.

In my U++ program I am trying to dynamically load a library (also written in U++) and the system behaves quite rare.

I want to do thus this, to implement a series of plug-in my application bigmailer.

The problem is quite rare, and my English does not allow me to explain to me very well, so if somebody can test the example that attached in this message will be making me a great favor to my and to the U++ community.

A possible solution could be to initiate X11 in an equivalent one to function "DLLENTRY" of Windows, but not if this exists in linux... Crying or Very Sad

I wait for the news your.
  • Attachment: testDLL.zip
    (Size: 1.81KB, Downloaded 2094 times)
Re: Dynamic library load works rare in Linux [message #6223 is a reply to message #6217] Thu, 02 November 2006 22:32 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Hi Nico,

I have downloaded and checked your code.

I don't know wether you should set up X11 again. But i don't have an idea how to solve the Problem.

It looks like this to me:
I Start the App, click on the Button (which loads the dll-Function, see below) - then The PrompOK comes up, i click ok and it seems like the PromptOK-Window has gone but it only moved behind the TopWindow of the App, if you move it aside you can see the PromptOK-Window again, but it isn't redrawn anymore. The PromptOK-Window is only closed when the App is closed, pressing the 'x' of the Title does nothing.

So with each click on the Button in the App (which loads the .so (dll) ) you get a zombie-Window after you click "ok".

code of the .so (dll)
#include <CtrlLib/CtrlLib.h>

extern "C" void test() {
   Ctrl::InitX11(NULL);
   PromptOK("Hello World");
   Ctrl::CloseTopCtrls();
   Ctrl::ExitX11();
}


Bas

[Updated on: Thu, 02 November 2006 22:32]

Report message to a moderator

Re: Dynamic library load works rare in Linux [message #6241 is a reply to message #6223] Fri, 03 November 2006 14:28 Go to previous messageGo to next message
nicomesas is currently offline  nicomesas
Messages: 104
Registered: September 2006
Location: Barcelona, Spain
Experienced Member
Hi Bas!
Your description of the behavior is exactly as it happens to me.

fallingdutch wrote on Thu, 02 November 2006 22:32


I Start the App, click on the Button (which loads the dll-Function, see below) - then The PrompOK comes up, i click ok and it seems like the PromptOK-Window has gone but it only moved behind the TopWindow of the App, if you move it aside you can see the PromptOK-Window again, but it isn't redrawn anymore. The PromptOK-Window is only closed when the App is closed, pressing the 'x' of the Title does nothing.

So with each click on the Button in the App (which loads the .so (dll) ) you get a zombie-Window after you click "ok".


The start of X11 is necessary, so that the program works at least. You can comment it and you will see the result: program crashes. Then you will debug PromptOK function and you will see the error. Shocked the X11 is not started!


I have made a pair of tests on this and have obtained similar results if I take with the function system a executable (not dll) GUI U++ with a non-complicated dialog. In this case, if I move the resulting window, the main window redraws badly Sad

I upload the code of executable, and you can launch it with this code, from the main window.
void onLaunchSystem()
{
  // use your out path ;)
  system( "/media/GIGANTE/DSRLLO/upp/out/GCC32.Debug_full.Gui.Shared/testDLL_EXE" ) ;
}


I don't understand in deep how U++ uses X11.
Re: Dynamic library load works rare in Linux [message #6242 is a reply to message #6241] Fri, 03 November 2006 15:39 Go to previous messageGo to next message
nicomesas is currently offline  nicomesas
Messages: 104
Registered: September 2006
Location: Barcelona, Spain
Experienced Member
I have tested another, and this it comes out to me well. I take the feasible one with execl, of this form:
void onLaunchExe()
{
  String exe = "/media/GIGANTE/DSRLLO/upp/out/GCC32.Debug_full.Gui.Shared/testDLL_EXE" ;
  int status ;
  pid_t pid = fork() ;
  if (pid > 0)
  {
    execl( exe, exe, " This is all, folks!!!", NULL ) ;
    // I hope to wait to secondary program finish ...
  }
}


In this case the both windows works fine, but this was not what I wanted to obtain.

Perhaps now we have more data to find out what happens with this problem.
Re: Dynamic library load works rare in Linux [message #6243 is a reply to message #6241] Fri, 03 November 2006 15:41 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
nicomesas wrote on Fri, 03 November 2006 14:28

The start of X11 is necessary, so that the program works at least. You can comment it and you will see the result: program crashes. Then you will debug PromptOK function and you will see the error. Shocked the X11 is not started!

I tested that, too and my Prog crashed, too.

nicomesas wrote on Fri, 03 November 2006 14:28

I don't understand in deep how U++ uses X11.

Neither do I Sad

Will check your code this afternoon or tomorrow morning,

Bas
Re: Dynamic library load works rare in Linux [message #6246 is a reply to message #6243] Sat, 04 November 2006 09:43 Go to previous message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Well sure it works ... but exec just starts another programm - the same as hitting Ctrl+F5 in TheIDE ... not loading additional functions to your main app Sad

Bas
Previous Topic: function TopWindow::Maximize does not work in linux.
Next Topic: freebsd fluxbox theide
Goto Forum:
  


Current Time: Thu Mar 28 17:40:11 CET 2024

Total time taken to generate the page: 0.01427 seconds