Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access dll over Christof Lange's struct class
Message
 
 
À
27/07/2001 13:54:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00536282
Message ID:
00536571
Vues:
8
Christian,

If you want to look at some C++ code there are two VC++ projects over on my website that create functions callable from VFP. They are SpyIn and DeQuote under the Samples link from my page.

int helperfunction (char *address, unsigned int port)
{
hlserver server; // allocate the struct on the stack

server.address = address; // fill it with the arguments passed from VFP
server.port= port;

return HLRequestdetait( &server ) // send the struct on to the original function
}

Then the VFP code:
declare dll integer helperfunction string address, integer port
? helperfunction( 'a', 1 )


>i don't get your point exactly ..
>
>you mean .. for example ..
>in c:
>
>
>int helperfunction (char address, unsigned int port)
>{
>allocate memory for hlserver struct ( don't even know you do this :) )
>struct hlserver *server;
>
>server->address = address;
>server->port= port;
>
>HLRequestdetait( with pointer to struct )
>{
>do things and fill struct
>
>return to vfp a pointer with adderss of struct , and sizeof struct)
>}
>
>then maybe dealloc the memory allocated in C from vfp with the clshead.prg?
>
>is it possible to release the memory alloceted in c from vfp with clshead?
>
>question over question .. :)
>
>never thought that it is getting so complicated :)
>
>thx for your response .. nice ideas poped up in my mind ..
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform