I need help with malloc()
inside another function.
I\'m passing a pointer and size to the fu
The only way I could get pointer to a pointer solution to work for a similar problem I was having for this function
BOOL OpenBitmap2 ( LPCTSTR pszFileName, char** pszBMPFile)
Was by assigning a temporary pointer to store the address
char* BMPFile;
{ BMPFile = (char*)GlobalAlloc(GPTR, dwFileSize + 1); // allocate storage using GlobalAlloc + 1 for null term string
then reassigning it
{* pszBMPFile = BMPFile; return (0);} // Error = False
Any comment on why using "* pszBMPFile" directly with GlobalAlloc didn't work would be appreciated. I answered my own question. I forgot to carry the "*" through with pszBMPFile in the other lines of code. Good lessons from all the contributors. Many thanks.