cancel
Showing results for 
Search instead for 
Did you mean: 

Amyuni with PB12.6 64-bit

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks Lars

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks, Chris. I never realised you could do that. Live & learn...

Former Member
0 Kudos

I always say .... "Its a great day when you learn something new"!  

Or as Mr Warf would say on StarTrek ... "It is a good day to die and the day is not over yet"!