1. Andres Slachevsky
  2. PowerBuilder
  3. Monday, 22 April 2019 14:40 PM UTC

Hello All,

i'm following this link:
http://brucearmstrong.sys-con.com/node/1668463/mobile
we have the component deploy and the regasm returns the following entries 


[HKEY_CLASSES_ROOT\PowerB.PowerB]
@="PowerB.PowerB"

[HKEY_CLASSES_ROOT\PowerB.PowerB\CLSID]
@="{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}"

[HKEY_CLASSES_ROOT\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}]
@="PowerB.PowerB"

[HKEY_CLASSES_ROOT\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="PowerB.PowerB"
"Assembly"="PowerB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v4.0.30319"

[HKEY_CLASSES_ROOT\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}\InprocServer32\1.0.0.0]
"Class"="PowerB.PowerB"
"Assembly"="PowerB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v4.0.30319"

[HKEY_CLASSES_ROOT\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}\ProgId]
@="PowerB.PowerB"

[HKEY_CLASSES_ROOT\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]

I added the following to the .reg file

[HKEY_CLASSES_ROOT\Wow6432Node\PowerB.PowerB]
@="PowerB.PowerB"

[HKEY_CLASSES_ROOT\Wow6432Node\PowerB.PowerB\CLSID]
@="{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}]
@="PowerB.PowerB"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="PowerB.PowerB"
"Assembly"="PowerB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v4.0.30319"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}\InprocServer32\1.0.0.0]
"Class"="PowerB.PowerB"
"Assembly"="PowerB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v4.0.30319"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}\ProgId]
@="PowerB.PowerB"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{02634B32-F2C0-3F73-A1DE-FC65A01F93C0}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]

This is my pbcode

integer li_rc
oleobject cyberark
cyberark = CREATE oleobject
li_rc = cyberark.ConnectToNewObject("PowerB.PowerB")

messagebox("RET",li_rc)

and it return -3

In the object browser i can not see the PowerB com object

Any thing i am doing wrong?

 

Andres Slachevsky Accepted Answer Pending Moderation
  1. Tuesday, 23 April 2019 12:59 PM UTC
  2. PowerBuilder
  3. # 1

Hello All,

i found this article
http://blogs.artinsoft.net/Mrojas/archive/2009/03/03/Calling-NET-from-PowerBuilder.aspx
that explain how to generate the setup file
after install the setup is now working 

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 23 April 2019 16:29 PM UTC
Thanks for letting us know the solution and marking as resolved!
  1. Helpful
There are no comments made yet.
Bruce Armstrong Accepted Answer Pending Moderation
  1. Monday, 22 April 2019 19:33 PM UTC
  2. PowerBuilder
  3. # 2

 

The particular article you're referencing doesn't seem to reference it, but you have to do one of the following in order for PowerBuilder to find the assembly:

1.  Load it into the GAC, which requires that you strong name the assembly.  You would also need to load any assemblies that your assembly references into the GAC as well.

2.  Use the codebase option for REGASM to embed the file location in the registry entries.

3.  Use a manifest file for PowerBuilder and place the assembly in the executable directory.

There are quite a number of articles I wrote on this technique, including a number that reference all these different options. 

 

Comment
  1. Andres Slachevsky
  2. Tuesday, 23 April 2019 12:49 PM UTC
Hello Bruce

Thanks

i was following your document with the REGASM option

I will search for the GAC example
  1. Helpful
  1. Bruce Armstrong
  2. Tuesday, 23 April 2019 15:16 PM UTC
I think you misunderstood what I said.



Unless you are going to use a manifest file, you have to use REGASM to create the COM registry entries. What I was referring to was using the CODEBASE potion with REGASM so that you don't have to load the assembly into the GAC.



If you want to go the GAC approach you can look at the last few paragraphs of this article http://pbdj.sys-con.com/node/2133766?page=0,1



What I would really recommend looking at though is my presentation from Elevate 2018 on "Elevate 2018 - Cross-IDE CSharp Development with PB 2018 Net Assemblies". There's new stuff in there, including information on the Brutal Developer .Net Assembly Strong Name Signer and using PowerShell to do the load into the GAC.



https://www.appeon.com/developers/library/videos/cross-ide-c-development-pb-2018-net-assemblies.html



  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.