Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C. Lange's struc class - enumerated types
Message
De
15/07/2002 19:04:33
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00678868
Message ID:
00678895
Vues:
39
Hi Thomas

I had a similar experience until I eventually found out that all RAS structures must have a length divisible by 4. I think it was mentioned at the end of one of his documents

Set the nfill property of the structures to 4

Cheers
Charlie

>I am trying to use Lange's struc class and subclasses to call the Windows API
functions related to RAS (dial-up networking). I'm having a problem getting
the function RasGetConnectStatus() to work. It is returning a value of 632
(ERROR_INVALID_SIZE), indicating that the structure size is invalid. I
defined a RasConnStatus structure by subclassing struc and adding the
required properties. I over-rode the default Init() method to set the
dwSize property to this.SizeOf(). I over-rode the default GetCMembers()
method as follows:

Return ;
"DWORD l:dwsize," + ;
"RASCONNSTATE l:rasconnstate," + ;
"DWORD l:dwError," + ;
"TCHAR z17:szDeviceType," + ;
"TCHAR z129:szDeviceName"

I suspect that the problem has to do with the rasconnstate property. This
is an enumerated type in C. What is the correct way to handle enumerated
types in structure classes? As you see from the above code, I tried
specifying this as "l" (long int). I also tried "w" and "b" and unsigned
option with all of these. The results were the same: the function returns
632. Do you have any suggestions?

All the above work was done in VFP 7.0 under Win2000.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform