1. Alexander Busch
  2. PowerBuilder
  3. Tuesday, 20 June 2023 10:30 AM UTC

Update: Bug is fixed with PB 2022 R2. pbx 64bit works fine again.

 

Hi,

We have been using Bruce Armstrong's version of the PBNI SMTP module for a number of years and have just started migrating from PB 2021 to PB 2022 (1900).

The 32 bit version seems to be fine, but during our tests we have encountered an error when calling the SMTP module in a 64 bit environment.
The same behaviour applies to Roland's PBNI SMTP module (topwiz).

When running the topwiz-sample app, (and our production environment as well) we are just getting a blank error in powerbuilder – an exception without any further information is thrown, and when the program tries to read the last error message from the PBX, there is nothing in it.

I then started debugging the PBX using Visual Studio and tried to find out where the error might be coming from.

It seems that after the PBX returns, (in the "invoke" function) Visual Studio catches an exception from the Powerbuilder side, pointing at the "PBSHR.dll".
That file seems to be handling OS stuff, and the new version of Powerbuilder added compatibility for Windows 11, so there might be an incompatibility with something on that end. The error does occur on Windows 10 as well, so it is not just a Win11 thing.

Will the modules for 64bit be adapted further or do we have to look for another SMTP solution?

Regards
Alexander B.

Alexander Busch Accepted Answer Pending Moderation
  1. Thursday, 7 December 2023 09:48 AM UTC
  2. PowerBuilder
  3. # 1

Bug is also fixed with PB 2022 R2. pbx 64bit works fine again.

Comment
  1. Armeen Mazda @Appeon
  2. Thursday, 7 December 2023 15:45 PM UTC
Thanks for the update!
  1. Helpful
There are no comments made yet.
Alexander Busch Accepted Answer Pending Moderation
  1. Tuesday, 11 July 2023 15:09 PM UTC
  2. PowerBuilder
  3. # 2

So unfortunately there is no solution for the pbx under 64bit yet. I guess this means we have to wait for PB 2022 R2 and then rewrite our internal SMTP connection. Thanks anyway for the support.

Comment
  1. Miguel Leeuwe
  2. Tuesday, 11 July 2023 16:40 PM UTC
If you cannot wait until R2 comes out, you can write your own solution in a .net DLL and import it into powerbuilder using the DLL importer tool.

This would also give you more control over how things are done and make it more 'future proof' by using "MailKit". There's loads of code snippets our there and it shouldn't be that hard.



regards
  1. Helpful
There are no comments made yet.
Alexander Busch Accepted Answer Pending Moderation
  1. Wednesday, 5 July 2023 11:47 AM UTC
  2. PowerBuilder
  3. # 3

Hi Roland,

I am sorry, but it still does not work with 64bit (32bit works just fine). I used your sample app and get a PBX Exception "Error calling method of a PBNI object" and after that another msg "Send mail error: 0". And yes, I copied the pbx from the 64bit Folder.

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Sunday, 2 July 2023 03:50 AM UTC
  2. PowerBuilder
  3. # 4

I recompiled with the latest version of the third party code:

https://www.topwizprogramming.com/pbnismtp.html

 

Comment
  1. Alexander Busch
  2. Sunday, 2 July 2023 20:25 PM UTC
Hi Roland,

I am sorry, but it still does not work with 64bit (32bit works just fine). I used your sample app and get a PBX Exception "Error calling method of a PBNI object" and after that another msg "Send mail error: 0". And yes, I copied the pbx from the 64bit Folder.
  1. Helpful
  1. Roland Smith
  2. Wednesday, 5 July 2023 13:27 PM UTC
What version of PB are you running it 64bit? If 2022, are you doing it using the 64bit in the IDE option or as an exe of the app?
  1. Helpful
  1. Alexander Busch
  2. Wednesday, 5 July 2023 21:57 PM UTC
I have tested both, the IDE with 64bit setting and the exe
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 21 June 2023 17:47 PM UTC
  2. PowerBuilder
  3. # 5

PowerBuilder 2022 R2 natively supports SMTP email client: https://docs.appeon.com/pb/whats_new/ch01s01s06.html

Comment
  1. Alexander Busch
  2. Thursday, 22 June 2023 07:52 AM UTC
Thanks for the info, it has already been shared by Miguel. Is there a time horizon for the official release of PowerBuilder 2022 R2?

  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 22 June 2023 15:06 PM UTC
HIi Alex;

For right now ... just in the summer of 2023.

Regards ... Chris
  1. Helpful 1
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 20 June 2023 13:22 PM UTC
  2. PowerBuilder
  3. # 6

I noticed that the PBNI interface doesn't have a LongPtr datatype. On another PBNI program I am developing, I have to use LongLong and copy to/from the correct datatype on both ends. None of the functions pass pointers so this isn't the issue.

I'll try to find time to work on it this week.

Comment
  1. Alexander Busch
  2. Tuesday, 20 June 2023 13:28 PM UTC
Hi Roland, thanks for your message and for taking a look, it is much appreciated.
  1. Helpful
  1. Alexander Busch
  2. Saturday, 1 July 2023 06:01 AM UTC
Have you got any news or found out anything yet?
  1. Helpful
There are no comments made yet.
Alexander Busch Accepted Answer Pending Moderation
  1. Tuesday, 20 June 2023 12:49 PM UTC
  2. PowerBuilder
  3. # 7

Yes, we have. And yes, there are different pbx for 32 and 64bit. Both the 32bit from Roland and the 32bit from Bruce (github) work perfectly. The 64bit from Roland and Bruce work perfectly until PB 2021, but no longer with PB 2022.

Comment
  1. Miguel Leeuwe
  2. Tuesday, 20 June 2023 12:54 PM UTC
Hopefully either of them will answer on this post as they are both active on this Q&A.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 20 June 2023 12:30 PM UTC
  2. PowerBuilder
  3. # 8

Have you downloaded the latest version of Roland Smith? https://topwizprogramming.com/pbnismtp.html

I'm not sure but there might be a different PBX file for 64 bit.

Comment
There are no comments made yet.
Alexander Busch Accepted Answer Pending Moderation
  1. Tuesday, 20 June 2023 12:13 PM UTC
  2. PowerBuilder
  3. # 9

Hi Miguel, thank you for your message. The update to PB 2022 R2 is good news. Unfortunately, we don't know when the update will officially come and we have strong pressure from our customers. Most of our customers are no longer allowed to use the c++ 2010 package and it will be uninstalled next week. So we have to quickly create and deliver a new version in PB 2022. This means that customers can only use the 32bit version of our software for the time being, as the PBNI works there.

We have already checked everything for longptr. In addition, the PBNI is not connected like a dll, but is practically pressed into a "user object" with dummy functions, so everything already runs with native powerbuilder types. None of the functions has anything like long or longptr, only integer string and booleans.

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 20 June 2023 11:20 AM UTC
  2. PowerBuilder
  3. # 10

- Most likely some API functions that now need to have a longPtr type variable passed in.

- If you can wait a bit ... PB2022 R2 will incorporate SMTP natively. See https://www.appeon.com/developers/pb2022r2-beta.html For now R2 is still in pre-beta, if I'm not mistaken.

 

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.