Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dll calls work in vfp8, but not in vfp9
Message
From
15/11/2007 13:22:13
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Dll calls work in vfp8, but not in vfp9
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01269221
Message ID:
01269221
Views:
66
Hi All,

I have a program written back in vfp6, I think. It calls a Dll, to create a pdf file from a ps file. When I build the application in vfp8, then run it, the pdf is built with a size greater the 1KB, and Adobe Reader opens the file without a problem. But If I build the same application in vfp9, then run it, the pdf is built with a size of 1KB and Adobe Reader can not open the file.

The line I see going wrong, looks like this:
        Declare Integer CreateProcess In kernel32.Dll ;
                INTEGER lpApplicationName, ;
                STRING lpCommandLine, ;
                INTEGER lpProcessAttributes, ;
                INTEGER lpThreadAttributes, ;
                INTEGER bInheritHandles, ;
                INTEGER dwCreationFlags, ;
                INTEGER lpEnvironment, ;
                INTEGER lpCurrentDirectory, ;
                STRING @lpStartupInfo, ;
                STRING @lpProcessInformation

        Declare Integer WaitForSingleObject In kernel32.Dll ;
                INTEGER hHandle, Integer dwMilliseconds

        Declare Integer CloseHandle In kernel32.Dll ;
                INTEGER hObject

        Declare Integer GetLastError In kernel32.Dll

        Define WAIT_TIMEOUT 0x00000102
        Define WAIT_INTERVAL 200
  
         If WaitForSingleObject(hProcess, WAIT_INTERVAL) != WAIT_TIMEOUT  && this always evaluates to True for vfp9.
the last line should be false, unles the process has timed out. It says true, the first time thru for vfp 9, while in vfp8, it will hit true after the pdf is built.

Any thoughts?

Thanks,
Beth
Next
Reply
Map
View

Click here to load this message in the networking platform