>I have the dll and the foxpro exe in the same directory. I can declare and load the dll and it works fine.
>
>The problem is from foxpro I am executing some other program (Y) which is in different directory. Once I execute the y program the default directory is changed and foxpro is unable to find the dll. I tried to set current directory by using foxpro commands "set default to" , "set Path to" and also tried to use windows api function "SetCurrentDirectory" Nothing worked - foxpro couldnot find the dll and gave an error with Declare dll.
>
>One more wierd behaviour - Every thing works fine ONLY the first time I run the exe after build. If I run the SAME exe for the second time it gives an error. If I rebuild the executable, Again it works fine for ONE time. It is unbelievable.
>
Try specifying the full path of the DLL file in the DECLARE...DLL statement.
>Anybody encountered this before. Please shed some light.
>
>Thank you.
>Gnana.