By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,219 Members | 1,748 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,219 IT Pros & Developers. It's quick & easy.

How to translate C++ typedefs into C# ?

P: n/a
How to translate the following C++ typedefs into C# ?

typedef struct {
BYTE *data;
size_t length;
} VizBlob;

typedef struct VizUserInfoActions {
HANDLE (IMPORTED *createFullInfo) (
HANDLE logger,
const VizBlob *blob
);
const VizBlob *(IMPORTED *fullInfoBlob) (
HANDLE logger,
HANDLE fi,
int version);
} VizUserInfoActions;
--
Best regards,

Oleg Subachev
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
you can transform these structs into structs or classes in C#

public class VizBlob
{
public byte[] data;
}

public class VizUserInfoActions
{
public delegate IntPtr createFullInfo(IntPtr Logger, VizBlob blob);
public delegate VizBlob fullInfoBlob( IntPtr logger,
IntPtr fi, int version)
}

However those IntPtrs can also be substituted by appropriate class
definitions. IntPtr is used for the interop with the Win32 world...

I recommend you to see the docs about structs, classes and delegates ( they
are like function pointers in C++ )

--
Vadym Stetsyak aka Vadmyst

"Oleg Subachev" <ol**@urvb.ru> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
How to translate the following C++ typedefs into C# ?

typedef struct {
BYTE *data;
size_t length;
} VizBlob;

typedef struct VizUserInfoActions {
HANDLE (IMPORTED *createFullInfo) (
HANDLE logger,
const VizBlob *blob
);
const VizBlob *(IMPORTED *fullInfoBlob) (
HANDLE logger,
HANDLE fi,
int version);
} VizUserInfoActions;
--
Best regards,

Oleg Subachev

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.