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
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