The below code causes my VB code to crash with the ' The memory could not be "read" ' error.
![]()
BSTR WINAPI FormatID(HWND hWnd, LPCSTR sLine)
{
char *tmp = new char[strlen(sLine)];
int n;
n = <to be calculated>;
strcpy(tmp, sLine);
return BSTR(tmp[n]);
}
What I am trying to do is get the n'th character from sLine.
Any ideas, thanks in advanced.
![]()




Reply With Quote