1. Gimmy Susan
  2. PowerBuilder
  3. Tuesday, 3 July 2018 12:42 PM UTC
I'm creating a simple assembly with only one method, but something does not work.

1. I created my target ( .NET Assembly)
1.1 I made my method public in the project ( object tab ).
1.2 I did the deployment

2. I created my client pgm in powerbuilder to call the assembly created.

3. I installed the *.msi created. ( in the same directory of client application. It create a BIN folder )


[client Code]
LONG li
oleobject loo_numbers
string ls
loo_numbers = CREATE oleobject
li = loo_numbers.ConnectToNewObject ("amnamespace.n_amdll")
ls = loo_numbers.of_azienda ('01 ')
[end code]


The 'ConnectToNewObject' always returns me -2. Why ?

thank you
Gimmy

p.s.

Project .NET assembly  information:

namespace: amnamespace

​object name: n_amdll

class name: n_amdll

method: of_azienda(string p_az)

 

 

Bruce Armstrong Accepted Answer Pending Moderation
  1. Tuesday, 3 July 2018 14:05 PM UTC
  2. PowerBuilder
  3. # 1

Did you install the assembly in the GAC?

Did you run REGASM on it to create the registry entries needed so that the PowerBuilder app can reference it?

Comment
  1. Gimmy Susan
  2. Wednesday, 4 July 2018 08:09 AM UTC
Hi Bruce,



Ty for your replay,



 



>> Did you install the assembly in the GAC?



No. Is required ? Microsoft says that you must do when you want to share an assembly between different applications. It is not my case.



https://docs.microsoft.com/it-it/dotnet/framework/app-domains/working-with-assemblies-and-the-gac



 



>>Did you run REGASM on it to create the registry entries needed so that the PowerBuilder app can reference it?



if i try i have an error:



C:\Ateikon.Test\a1>regasm amnamespace.dll

Utilità di registrazione assembly di Microsoft .NET Framework versione 4.7.2556.0

per Microsoft .NET Framework versione 4.7.2556.0

Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati.



RegAsm : warning RA0000 : Nessun tipo registrato.



 



 





Any contribution is welcome



 



Gimmy



 

  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.