U++ Forum - RDF feed
https://www.ultimatepp.org/forums/
How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38629&th=7205#msg_38629
Can you give me an example?
Thanks]]>lectus2012-12-31T01:50:07-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38631&th=7205#msg_38631
1. In Main package configuration, choose DLL or Dynamic Library.
2. Put this before the function declaration and definition of all the functions that you want to export (call from other program):
extern "C" __declspec(dllexport)
3. Call it ]]>koldo2012-12-31T07:38:44-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38640&th=7205#msg_38640
It worked. I was even able to call U++ functionality from Python using this method.]]>lectus2012-12-31T18:16:32-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38686&th=7205#msg_38686
Quote:
3. Call it
How to do it?
Javier]]>2812642013-01-06T15:24:02-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38690&th=7205#msg_38690
281264 wrote on Sun, 06 January 2013 16:24
Quote:
3. Call it
How to do it?
Javier
Hello Javier
If you want to call a function inside a DLL you can do it from another project, a normal .exe.
For that you can do it in different ways. The U++ way is using DLI files. If you want to have low level control you can use the Bazaar/Functions4U way.
]]>koldo2013-01-07T07:50:33-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38694&th=7205#msg_38694
koldo wrote on Mon, 07 January 2013 02:50
281264 wrote on Sun, 06 January 2013 16:24
Quote:
3. Call it
How to do it?
Javier
Hello Javier
If you want to call a function inside a DLL you can do it from another project, a normal .exe.
For that you can do it in different ways. The U++ way is using DLI files. If you want to have low level control you can use the Bazaar/Functions4U way.
Of course it's a non-portable way. Only works in Windows.
It's better to use U++ DLI interface.
]]>lectus2013-01-07T15:24:58-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38787&th=7205#msg_38787
I tried calling a function inside a DLL using the DLI method and I got the error "Heap Leak Detected".
But when I manually call this function using LoadLibrary/GetProcAddress/FreeLibrary I don't get this error.
Maybe DLI is forgetting to call FreeLibrary?]]>lectus2013-01-17T19:51:53-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38790&th=7205#msg_38790
Could you include a super simple project showing this problem?]]>koldo2013-01-18T07:42:05-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38791&th=7205#msg_38791
koldo wrote on Fri, 18 January 2013 02:42
Hello Lectus
Could you include a super simple project showing this problem?
Build the 3 packages, put test.exe, testwinapi.exe and testdll.dll on the same folder and run them.]]>lectus2013-01-18T13:24:53-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=38793&th=7205#msg_38793
In line 26 I would remove FreeLibrary(hdll) because hdll is NULL.
I am not a DLI expert and I have not found the reason of the problem.
The leak appears only if the function inside the DLL calls the GUI and it is in the PromptOK() call.
Could some DLI expert help us?
]]>koldo2013-01-18T19:06:29-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=39123&th=7205#msg_39123
Many thanks,
Javier]]>2812642013-02-16T20:54:08-00:00Re: How to create a U++ based DLL?
https://www.ultimatepp.org/forums/index.php?t=rview&goto=39135&th=7205#msg_39135
Excellent. It is just a super simple class handling LoadLibrary/GetProcAddress/FreeLibrary in Windows and the equivalent in Linux. So if you do not need the rest of Functions4U you can just take it.
If you see any improvement please send it ]]>koldo2013-02-18T07:48:31-00:00