Converting LPSTR to BYTE *?
-
I have a WAVEHDR structure set up and I want to store the data from the lpData element which is of type LPSTR to BYTE * for allocating a memory block using GlobalAlloc and to pass back the pointer of this new memory block. Does anyone know how I can convert LPSTR to BYTE* to do this or can someone show me how to dump the data from the lpData element of a WAVEHDR structure to a BYTE-based memory buffer? Thanks. Bill Dennis Orlando, FL
-
I have a WAVEHDR structure set up and I want to store the data from the lpData element which is of type LPSTR to BYTE * for allocating a memory block using GlobalAlloc and to pass back the pointer of this new memory block. Does anyone know how I can convert LPSTR to BYTE* to do this or can someone show me how to dump the data from the lpData element of a WAVEHDR structure to a BYTE-based memory buffer? Thanks. Bill Dennis Orlando, FL
int len = strlen(lpStr); HGLOBAL hMem = GlobalAlloc(0, len); memcpy((BYTE*)hMem, lpStr, len); Cleek | Image Toolkits | Thumbnail maker
-
int len = strlen(lpStr); HGLOBAL hMem = GlobalAlloc(0, len); memcpy((BYTE*)hMem, lpStr, len); Cleek | Image Toolkits | Thumbnail maker
I need to ask.. why GlobalAlloc()? Been using it alot lately? :) -- Keep talking! You're the fool, I'm the preacher.
-
I need to ask.. why GlobalAlloc()? Been using it alot lately? :) -- Keep talking! You're the fool, I'm the preacher.
i use it all the time because you can't use malloc or new to share mem between C++ and VB, for example. but, the original poster mentioned GlobalAlloc, here. Cleek | Image Toolkits | Thumbnail maker
-
i use it all the time because you can't use malloc or new to share mem between C++ and VB, for example. but, the original poster mentioned GlobalAlloc, here. Cleek | Image Toolkits | Thumbnail maker
Chris Losinger wrote: but, the original poster mentioned GlobalAlloc, here. :doh: -- Keep talking! You're the fool, I'm the preacher.