ich kann nicht mehr
die Funktion sieht jetzt so aus:
CString lala::CString2LPSTR(CString sdsn,CString server,CString sdatabase)
{
CString str;
int buffer = sdsn.GetLength()+server.GetLength()+sdatabase.GetLength()+24;
LPSTR pSAttributes = str.GetBuffer(buffer);
memset(pSAttributes, 0, buffer);
memcpy(pSAttributes, sdsn, sdsn.GetLength());
pSAttributes += sdsn.GetLength() + 1;
memcpy(pSAttributes, server, server.GetLength());
pSAttributes += server.GetLength() + 1;
memcpy(pSAttributes, sdatabase, sdatabase.GetLength());
pSAttributes += sdatabase.GetLength() + 1;
memcpy(pSAttributes,"Trusted_Connection=1.",buffer);
str.ReleaseBuffer(buffer);
return str;
}
[/PHP]
jetzt wenn ich sie nur so aufrufe :
[code]
try
{
CString str;
str=CString2LPSTR("DSN=myDSN","SERVER=mySer","DATABASE=myDB");
}catch( CException * e )
{
TCHAR szCause[255];
CString strFormatted;
e->GetErrorMessage(szCause, 255);
}
[/code]
krieg beim catch( CException * e ) Fehler:
[b]
Benutzerdefinierter Haltepunkt aus Quellcode aufgerufen bei 0x778813b1
[/b]
Warum ??