Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VC++ configuration for Building DLLs?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00068689
Message ID:
00068791
Vues:
33
Hello Lou!

what type of op.system do you use? And before you use the string do you increment the length of it with 1 position and set it on 0?
Somethig like this: (the first parameter is the string to manipulate)

if (!_SetHandSize(parm->p[0].val.ev_handle,parm->p[0].val.ev_length+1)) {
_Error(182); // "Insufficient memory"
}
_HLock(parm->p[0].val.ev_handle);
string = (char FAR *) _HandToPtr(parm->p[0].val.ev_handle);
string[parm->p[0].val.ev_length] = '\0';
memcpy(destination,string,parm->p[0].val.ev_length+1);
_HUnLock(parm->p[0].val.ev_handle);

P.S.:
I cannot use fll - made by me - on win95, only on NT4.0 because Library file is invalid messages appears.

BB

>I am new to Visual C++, but have been using FoxPro since the mid-nineteen-eighties and have just discovered how to build a DLL in Visual C++ ver. 5.0 that I can access in Visual FoxPro 5.0a with a "SET LIBRARY TO filename.dll" command. It seems to load fine and behaves normally for a while and then I get a General Protection Fault error "Invalid Page Fault error in KERNEL32.DLL at 0137:bff78040" It is always the same error at the same address.
>My DLL performs processing on strings. I use the FoxPro API memory handle locking and unlocking function calls within the DLL before performing the string processing using pointers. The FoxPro application simply opens a file, reads from it and performs string processing using the DLL then displaying the string. Then it performs the reverse of the process, writing the changes back to the file. The program seems to behave correctly for a while and then the GPF occurs.
>The DLL was created as a "Win32 DLL" (non-MFC) in Visual C++ 5.0 I followed the instructions included with Visual FoxPro for Visual C++ 4.0 setting the C code compiler to _fastcall and "Multi-threaded DLL." Is there some other configuration setting that I have to change for compiling a DLL for VFP in VC++ 5.0?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform