HighTechTalks DotNet Forums  

VB.net: pointer to receive the user list pointer, Marshalling Nested Structures

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss VB.net: pointer to receive the user list pointer, Marshalling Nested Structures in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Uwe Bohnhoff via DotNetMonster.com
 
Posts: n/a

Default VB.net: pointer to receive the user list pointer, Marshalling Nested Structures - 04-27-2005 , 05:06 PM






Hi there,
i have the following problem with a 3. party dll:
c++ function with the following structures:

typedef struct
{ uint16 szUserId[ID_SZ_SIZE]; // null terminated 23 char User id for this
user - should be unique
} ts_USER

typedef struct
{ uint32 uiSizeBytes; // size in bytes pf entire returned list, including
structure parameters
uint32 uiNumUsers; // number of users returned in list
ts_USER asUser[1];
} ts_ALL_USERS

Result_Code GetListOfAllUsers(ts_ALL_USERS** ppUserList) // ppUserList: a
pointer to receive the user list pointer


I declared the structure in VB(i build one structure ?!):

<StructLayout(LayoutKind.Sequential)> _
Public Structure ts_ALL_USERS
Public uiSizeBytes As UInt32
Public uiNumUsers As UInt32
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=23)> _
Public szUserID() As UInt16
End Structure


Public Declare Auto Function GetListOfAllUsers Lib "c:\windows\system32\
atsc63.dll" Alias "GetListOfAllUsers" (ByVal AT_User As ts_ALL_USERS) As
Int16

I don't know, how to marshal the parameter.

i know, that it's wrong:
Dim AT_USERS As New ts_ALL_USERS
Erfolg = GetListOfAllUsers(AT_USERS)
but i don't know, how it's right.
Thanks for help.

--
Message posted via http://www.dotnetmonster.com

Reply With Quote
  #2  
Old   
Pedro Alves Pereira
 
Posts: n/a

Default Re:VB.net: pointer to receive the user list pointer, Marshalling Nested Structures - 11-14-2005 , 11:18 AM






Ola,

Estou com os mesmos problemas para usar esta DLL por acaso voc=C3=AA conseguiu algo .=
...


Hi,

I am with the same problems to use this DLL by chance you obtained something...

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.