Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 543099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:30:57+00:00 2026-05-13T10:30:57+00:00

If I am looking to reference a .NET dll from PowerBuilder (10 or 11.5),

  • 0

If I am looking to reference a .NET dll from PowerBuilder (10 or 11.5), which of the following is the best practice?

1) Register the dll as a COM Object, and use the COM Object via an OleObject
2) Upgrade to 11.5, and convert to PB.NET so that I can actually have blocks of C# in the PowerBuilder code
3) Another method

What are some things I should be aware of with these approaches?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:30:57+00:00Added an answer on May 13, 2026 at 10:30 am

    I haven’t done anything with PowerBuilder, but this is the technique we followed (pretty successfully) with a project that could not immediately be migrated from VB6.

    1) We created a shim/facade with COM references to expose the .NET items we needed. (We also specified the GUID’s using attributes so we had complete control over compatibility changes.)

    2) We referenced the COM objects in our VB6 code (as you would in the PowerBuilder code) using the built in object handling (OleObject in your case).

    3) As items were migrated (in our case to C#), they referenced the underlying .NET classes instead of the COM shim. (We tagged the shim with Obsolete tags to ensure that nobody used it accidentally.)

    4) After all references to the shim were migrated, we removed the shim. (We actually did that in two phases. In the first phase, we left the shim in but modified it to throw exceptions and log what information it could about the calls. That way we would have an idea about where any calls to it were being made from. After confirming that there were no problems, the shim was removed in the next phase.)

    The advantage of this to us was that the migration could occur incrementally. We chose not to expose the underlying .NET objects directly because there was still some risk of them changing and we needed the COM interface to be as stable as possible.

    Upgrading to PB.NET is certainly a possibility… but I don’t know how complex that migration will be. You may find the time necessary would make the migration a major project (it certainly would have been for us).

    Other methods which we considered, but rejected as inappropriate for our needs were:

    • Wrapping the .NET components in another application (a “service”) and talking to those components via socket communication.

    • “Shelling out” to utilities using the .NET framework and transferring the information via (for example) a file based mechanism.

    Things to be aware of include:

    • The threading model in use on both sides of the link. (We hosed ourselves at first because one part of the system ran MTA instead of STA – see this question for more information.)

    • What an exception on the .NET side will look like from your application. It may be a very unhelpful “generic” error, and may even appear to be in the caller instead of the .NET code. We added logging on the .NET side which gave a more verbose record of any exception before re-throwing it and letting the caller handle things as best it could.

    I hope this helps. Good Luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 260k
  • Answers 260k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I would guess this is the cause of your problem:… May 13, 2026 at 11:22 am
  • Editorial Team
    Editorial Team added an answer If the content is static like you say, why not… May 13, 2026 at 11:22 am
  • Editorial Team
    Editorial Team added an answer Yes, just tracking the old size in a class field… May 13, 2026 at 11:22 am

Related Questions

I am the CTO and sole developer for my company. I'm getting ready to
In a previous question I mentioned some work with a 3rd party DLL whose
My Bank has givien me the option of using a COM component, Java (JAR)
Using LINQPad, I am trying to test a few snippets with my own C#
I am a newbie to API calls in .NET. I am looking at the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.