premesso che uso Dev-C++ 4.9.9.2 Mingw32 3.4.2 ...
per me si, sono arrivato a questa conclusione dopo che ho decommentato delete ed utilizzato una semplice variabile int, non si presenta.
C'è da dire che la funzione è chiamata entro la MDI Child procedure in WM_CREATE, forse in questo contesto si hanno comportamenti diversi o che non conosco.
La funzione è questa:
Però, anche in altre circostanze, vedi:codice:void SetTitleWindow(HWND hwnd, int typeMdiAct, int mItem) { wstring tmpTitle; int *okSubTitle=new int(0); switch(typeMdiAct) { case 0: tmpTitle=L"Ricerca "; break; case 1: tmpTitle=L"Elenco "; break; case 2: tmpTitle=L"Nuovo "; break; case 3: tmpTitle=L"Modifica "; break; case 4: tmpTitle=L"Scheda "; break; } tmpTitle.append(Imenu[mItem]); switch(typeMdiAct) { case 1: if(mItem==21 || mItem==22 || mItem==23 || mItem==24 || mItem==25 || mItem==27 || mItem==28 || mItem==29) *okSubTitle=1; break; ... ... } if(*okSubTitle==1) tmpTitle.append(subTitle); SetWindowText(hwnd,tmpTitle.c_str()); delete okSubTitle; //qui il problmema return; } Management.exe caused an Access Violation at location 772261af in module ntdll.dll Reading from location 00000009. Registers: eax=00a412f8 ebx=00a40000 ecx=00a412f8 edx=00000005 esi=00a412f0 edi=00000000 eip=772261af esp=0022f28c ebp=0022f364 iopl=0 nv up ei pl zr na po nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246 Call stack: 772261AF ntdll.dll:772261AF RtlAnsiStringToUnicodeString 7722214C ntdll.dll:7722214C RtlTryEnterCriticalSection 76FCA171 msvcrt.dll:76FCA171 malloc 00408678 Management.exe:00408678 00404B9E Management.exe:00404B9E 004025DA Management.exe:004025DA 769D1A10 USER32.dll:769D1A10 GetMessageW 769D3123 USER32.dll:769D3123 GetWindow 769D1C03 USER32.dll:769D1C03 GetMessageW 769C8562 USER32.dll:769C8562 GetThreadDesktop 77220E6E ntdll.dll:77220E6E KiUserCallbackDispatcher 769C848B USER32.dll:769C848B GetThreadDesktop 769C862B USER32.dll:769C862B CreateWindowExW ... ...
http://forum.html.it/forum/showthrea...9#post11761709
si presenta lo stesso problema
e qui usavo Code::block 8.02 Mingw 3.4.5 aggiornato con bugfix vista
quindi di cosa si tratta ... ???

Rispondi quotando