OK, I'm back. This has been one big pain in the rear. I've made a lot of progress on this issue, but one of the main problems is that there is VERY little sample code in FoxPro 2.6 in calling DLL files. Most of the code is in VFP, VB, or some other language that is already 32-bit or object oriented. Plus, Microsoft in its great wisdom, doesn't always provide the best documentation.
So, it appears the GETOPEFILENAME function is in the ComDlg32.DLL. As previously stated, there's no documentation on how to call this function from FP 2.6. It appears the best approach is to use the CALL32.DLL library to call the GETOPENFILE function. In addition, to call the CALL32.DLL library, you must use the FOXTOOLS.FLL library. So, following is the code I have come up with so far. All I need is the proper parameters for the GETOPENFILENAME function. Any help with this would be greatly appreciated.
CLEAR
SET LIBRARY TO FOXTOOLS
* Initialize variables.
lcfilename = "C:\TMG-TMS\DOC\Generated Settlement Statements 1.PDF"
* Initialize the "GETOPENFILENAME" function in the "ComDlg32.DLL" and return
* the 32-bit function handle. The ComDlg32.DLL is located in either the
* Windows\System or Windows\System32 directory.
lncall32 = REG32("GetOpenFileName","ComDlg32.DLL","")
@ 5,10 SAY "lncall32 variable: " + str(lncall32,10)
* Initialize a second function handle to be used by the CallFn function in
* FOXTOOLS.DLL. This will be the first parameter of the CallFn function.
lnfunchand = REGFP("C","C")
@ 10,10 SAY "lnfunchand: " + STR(lnfunchand,10)
* Call the GetOpenFileName function using the two file handles created
* previously.
lclongname = CALLFN(lnfunchand,lcfilename,lncall32)
@ 15,10 SAY "lclongname: " + lclongname
RELEASE LIBRARY FOXTOOLS
In the 3rd to the last line, the CALLFN is shutting down FP 2.6 for windows. I think it has to do with the middle parameter. I just don't know what the correct parameters are for the GETOPENFILENAME function. Does anyone know what the middle parameter value should be?
Thanks,
Gene