|
-
May 5th, 1999, 02:28 AM
#1
[RESOLVED] HGLOBAL
I have the following:
char *mybuf;
unsigned short numbytes;
numbytes=adBmpSizeFromFile(filename);
if (numbytes) {
mybuf=malloc(numbytes);
adExtractBmpFileToBuffer(filename ,mybuf,&numbytes);
}
How can I convert this buffer into a HGLOBAL?
I need to to this because the existing code requires a HGLOBAL to be passed and not a char *.
Thanks for your help.
-
May 12th, 1999, 06:07 PM
#2
Re: HGLOBAL
Hello,
normally you would reserve blocks of memory in Win32 like this:
HGLOBAL hGlob = GlobalAlloc( GMEM, dwSizeOfMemoryBlock )
if ( hGlob != NULL )
{
char* pMyBuffer = GlobalLock ( hGlob );
// when buffer is no longer needed, call:
GlobalFree ( hGlob );
}
Uli
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|