Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CallFn Problems
Message
De
16/08/1996 23:42:40
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Titre:
Divers
Thread ID:
00005081
Message ID:
00005925
Vues:
54
Try to use (I am not sure is OK):
FuncHandle=RegFn(1,"@C@C@C@C,"@C","MYDLL.DLL")
The diference is in the @ character in front of C for the return value.

I think that when you are issuing the CallFn, this function returns a string with a length of n characters and it overwrites a memory space (used for something else) and this generates the error.
Try the following:
a_string=space(n)
a_string=CallFn(FuncHandle,"myparm1","myparm2","myparm3","myparm4")
where n is the maximum length of the returned string.
This ensures you that you are not writing in an illegal memory area.

If you still have the error, you may also try to include the returning variable in the parameter list passed to FuncHandle function. (Transform FuncHandle from function to procedure.):
FuncHandle=RegFn(1,"@C@C@C@C@C,"MYDLL.DLL")
MyReturnValue=space(n)
=CallFn(FuncHandle,"myparm1","myparm2","myparm3","myparm4",@MyReturnValue)
This works for sure, because I used it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform