FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
[WD75] Structures, dynamic arrays ...
[WD75] Structures, dynamic arrays ...
Débuté par Peter van Vuuren, 21 aoû. 2003 20:04 - Aucune réponse
Connectez-vous…
Peter van Vuuren
#1
Posté le 21 août 2003 - 20:04
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
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte