LocalAlloc

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dirk Reske

    #1

    LocalAlloc

    Hello,

    I have following C++ code:
    the Memory should be larger than the struct

    STRUCT struct1 = (STRUCT) LocalAlloc(LPTR , 100);

    how can I perform this in C#
    I want this, because I need to call a C++ dll


  • Daniel O'Connell

    #2
    Re: LocalAlloc


    "Dirk Reske" <_Freak-2k@gmx.net> wrote in message
    news:%23GApsmdl DHA.2424@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > Hello,
    >
    > I have following C++ code:
    > the Memory should be larger than the struct
    >
    > STRUCT struct1 = (STRUCT) LocalAlloc(LPTR , 100);
    >
    > how can I perform this in C#
    > I want this, because I need to call a C++ dll[/color]

    Well, without seeing the structure, I'd probably say add a byte[] at the end
    of the structure with a MarshalAs(Unman agedType.ByValA rray,SizeConst= 100)
    attribute applied to that field.
    [color=blue]
    >
    >[/color]


    Comment

    Working...