Search results

  1. mavromatis

    VB.NET Structures and Union Help.

    I sent you links via Private Message to the documents (PDF) that explain everything.
  2. mavromatis

    VB.NET Structures and Union Help.

    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...
  3. mavromatis

    VB.NET Structures and Union Help.

    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! :(
  4. mavromatis

    VB.NET Structures and Union Help.

    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...
  5. mavromatis

    VB.NET Structures and Union Help.

    John, I found this http://www.dotnet247.com/247reference/msgs/5/27796.aspx, read last post. I think we need to do the overloaded method.
  6. mavromatis

    VB.NET Structures and Union Help.

    False Alarm... I don't think auto uses the fieldoffset, hence the reason why it compiles. :(
  7. mavromatis

    VB.NET Structures and Union Help.

    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)...
  8. mavromatis

    VB.NET Structures and Union Help.

    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
  9. mavromatis

    VB.NET Structures and Union Help.

    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...
  10. mavromatis

    VB.NET Structures and Union Help.

    UPDATE: It's the arrays, you're right. I think it's allocating the space right away?
  11. mavromatis

    VB.NET Structures and Union Help.

    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...
  12. mavromatis

    VB.NET Structures and Union Help.

    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...
  13. mavromatis

    VB.NET Structures and Union Help.

    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; //...
  14. mavromatis

    VB.NET Structures and Union Help.

    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...
  15. mavromatis

    VB.NET Structures and Union Help.

    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...
  16. mavromatis

    Getting Pointer Of 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...
  17. mavromatis

    VB.NET Structures and Union Help.

    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...
  18. mavromatis

    VB.NET Structures and Union Help.

    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 {...
  19. mavromatis

    VB.NET Structures and Union Help.

    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...
Top Bottom