Author Topic: how to pass strings to c# dll from a PB exe  (Read 135 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris Chancellor

  • Newbie
  • *
  • Posts: 7
how to pass strings to c# dll from a PB exe
« on: September 04, 2017, 05:59:05 PM »
Hello

I wish to write a PB program which can call up a C# dll and then able to pass some strings
to this C# dll.   All help such as an example code is much appreciated.

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 3126
  • Gender: Male
    • José Roca Software
Re: how to pass strings to c# dll from a PB exe
« Reply #1 on: September 05, 2017, 04:29:38 AM »
Nine years ago I did a test out of curiosity, but as I don't do .Net programming I didn't do further research.

I remember that we have to host the .NET runtime, load the asembly and create an instance of the wanted .NET class with the CreateInstanceFrom method of the ICLRHost interface and use COM Automation to call the methods of the .NET class.

See: https://code.msdn.microsoft.com/CppHostCLR-e6581ee0/sourcecode?fileId=21953&pathId=641528413

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2397
  • Gender: Male
    • www.zapsolution.com
Re: how to pass strings to c# dll from a PB exe
« Reply #2 on: September 05, 2017, 10:03:19 AM »
Wanting to link PB with a .NET DLL, sounds weird for me.
What is the benefit of using Win32 if you have to mix it with bloated IL...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com