Dear Sirs,
I'm attempting to access a "Windows global memory buffer" created by a third-party library for managing data being transfered from quickly sampling analog-to-digital I/O cards. The documentation for this library supports C/C++, Visual Basic, and Delphi. The third-party library is called the "Universal Library" from Measurement Computing for supporting their I/O cards, and is presently (at this writing) a free download.
According to the documentation, we initiate the global Windows memory buffer with a function call, which returns a handle to the buffer. Then we pass the handle to other functions which manage the transfer of data from the I/O cards to the Windows global memory buffer. To access the buffer, if we are using Visual Basic we use another function to copy the contents of the buffer to an array, or if we are using C++ we can cast the handle of the buffer a pointer of the appropriate type (such as unsigned short, which is a Word in PowerBasic) with statements as follows:
unsigned short *DataArray=Null
DataArray = (unsigned short*)MemBuffer
My question is whether I can somehow directly access the Windows Buffer in PowerBasic. For example, can I perform a similar pointer cast as done in C++, or maybe overlay a PowerBasic Array over the Windows global memory buffer. What do I do with that handle? :thinking:
I've been working on converting the header file for the Universal Library to support PowerBasic 8.04 syntax macros and function definitions, and have had some success using the library for functions which do not involve arrays or buffers.
Sincerely,
John Harvill
I'm attempting to access a "Windows global memory buffer" created by a third-party library for managing data being transfered from quickly sampling analog-to-digital I/O cards. The documentation for this library supports C/C++, Visual Basic, and Delphi. The third-party library is called the "Universal Library" from Measurement Computing for supporting their I/O cards, and is presently (at this writing) a free download.
According to the documentation, we initiate the global Windows memory buffer with a function call, which returns a handle to the buffer. Then we pass the handle to other functions which manage the transfer of data from the I/O cards to the Windows global memory buffer. To access the buffer, if we are using Visual Basic we use another function to copy the contents of the buffer to an array, or if we are using C++ we can cast the handle of the buffer a pointer of the appropriate type (such as unsigned short, which is a Word in PowerBasic) with statements as follows:
unsigned short *DataArray=Null
DataArray = (unsigned short*)MemBuffer
My question is whether I can somehow directly access the Windows Buffer in PowerBasic. For example, can I perform a similar pointer cast as done in C++, or maybe overlay a PowerBasic Array over the Windows global memory buffer. What do I do with that handle? :thinking:
I've been working on converting the header file for the Universal Library to support PowerBasic 8.04 syntax macros and function definitions, and have had some success using the library for functions which do not involve arrays or buffers.

Sincerely,
John Harvill
Comment