Have a function as follows once I forage and translate everything into basic types:
Code
unsigned int DAOpenDocument(HANDLE lphDoc, unsigned int dwSpecType, void* pSpec, unsigned int dwFlags);
The documentation says that lphDoc is "a Pointer to a handle that will be filled with a value uniquely identifying the document to data access. The developer uses this handle in subsequent calls to data access to identify this particular input file. This is not an operating system file handle. Once I plugged this into P/Invoke Iterop Assistant I get:
I use lphDoc = (System.IntPtr)GCHandle.Alloc(new Object(), GCHandlerType.Pinned); I know this allocates memory the sizeof Object, since I don't know what is going in there and I want it to be long lived, this seemed like a reasonable assumption. Is it? pSpec contains a file path which I've done before using System.IntPtr path = Marshal.StringToHGlobalAnsi(String filepath);
It turns out that the new Object() does work either. I get "System.ArguementException: Object contains non-primitive or non-blittable data".
Any better alternatives? Jim
Answers
Know the answer? Post it. Somebody with the same question will find it here.
Answers
Know the answer? Post it. Somebody with the same question will find it here.