473,503 Members | 3,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting structure from Windows API

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
0 837

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2740
by: PHPkemon | last post by:
Hi there, A few weeks ago I made a post and got an answer which seemed very logical. Here's part of the post: PHPkemon wrote: > I think I've figured out how to do the main things like...
4
4724
by: Vidya Bhagwath | last post by:
Hello Experts, I am porting the C++ code into the Visual C#.NET. My C++ code is mainly based on the serial communication. So I am using the windows structure such as DCB.. etc and the windows...
7
2978
by: Microsoft | last post by:
I'm not sure where to physically place my subroutines in vb.net I get namespace and not declared errors... Imports System Imports System.Management Public Class Form1
14
4105
by: Just Me | last post by:
Can anyone fix the code below? I need to set pTo to NULL and pFrom to a fullfilepath followed by two NULLs Below Filename is a string With FileOperation ..wFunc = FO_DELETE ..pFrom =...
22
2796
by: SF | last post by:
Hello All, In a windows C learning project I am wokring on I use the system function to run a command, I want to suck the results into a vairable. The system function seems to only return an...
1
6092
by: sathyp | last post by:
Public Function SetPrinterDefaultsW(ByVal sPrinterName As String, _ ByVal nPaperSize As Long, ByVal nOrientation As Long) As Boolean Dim Prn As Printer Dim hPrinter As Long Dim pd As...
0
1230
by: hoderbob | last post by:
I need to find a way to catch the parameters entered in the Print Dialog box of any Windows application and pull the number of copies the user selected. I know most printers allow the driver to...
33
11807
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
41
3456
by: LayneMitch via WebmasterKB.com | last post by:
I was just chating with a few webdevelopers and it was brought to my attention that I need some type of server technology installed on my computer so I could get a visual of how my sites would look...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.