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 » Community » Coffee corner » Load dll with U++
Re: Load dll with U++ [message #56704 is a reply to message #56703] Sun, 04 April 2021 06:20 Go to previous messageGo to previous message
BetoValle is currently offline  BetoValle
Messages: 204
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Hi Novo, Thanks

In example below with traditional way also works but ... why application freeze when set FreeLibrary ?

this will not cause a problem or in the end does the code generated in U ++ free from memory?


...
typedef void (*importFunction)(int, int, int, int, char *); 
...
void AA::clickDll2(){
	importFunction fscreen;

	HINSTANCE hinstLib = LoadLibrary(AppendFileName("C:\\Temp\\outU++\\NOVOXXX\\CLANGx64.Debug.Debug_Full.Gui", "CaptureScreenDll.dll"));
 	if (hinstLib == NULL) {
 		PromptOK("ERRO: não foi possível carregar a DLL\n");
 		return;
 	}	
 	fscreen = (importFunction)GetProcAddress(hinstLib, "capture_screen");
 	if (fscreen == NULL) {
 		PromptOK("ERRO: não foi possível achar a função na DLL\n");
                //FreeLibrary(hinstLib);  uncommenting will abort here
 		return;
 	} 	

 	char* f="teste2.png";
    fscreen(0,0,500,600,f);
    
    //FreeLibrary(hinstLib); uncommenting will abort here
	
}


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Hello Upp World
Next Topic: Compiler Options Hardening Guide for C and C++
Goto Forum:
  


Current Time: Tue Aug 12 22:02:49 CEST 2025

Total time taken to generate the page: 0.06682 seconds