1. Alfredo Santibanez
  2. PowerBuilder
  3. Tuesday, 3 March 2020 13:14 PM UTC

Hi

I had to make some changes to a C# DLL due to urgent modifications fron some security required accesing external APIs, after that, the same DLL when running the application from PB IDE responds with error -3.
I also checked for the deployed application in the same dev computer and gives no problem.

I have tried:

  • unregister and register the DLL, with regasm
  • register in framework and framework64
  • review the registry and it finds the DLL when registered
  • run PB as administrator

Code is bellow, it has been working with no problems.  Just that to compile the DLL I needed to exit PB, but that was not a big deal.

PB 12.6

Any hint

 

Best Regards

Alfredo

   

 

int li_rc
    OleObject loo
    
    loo = create oleobject
    li_rc = loo.ConnectToNewObject("CFeldan_FE.ClassMain")
    
    IF li_rc < 0 THEN
        DESTROY loo
        MessageBox("Connecting to COM Object Failed", "Error: " + String(li_rc))
        Return  rc
    END IF
    

CATCH ( OleRuntimeError re )
    loo.DisconnectObject()
    destroy loo
   MessageBox( " error ", re.getMessage() )
END TRY

    li_Rc=loo.EnviarMensaje()

 

 

 

 

 

 

Michael Kramer Accepted Answer Pending Moderation
  1. Tuesday, 3 March 2020 15:53 PM UTC
  2. PowerBuilder
  3. # 1

Hi Alfredo, sorry - Custom App Domains only available in PB 2019 R2.
Customer beta was build #2279 but beta period has ended.
R2 is scheduled to release in the "not too distant future."

Screen shot from help file >>

HTH /Michael

Comment
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Tuesday, 3 March 2020 14:13 PM UTC
  2. PowerBuilder
  3. # 2

Happy to hear you solved it.

Regarding having to restart PB IDE >> "App run" inside the IDE spins up a sub process to IDE's process although assembly is "owned" by the IDE's main process.

.NET interop in PB 2019 R2 can unload assembly when "app run" exits. Enabled using "Custom App Domains".

HTH /Michael

Comment
  1. Alfredo Santibanez
  2. Tuesday, 3 March 2020 14:55 PM UTC
Thanks for your answer. Can you guide a little bit on "Custom App Domains". I do have PB 2019 (2082) Std, but did not find anything about it, Do I need to upgrade or the C# Version?

Alfredo
  1. Helpful
There are no comments made yet.
Alfredo Santibanez Accepted Answer Pending Moderation
  1. Tuesday, 3 March 2020 13:24 PM UTC
  2. PowerBuilder
  3. # 3

Sorry, found the problem.  In the rush of un-noticed requirements I made a copy of the old DLL within my PBL folder, just moved outsided that and not it Works.

I needed a whole to find out.

Thanks

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.