codice:
void InitCb(HWND hwnd, char from, int mItem, int IDCtrl, char *StrFind)
{
	  StaSql=(char*)GlobalAlloc(GPTR,strlen("call DBA.sp_CbRicerca( ? )")+1);
	  StaSql="call DBA.sp_CbRicerca( ? )";
}
Ovvio che il compilatore si lamenti. Prima allochi un puntatore con una GlobalAlloc, poi assegni una const string allo stesso puntatore, perdendo quanto allocato prima, infine cerchi di distruggere il puntatore alla const string con una GlobalFree.
Devi usare una strcpy ( o meglio la strncpy) per copiare la stringa.
codice:
void InitCb(HWND hwnd, char from, int mItem, int IDCtrl, char *StrFind)
{
	  StaSql=(char*)GlobalAlloc(GPTR,strlen("call DBA.sp_CbRicerca( ? )")+1);
	  strcpy(StaSql,"call DBA.sp_CbRicerca( ? )");
         // o
         // strncpy(StaSql,"call DBA.sp_CbRicerca( ? )",strlen("call DBA.sp_CbRicerca( ? )");
}