mjb3030 Posted February 10, 2004 Posted February 10, 2004 I am working with some 3rd party API functions which were written a number of years ago. They are for data acquistion purposes. One of the functions returns a handle to a location where the acquired data value is stored. That works fine. Another function takes the handle as input and puts the data stored at that location into another variable. This function keeps returning an "Invalid Buffer" error. However, if I perform the exact same sequence of events in VB6, everything works fine, and the value that is being passed as the handle is in the same numeric range as when I run it in VB.NET. The only change I have made in .NET is that I changed the Longs to Integers. My question is: A) Is there a .NET function which will allow me to access the memory buffer directly without having to use these old functions? B) If not, does anyone know what I might be doing wrong? I can post the code if the answer to A is no. Thanks. Quote
Administrators PlausiblyDamp Posted February 10, 2004 Administrators Posted February 10, 2004 Could you post the code you are using (declares etc) - alos the VB6 version if possible. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
*Experts* Merrion Posted February 10, 2004 *Experts* Posted February 10, 2004 Look at the System.InterOp.Marshal class/namespace. This has stuff for reading data to/from memory locations. Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
mjb3030 Posted February 10, 2004 Author Posted February 10, 2004 Thank you for your help. I emailed the company that made this software, and they sent me a modified module which works. Quote
Recommended Posts