on 01-09-2015 4:24 AM
I am using Amyuni PDF Creator to create PDF files.
The main library file is cdintf.dll.
I have a user object in which all Amyuni API function calls are prototyped.
eg: function Long DriverInit (String Printer) Library "cdintf.dll" alias for "DriverInit;Ansi"
Now I am trying to deploy this as 64-bit.
I find I need to register the 64-bit version of Amyuni: REGSVR32 cdintf64.dll
I then need to modify my user object to use this 64-bit library
eg: function Long DriverInit(String Printer) Library "cdintf64.dll" alias for DriverInit;Ansi"
This is unsatisfactory because now I need two versions of my app - 32-bat and 64-bit.
I prefer to have just one set of source code.
Any suggestions?
You could use polymorphism. Create two descendants of the user object. n_cst_api32 and n_cst_api64 with the appropriate DriverInit function declarations in each. Then Create lnv_api Using "n_cst_api64" on 64bit...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Larry;
1) You can use Lars suggestion for Polymorphism.
- OR -
2) You can just wrap the call with an IF .... for example:
IF fn_is_64bit_os ( ) = TRUE THEN
DriverInit32 (......)
else
DriverInit64 ( ... )
END IF
Where
a) the DriverInit method has two External Function entries qualified by either 32 or 64 bitness
b) use the following in the fn_is_64bit_os ( ) method to check the OS bitness:
Boolean ib_64bit_os_found
IsWOW64process ( GetCurrentProcess ( ) , ib_64bit_os_found) |
Return ib_64bit_os_found
Externals
FUNCTION Boolean IsWow64Process ( ulong hProcess, Ref boolean Wow64Process) LIBRARY "KERNEL32.dll"
FUNCTION ulong GetCurrentProcess ( ) LIBRARY "KERNEL32.dll"
HTH
Regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Chris,
Unfortunately, cdintf.dll has a DriverInit external function and cdintf64.dll also has a DriverInit external function.
I do not see how I point to one or the other in the same object. I believe that Lar's solution involves two objects, one pointing to the 32-bit DriverInit external function and the other objects to the 64-bit version. Then, in code, I need to decide which object to initialize. How does your proposed solution work?
Thanks,
Larry
Hi Larry;
That is not an issue ... just use the following external declarations:
Function Long DriverInit32 (String Printer) Library "cdintf.dll" alias for "DriverInit;Ansi"
Function Long DriverInit64 (String Printer) Library "cdintf64.dll" alias for DriverInit;Ansi"
Now just call the respective one based on whether your application is running in 32 or 64 bit mode.
Regards ... Chris
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.