1. Robert Piskac
  2. PowerBuilder
  3. Monday, 19 August 2024 15:00 PM UTC

When running the PB 2022 R3 IDE in x86 mode, if I run my application, I get an error calling external function %s.  This DLL works fine with PB 12.5. Are there any requirements for DLLs with PB 2022 R3?

Robert Piskac Accepted Answer Pending Moderation
  1. Tuesday, 20 August 2024 12:32 PM UTC
  2. PowerBuilder
  3. # 1

I forgot to publish my developer environment.

Apple iMac M1

Parallels VM

Windows 11 ARM

Comment
  1. John Fauss
  2. Tuesday, 20 August 2024 13:22 PM UTC
Aha! It's always, always, ALWAYS helpful to include this information in any post to the Q&A forum.

To quote Chris Pollach's response from a Mac/ARM/Parallels question last week (https://community.appeon.com/index.php/qna/q-a/run-powerbuilder-in-macos-m3-harware-using-parallels):

"Both the PB IDE & runtime are built using Microsoft C++ 2022 (in PB 2022 R3), and require an Intel or Intel compliant CPU in order to run."
  1. Helpful
  1. mike S
  2. Tuesday, 20 August 2024 13:26 PM UTC
that dll works in windows 11 arm with pb 12?
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 19 August 2024 19:41 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Robert - 

What software (Visual Studio, perchance?) and version are you using to create the DLL?

Can you please supply the function's prototype for the DLL function you are calling, and also the external function declaration in PB for that DLL function?

Comment
  1. Robert Piskac
  2. Monday, 19 August 2024 19:48 PM UTC
Function ulong GetTempPath(ulong nBufferLength, ref string lpBuffer) Library "kernel32.dll" ALIAS FOR "GetTempPathA;Ansi"

Function Long PBSIsClipboardImageAvailable() Library "pbwinlib.dll"

Function long PBClipboardSave(long hWnd, long dataType, ref string strPathFile, ref long awidth, ref long aheight) Library "pbwinlib.dll" alias for "PBClipboardSave;Ansi";

Function long PBSConvertImage(long convertType, ref string fileFrom, ref string fileTo) Library "pbjpeg.dll" alias for "PBSConvertImage;Ansi"

Function long PBClipboardDIBResizeSave(long hWnd, long dataType, ref string aszFileName, long awidth, long aheight) Library "pbwinlib.dll" alias for "PBClipboardDIBResizeSave;Ansi"

Function long PBClipboardDIBGetSize(long hWnd, long dataType, ref long awidth, ref long aheight) Library "pbwinlib.dll"

Function long PBScanPicture(long hWnd, long topWhole, long topFrac, long leftWhole, long leftFrac, long rightWhole, long rightFrac, long bottomWhole, long bottomFrac, long Show, long Flag) Library "pbscan32.dll"



// *********************************************************************

//

//

//

//

// *********************************************************************

long WINAPI PBSIsClipboardImageAvailable(void)

{

if (IsClipboardFormatAvailable(CF_DIB))

return(1);



return(0);

}



From Depends DLL exporter



PBSBrowseForFolder

PBSRunAndWait

PBSGetFirstFile

PBSGetNextFile

PBSGetEnv

PBSGetOpenFileName

PBSOpenComPort

PBSSetComPort

PBSComWrite

PBSComRead

PBSCloseComPort

PBSIsClipboardImageAvailable

PBClipboardSave

HttpGetFile

PBClipboardDIBResizeSave

PBClipboardDIBGetSize



Visual Studio 2022

DLL works in my OLD PB 12.5 application , but not in the PB 2022 R# IDE runtime.
  1. Helpful
  1. Roland Smith
  2. Tuesday, 20 August 2024 12:46 PM UTC
Make sure the 'ref string' arguments are pre-populated using the Space function with a length that can hold the largest possible value. For example, GetTempPath can return up to 260 characters.
  1. Helpful 1
There are no comments made yet.
Robert Piskac Accepted Answer Pending Moderation
  1. Monday, 19 August 2024 16:32 PM UTC
  2. PowerBuilder
  3. # 3

From the first post: When running the PB 2022 R3 IDE in x86 mode.  Yes it's in the directory, I even put the full path to the DLL in the declaration just in case.  Running in x86 mode with x86 dll that works in PB 12.5 application.  I will make a x64 version to see if there is a bug in the IDE where it wants x64 dll.

Comment
  1. Robert Piskac
  2. Monday, 19 August 2024 22:09 PM UTC
Yes, PB 12.5 is 32 bit and will not run x64 dll's natively.
  1. Helpful
  1. Robert Piskac
  2. Monday, 19 August 2024 22:09 PM UTC
I don't think C applications support try catch. Yoy Canadians don't know C coding very well.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 19 August 2024 23:11 PM UTC
We're talking the TRY...CATCH in PB.
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Monday, 19 August 2024 16:27 PM UTC
  2. PowerBuilder
  3. # 4

no. there are 0 differences in that regard.

 

you either:

1 - are running 64 bit pb and the dll is 32 bit (or 32bit pb and dll is 64bit)

2 - do not have the dll in the application directory or in the system path

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.