|
-
Sep 23rd, 2002, 09:10 AM
#10
Frenzied Member
One way is to use assert() - it is either implemented as a macro or a function.
Parksie is right - if the buffer is heap memory, only in Windows the long BEFORE the starting address of the buffer is the size of the buffer. Like BSTR. It's how free() knows how much memory is allocated.
But this is NOT true if the buffer came from OLE or from VB, even if if it allocated memory dynamically like in ReDim. OLE & VB use descriptors in a descriptor table. OLE does use BSTR for string buffers. SO - just check for NULL, maybe in an assert. You cannot depend on anything else.
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
|