General information
Category:
Coding, syntax & commands
I can see whats going on now. Its in the way you are trying to return a string from the DLL. Below is an example of passing a string in from VFP to the DLL function and the DLL function itself. I cannot give you a specific Oracle example as I don't do Oracle :-)
**** VFP Code ****
DECLARE INTEGER TestInteger IN testdll string @
gcBuffer = space(40)
? TestInteger(@gcBuffer)
? gcBuffer
**** VC 6 SP4 DLL Code ****
#define WIN32_LEAN_AND_MEAN
#include
extern "C"
{
__declspec(dllexport) int TestInteger(char *string);
}
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
__declspec(dllexport) int TestInteger(char *string)
{
// Copy the string remembering you must have allocated space
// for the NULL terminator. Also must not overun memory allocated
// by calling process.
strcpy(string, "Sample.c");
// You dont really need to do this.
return(strlen(string));
}
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only