What Is Marshalling
Feb 24, 2009What is marshalling in vb.net
View 1 RepliesWhat is marshalling in vb.net
View 1 RepliesI am having trouble converting some code from VB6 to VB.NET (I don't have as much experience with .NET). When I run the 'Select function (from the WS2_32.dll library) in .NET, using the same parameters as the VB6 program, it returns a result of -1 (indicating an error). I think the error may be related to an upgrade comment I saw about marshalling, but I was not sure what I needed to do to declare the function differently. Here is the code that I believe is related to the problem (including the upgrade warnings from Visual Studios):
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> Private Structure FD_SET
Dim fd_count As Integer
<VBFixedArray(FD_SETSIZE)> Dim fd_array() As Integer
Public Sub Initialize()
[code]....
Trying to read the OBJECTDESCRIPTOR on the clipboard. Almost get it. My guess I don't know how to Marshall the structure. I definetly don't know how to handle: ..."null-terminated string whose offset in bytes is specified in the dwSrcOfCopy "Getting this returned variable length string is what I need help with.
Start with this
typedef struct tagOBJECTDESCRIPTOR {
ULONG cbSize;
CLSID clsid;
DWORD dwDrawAspect;
[code]....
I am having a problem marshaling data between managed and unmanaged code. So I need to inspect the data at the byte level. What I need to do is store a number, say 8 into a 4-byte integer then copy it to an array bytArray(4) and compare those bytes with other data. I also need to set up the same array and copy it to an integer variable.
View 2 RepliesI'm trying to interact with the Windows SDK to control a Portable Media Device, and am running into problems correctly marshalling variables to the types expected by the SDK DLLs.I have the following code.
View 2 RepliesI'm experiencing a problem with the following c-structure:
typedef struct tagTEXTUREPROP
{
DWORD dwSize;
[Code].....
The Marshal.SizeOf obviously calculates a size of 76 and it works with the DLL function, but it leaves me with some bad feelings.