1. RAFAEL RODRIGUEZ
  2. PowerBuilder
  3. Wednesday, 16 October 2019 15:59 PM UTC

I am using a DLL to create a QR, I compiled this and i have no errors, this is running in an independent application, but when i insert this into my main application,  I have this error:

Unresolvable external fastqrcode when linking reference at line 2 ...

Can someone help me, thanks.

RAFAEL RODRIGUEZ Accepted Answer Pending Moderation
  1. Thursday, 17 October 2019 03:13 AM UTC
  2. PowerBuilder
  3. # 1

Thanks for all your comments, I review the DLL and is in the same folder of the pbl, target and so on.

I don´t use GetFileOpenName, neither Listbox DirList .

I declare in "local external function", and now I move to "global external function" and now it runs.

Thank you.

 

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 16 October 2019 17:00 PM UTC
  2. PowerBuilder
  3. # 2

To call a function in a DLL, it uses the system load order to access the DLL. The system load order is usually current folder followed by the exe's AppPath setting in the registry and the system path.

Running in the PB IDE, the current folder can vary, it might be the PBL folder or the Target folder. It is usually better to just put it in a folder that is in the system path. That way you know that it will be found.

Comment
  1. Michael Kramer
  2. Wednesday, 16 October 2019 18:35 PM UTC
Thanks, Roland. Good point! However I like staying out of O/S folders. Also having worked at several high governance workplaces most of my local harddisk is locked down.

I would consider create a separate folder within my working area and throw .DLLs, assemblies, .config files, etc. -- and make THAT folder part of my system path (or app path).
  1. Helpful
  1. Roland Smith
  2. Wednesday, 16 October 2019 18:46 PM UTC
GetFileOpenName and the Listbox DirList function can change the current folder.



I use the AppPath setting for the PB IDE to set the folder where all the image files are located. This method should also work for DLL files.
  1. Helpful
  1. Roland Smith
  2. Wednesday, 16 October 2019 18:50 PM UTC
The registry key is:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\pb###.exe

Under that, the Path value is used to add folders to the path used by that exe only.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 16 October 2019 16:44 PM UTC
  2. PowerBuilder
  3. # 3

Hi Rafael;

  If this only fails at run-time ... it might help if you wrap the calling code in a TRY..CATCH block and then look at the error code and error message in the "exception" object.

Regards ... Chris

Comment
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Wednesday, 16 October 2019 16:31 PM UTC
  2. PowerBuilder
  3. # 4

Hi Rafael,

Do you see the error when you run from within PB IDE?

In that case I would check whether the .DLL is in the right folder.

Right folder = Folder where the >PBL containing your application object is located. This is sometimes a subfolder to the folder where your .PBT file is located.

HTH /Michael (PS: I'm gone for at least an hour after I post this message. I'm sure others can help if you reply while I'm away/)

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.