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 ..