Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem communicating with Digital I/O Card
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00395294
Message ID:
00396015
Vues:
13
Hi Ed ,

I have downloaded Struct.vcx as you suggested, and it seems like I've got it to work ( at least with some of my first DLL-calls).

But here is one that I can't find any solution to. I'm sure this is an easy one for you, but it's definitely an impossible mission for me.

It's obvious that the DRV_GetAddress-function expects the @DiValue parameter as string
(due to my VFP DLL-declaration).

If I understand the VB decaration of DRV_GetAddress it can handle "Any" type of parameter ?
How do I achieve this with VFP ?


*VB declaration:
*Declare Function DRV_GetAddress Lib "adsapi32.dll" (lpVoid As Any) As Long

*My VFP declaration:
DECLARE INTEGER DRV_GetAddress IN adsapi32.dll ;
STRING @ lpVoid

**************************
*The following works:

STORE 0 TO tt
STORE "" TO tempStr, tmpStruct

PT_DEVLIST = CreateObject( "MyStruct" )

tmpStruct = PT_DEVLIST.GetString()

tt = DRV_GetAddress(@ tmpStruct ) && tt gets a value like 41656200

*** If I understand this right tt is the value of the address for variable tmpstruct in memory ?

***********************
*But not this

DiValue=0

lpDioReadPort = CREATE("MyStruct_PT_DioReadPortByte")
* lpDioReadPort.varde is defined as 0 in the structureclass

lpDioReadPort.varde = DRV_GetAddress(@ DiValue) && Here I get data type mismatch
***********************


Torgny
/Torgny
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform