PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
[WD75] Structures, dynamic arrays ...
[WD75] Structures, dynamic arrays ...
Started by Peter van Vuuren, Aug., 21 2003 8:04 PM - No answer
Connect yourself…
Peter van Vuuren
#1
Posted on August, 21 2003 - 8:04 PM
Hi,
I'm working on a small class to integrate some Terminal Services functions
in our main configuration program via the wtsapi32 API.
I have a question about retrieving the values of an array of structures,
because for the moment i'm out of ideas.
Example code :
--
//Class declaration
WTS_SESSION_INFO is structure
SessionId is int
pWinStationName is int
//state As WTS_CONNECTSTATE_CLASS
State is int
END
clTSE is class
structSessionInfo is WTS_SESSION_INFO
END
--
PROCEDURE TSE_EnumerateSessions()
dynarrSessionInfo is array of 1 WTS_SESSION_INFO
res is int
//pCount receives the number of WTS_SESSION_INFO structures
pCount is int
//ppSessionInfo receives a pointer to array of structures
ppSessionInfo is int
res=API(:sDLL,"WTSEnumerateSessionsA",:hServer,0,1,&ppSessionInfo,&pCount)
IF res THEN
Dimension(dynarrSessionInfo,pCount) //redim array
Transfer(&dynarrSessionInfo,ppSessionInfo,pCount*Dimension(:structSessionInfo))
END
--
Now I've got a an array of structures (dynarrSessionInfo)
This structure is easy because it consists of 3 same VarTypes (3 ints)
so totally pCount*3 integers but how about an array of structures
with different kinds of varTypes ?
*
*
When writing down the problem i see also the solution
--
j=ppSessionInfo
FOR i = 1 TO pCount
Transfer(&:structSessionInfo,j,Dimension(:structSessionInfo))
DoTheThing() //Whatever
j+=Dimension(:structSessionInfo)
END
--
Sorry for the disturbance but i post it anyway ...
--
Peter
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text