T
Tor Aadnevik
Hi,
I'm trying to call a win32 function using pinvoke and C# .Net.
The function takes a struct reference as a parameter (lpInfo), but on return
the struct is not filled with data, and I'm suspecting that I have made a
mistake mapping up the struct.
DBSTAT DBenum ( XInt32 hDBase,
LPSTR lpszPath,
XDWORD nLevel,
DBENUMCB Callback,
DWORD UserData,
LPVOID lpInfo);
The C struct is like this (truncated):
typedef struct _seginfo {
CHAR Name [ strSHORT + 1 ];
CHAR Desc [ strLONG + 1 ];
DWORD Created;
WORD DClass;
WORD UType;
Int32 Top;
Int32 Bottom;
WORD wPoints;
FLOAT fHStart;
WORD uHUnit;
FLOAT fVScale;
WORD SmpSize; // for smpFILE = file size
// for smpREGULAR
WORD TixPerSmp;
// for smpRANGE
XDWORD *lpUpdateCount;
// any
Int32 lAliasOffset;
} SGMINFO;
strSHORT = 10;
strLONG = 256;
Can anyone help me with a correct C# mapping?
I'm trying to call a win32 function using pinvoke and C# .Net.
The function takes a struct reference as a parameter (lpInfo), but on return
the struct is not filled with data, and I'm suspecting that I have made a
mistake mapping up the struct.
DBSTAT DBenum ( XInt32 hDBase,
LPSTR lpszPath,
XDWORD nLevel,
DBENUMCB Callback,
DWORD UserData,
LPVOID lpInfo);
The C struct is like this (truncated):
typedef struct _seginfo {
CHAR Name [ strSHORT + 1 ];
CHAR Desc [ strLONG + 1 ];
DWORD Created;
WORD DClass;
WORD UType;
Int32 Top;
Int32 Bottom;
WORD wPoints;
FLOAT fHStart;
WORD uHUnit;
FLOAT fVScale;
WORD SmpSize; // for smpFILE = file size
// for smpREGULAR
WORD TixPerSmp;
// for smpRANGE
XDWORD *lpUpdateCount;
// any
Int32 lAliasOffset;
} SGMINFO;
strSHORT = 10;
strLONG = 256;
Can anyone help me with a correct C# mapping?