Information générale
Catégorie:
Codage, syntaxe et commandes
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));
}
Précédent
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