1. SHAMEEM KAKKAD
  2. PowerBuilder
  3. Friday, 22 October 2021 07:17 AM UTC

Hai Appeon team,

I have a DLL to access the document reader. While I am importing the DLL, getting errors. What is the reason?

 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 22 October 2021 13:25 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Shameem;

  You can only import DLLs that use "simple" data types that can be mapped to standard data types in PB. If you need to process .Net Classes as one example of non-simple data types, then you would need to create a .Net DLL that acts as a "wrapper" for the document reader DLL. 

Regards ... Chris

Comment
  1. Miguel Leeuwe
  2. Friday, 22 October 2021 16:41 PM UTC
Remember also, that the DLL import tool is only meant to work with NON visual DLLs. (Though some people did manage to do certain stuff if I remember well).
  1. Helpful 2
  1. SHAMEEM KAKKAD
  2. Friday, 22 October 2021 16:43 PM UTC
Anyway thanks a lot...
  1. Helpful 1
  1. Miguel Leeuwe
  2. Friday, 22 October 2021 17:36 PM UTC
lol, yw.
  1. Helpful 1
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 28 October 2021 21:57 PM UTC
  2. PowerBuilder
  3. # 1

For now my improved 3rd version. It should deal better with the different image formats, but still some seem to fail (like .tiff).

See attached.

regards.

(done terrorizing everyone with this QR thing)

:)

Edited: to avoid duplication:

Here's the latest version of the PB sample app: https://github.com/mjl38/PB_sample_app_QRCodes
And here's the latest version of my Vstudio .net library (and test window form): https://github.com/mjl38/QRCodes
Let me know if you would like me to zip it all and duplicate it on the several posts here.

 

Comment
  1. Mark Goldsmith
  2. Thursday, 28 October 2021 23:09 PM UTC
Lol...not terrorizing at all Miguel, offering sample code is always a good thing. Not sure this is your issue with tiff/ tif but in order to allow for both potential extensions try case "tiff": case "tif": on one line (more concise since they require same image format) or you could separate them out, each having their own case-break section.
  1. Helpful 1
  1. Miguel Leeuwe
  2. Thursday, 28 October 2021 23:13 PM UTC
Thanks, great tip!
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 28 October 2021 13:17 PM UTC
  2. PowerBuilder
  3. # 2

I've upload a newer version of both the powerbuilder app and the VS DLL and source code. Files were being kept in a lock, which should have been solved now. Also, I had to apply some encoding to allow for languages like Arabic and Chinese to work correctly.
Still haven't been able to figure out how to make this work correctly with different image formats. Only PNG seems to work correctly.


regards.

 

Edited: to avoid duplication:

Here's the latest version of the PB sample app: https://github.com/mjl38/PB_sample_app_QRCodes
And here's the latest version of my Vstudio .net library (and test window form): https://github.com/mjl38/QRCodes
Let me know if you would like me to zip it all and duplicate it on the several posts here.

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 27 October 2021 16:02 PM UTC
  2. PowerBuilder
  3. # 3

So, I've made a DLL in C# which allows to Encode a text to a QR image file. I've also made a small sample application in pb2019. (you can use 2021).

It also allows to pick a QR image from disk and show the decoded text.

See the attached files.

This is supposed to allow for png, jpg, gif, and bmp formats, but for some reason I can only show the PNG format with success on a pb 2019 p_1 picture control. The picture has been generated, but for some reason it doesn't show. I'll create a ticket for that last bit.

 

Hope it's useful!

regards

Edited: to avoid duplication:

Here's the latest version of the PB sample app: https://github.com/mjl38/PB_sample_app_QRCodes
And here's the latest version of my Vstudio .net library (and test window form): https://github.com/mjl38/QRCodes
Let me know if you would like me to zip it all and duplicate it on the several posts here.

 

Comment
  1. Miguel Leeuwe
  2. Wednesday, 27 October 2021 16:06 PM UTC
I'm a noob in C# .net, but this is where I got my information from, it's pretty straightforward:



part I: https://www.youtube.com/watch?v=Ot3ZJJtHgzw

part II: https://www.youtube.com/watch?v=9BY-yannNRQ

part III: https://www.youtube.com/watch?v=aR6N19bLZlY&t=10s
  1. Helpful 1
  1. SHAMEEM KAKKAD
  2. Sunday, 31 October 2021 10:43 AM UTC
Thanks a lot...........
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 22 October 2021 17:01 PM UTC
  2. PowerBuilder
  3. # 4

For example for you WIA dll, you should create a c# .net framework library.

Then add the following reference:

Then you have to figure out which functions you want to call and how to deal with the unsupported types in powerbuilder.

You write your own function in the .net library that CAN call these functions with unsupported types and call that function from powerbuilder.

Without decent documentation on the WIA that might be quite a job.

If you want, you tell me one function that you want to call and I'll try to give you an example of how to do what I just described above.

regards.

Comment
  1. Miguel Leeuwe
  2. Thursday, 28 October 2021 06:14 AM UTC
No you don't have to wait for this and it's not another link:

My latest answer is already here (on THIS same page, just scroll upwards). It has 2 attachments. One for the Visual studio solution and the DLL creation, and another attachment for the powerbuilder sample application which uses it.

Let me know if any questions.

regards
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 28 October 2021 06:15 AM UTC
(What I'm writing right here is a "comment" to an "answer". An "answer" is all the other stuff on this page.)
  1. Helpful
  1. SHAMEEM KAKKAD
  2. Thursday, 28 October 2021 07:04 AM UTC
OK. Thanks
  1. Helpful
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.