Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MultiByteToWideChar????
Message
From
07/07/2000 08:20:00
 
 
To
07/07/2000 06:41:12
General information
Forum:
Visual C++
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00389334
Message ID:
00389391
Views:
19
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
Map
View

Click here to load this message in the networking platform