So I can still use the "hack" model you are suggesting and do everything manually without the structures... worst case.
I have also emailed Fred Hebert, the guy that wrote the DLL, let's see if he responds with any suggestions... :D
Again John, Thanks for all your time. I wish the outcome...
Ok, so to recap, you are saying that there is no easy way to read in the data from the provided DLL in any way. So until they provide a true COM interface, I'm SOL? Damn! :(
The MSFT documented method for doing unions in .NET is located here -- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconUnionsSample.asp
I'm thinking that is what we need to do... one is set as explicit the other as sequential. The Omni data structure is...
John...
If I set up the structure as StructLayout(LayoutKind.Auto), it seems to compile!? :D
This now compiles!! I take it the Auto, is what we need?
<StructLayout(LayoutKind.Auto)> _
Public Structure R_OMNI_LINK_MESSAGE
<FieldOffset(0)> Public MessageLength As Byte
<FieldOffset(1)...
John,
Anything in the MSDN Bug Detail that can help solve the problem?
http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?feedbackid=a35b402b-00ce-43da-8e63-c16f834b8805
Ahh... I see where you are going...
So I would read the first byte from Data(), if it's &H0B (olmNAME_DATA), then remove the first byte from Data() and pass it to the NAME_DATA structure. Which would let me reference the data by name. Am I reading you right?
Makes sense... don't see why it...
Yup... I'm getting that error too for everything... :mad: :confused: :eek:
System.TypeLoadException: Could not load type 'FlashServer.Message' from assembly 'FlashServer, Version=1.0.2228.19435, Culture=neutral, PublicKeyToken=null' because it contains an object field at offset 2 that is...
I think I'm almost there... really! :p
Is there a way to combine these... should they use fieldoffset to achieve this?
' ========================================================
' =========> COMBINE THE FOLLOWING
' olmNAME_DATA (8 bit)
<StructLayout(LayoutKind.Sequential)> _
Public...
Oh more question ... :D
In the system_status... I see that it has a nested structure for ExpansionEnclosures.
How would that be handled inside of the olmSYSTEM_STATUS structure?
struct /* olmSYSTEM_STATUS */ {
unsigned char TimeDateValidFlag;
unsigned char Year; //...
I really appriciate the help John! I'm learning a ton!!!
Yes! I think Fred Hebert is the guy that wrote the library in Borland C++ Version 5, that I'm trying to use in .NET.
I'll try out your code... do you think it would be wrong to do the following, so it stays more consistant with the...
Yeah... I think we're getting there...
I'm going to try both ways. Maybe a mix of the two... what do you think about this way:
<StructLayout(LayoutKind.Explicit)> _
Public Class R_OMNI_LINK_MESSAGE
<FieldOffset(0)> Public MessageLength As Byte
<FieldOffset(1)> Public Data As Byte...
I'm trying to figure out how to get the Pointer to a byte in a structure.
In VC.NET it's:
memcpy(&Msg.MessageType, CopyData->lpData, DataSize);
In VB.NET it's:
WINAPI.CopyMemory(<< ?? GET POINTER TO ?? >> Msg.MessageType, data.lpData, Msg.MessageLength)
I want to get the pointer of...
Great... It's starting to make a little bit of sense, however, I don't think it's exactly right...
Here's why:
I declare Msg variable of type R_OMNI_LINK_MESSAGE, I set the messageLength. Everything is fine so far...
' //declare a Msg variable of type R_OMNI_LINK_MESSAGE
Dim Msg As New...
John,
Thanks for the reply and the help! I was heading down the route of your last suggestion, since I think that one will keep the structure like the original VC.NET code.
However, I do have a question on how to do this StructLayout syntax. Let's say I have:
struct R_OMNI_LINK_MESSAGE {...
I have a chunk of VC.NET code (below) that I need to convert to VB.NET syntax. Could someone help me get started? I'm new to structures and unions and I don't understand how to nest them in VB.NET. Ideally, I'd like to see an example using the code I have below, so I it can start me off or is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.