Information générale
Catégorie:
Fonctions Windows API
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement