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

Getting structure from Windows API

P: n/a
I have an API that return the following structure:
typedef struct _WTS_CLIENT_ADDRESS { DWORD AddressFamily; BYTE
Address[20];
} WTS_CLIENT_ADDRESS, *PWTS_CLIENT_ADDRESS;

I have defined it in VB .NET as:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
Private Structure WTS_CLIENT_ADDRESS
Dim AddressFamily As UInt32
Dim Address As Byte
End Structure

The data from function is returned in the ppBuffer variable.
My quistion is how to get the Address part of structure as string?

Some sample code:

Dim FRetVal As Integer
Dim pBytesReturned As Integer '= ppBuffer.Capacity
Dim ppBuffer As WTS_CLIENT_ADDRESS
FRetVal = WTSQuerySessionInformation(ptrOpenedServer,
SessionId, InfoType, ppBuffer, pBytesReturned)
If FRetVal <> 0 Then
' Code to extract the Address from stucture
??????????????????
Else
Throw New Exception("Error")
End If
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.