I want to do in VB.Net what is done in C++

G

Guest

I have this code:
typedef KPDCUInt8* KPDCPointer;

typedef enum
{
KPDCRed = 0, // Currently, RGB is all we got.
KPDCGreen = 1,
KPDCBlue = 2,

KPDCMaxNumComponents = 8 // The maximum number of components
conceivable.
} KPDCColorComponents;

typedef struct
{

KPDCPointer componentPtr[KPDCMaxNumComponents];
// Array of pointers to the
components,
// indexed by KPDCColorComponents.
} KPDCPixelLayout;

typedef enum
{
KPDC_CameraModelUnknown = 0,
KPDC_ProBackCamera = 0x4000,
KPDC_ProBack645 = 0x4001,

KPDCModelCodes_end
} KPDCModelCodes;

I want to do it in VB .Net. I know how to do structures and enumerators.
What I don't know is what to do about the pointer, and then what to do about
the last enum mentioned. How do I get those values into VB.Net?
 
R

Robby

As I understand it VB.Net does not support pointers. What you could do is
make a class instead of a struncture and declare and array of that class.
Since a class is a reference type then you would get the same feel of a
pointer.

Robby
 
Y

Yohan Saptoadi

there's a native IntPtr and a HandleRef if you are too lazy
to clean up references to pointers. the real question is
are you trying to use a native coding from a dotnet app or
are you porting it to dotnet ?

native interop is a very vast and complicated subject.
 
G

Guest

The C++ code is code used to load an unmanaged .dll. I'm trying to create a
managed wrapper in VB.Net.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top