Bonjour,

La fonction suivante me pose problème.
Comme vous pouvez le voir, j'ai plusieurs pointeur (wchar_t* et new wchar_t), mais, je n'arrive pas à les détruire.... le delete ne va pas.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
	private: System::Void bt_sbHelloParam_Click(System::Object^  sender, System::EventArgs^  e) {
 
				typedef  wchar_t* (__stdcall *fct_sbHelloParam)(wchar_t* Input, wchar_t* Output);
				fct_sbHelloParam fsbHelloParam;
 
				fsbHelloParam = (fct_sbHelloParam)GetProcAddress(hInstLibrary, "_sbHelloParam");
				if (fsbHelloParam){
					IntPtr p =  System::Runtime::InteropServices::Marshal::StringToHGlobalUni(tbParam->Text->ToString());
					wchar_t* Input = static_cast<wchar_t*>(static_cast<void *>(p));
					wchar_t* Output = new wchar_t;
					fsbHelloParam(Input, Output);		
					this->tbLog->Text += "res="+gcnew String(Output)+ "\r\n";
					delete Output;
				}else{
					this->tbLog->Text += "GetProcAddress for _sbHelloParam failed !" + "\r\n";
				}
 
		 }
pouvez-vous m'aider ?