Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MultiByteToWideChar????
Message
De
07/07/2000 08:20:00
 
 
À
07/07/2000 06:41:12
Information générale
Forum:
Visual C++
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00389334
Message ID:
00389391
Vues:
17
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
Fil
Voir

Click here to load this message in the networking platform