User Profile

Collapse

Profile Sidebar

Collapse
grndvl1
grndvl1
Last Activity: Aug 24 '10, 09:04 PM
Joined: Dec 10 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Let expand on this I have an interface ILayer that is used in my abstract class ALayer and this abstract is used in My Ethernet or Com classes. Therefore this will abstract the communication layer, then I won't care what the actual communication as long as I can read and write from them. SO far this is what I have:

    public interface ILayer {
    bool isConnected();
    bool reconnectSettin g();
    void...
    See more | Go to post

    Leave a comment:


  • How to write abstraction for communications Ethernet and Serial

    I am attempting to write an abstract layer to make Ethernet and Serial seemless in my application. I have an interface that is the what I call ILayer it has the method stubs for connect, disconnect, read and write. Next I have an AbstractLayer class that will handle the read and writes and abstract the rest of the methods to the inheriting classes. What I want is to use IOStreams or something similar so to that when I have the Ethernet or Serial...
    See more | Go to post

  • How to Marshal data back from addlexport call of structures within structures?

    Here is what I have:

    I have a Structure, TM_Response that is 3 structures inside of it plus 3 other byte fields. One of the internal structures has a byte array of variable size. I am calling an unmanaged dll and the function returns bool but has pointers to the two structures you pass into it. I need help with this big time. So what will the marshaled structures look like? I have attached the code with the example and the dll...
    See more | Go to post

  • grndvl1
    replied to PInvoke
    Actually i found the answer here it is

    [StructLayout(La youtKind.Sequen tial)]
    public struct TM_Message {
    [MarshalAs(Unman agedType.ByValA rray, SizeConst = ConstantsUsed.M AX_MSG_LEN)]
    public byte[] data;
    public int MsgLen;
    };

    public static class ConstantsUsed {
    public const int MAX_MSG_LEN = 80;
    }

    and then...
    See more | Go to post

    Leave a comment:


  • grndvl1
    started a topic PInvoke

    PInvoke

    Here is my issue, I am very new to C# and want to invoke a custom dll that I can't register using regsvr32. I figured out I need to use PInvoke somehow but need help since all the methods return void, the data is in the Msg pointer. Some of the functions will need to send data using Msg and then will receive back in a modified pointer.

    Here is one example the message is a structure that is passed to GetTMVersionInf o ( TM_Message*...
    See more | Go to post
No activity results to display
Show More
Working...