0

So I created a dll in Microsoft Visual C# 2010 Express and I want to use the dll in PowerBuilder 11.5.
To test, I created a simple sum function in the c# dll, declared it in PowerBuilder using the syntax Function int sum(int x, int y) Library "NETS.dll" in the Global External Functions in PowerBuilder, and called the function when the powerbuilder window opens or when I press a command button but everytime I try running, PowerBuilder says "unknown function name".
Need help.
Thanks

Aaron Bertrand
  • 272,866
  • 37
  • 466
  • 490

2 Answers2

4

You'll have to expose your DLL as a COM object, register it on the system with regasm.exe and use it via and OLEObject and ConnectToNewObject PowerScript function.

Calvin Allen
  • 4,176
  • 4
  • 31
  • 31
2

A C# assembly won't have any exported functions that you can import this way. You can read up on this questiion: Exporting a native C function from a .net DLL? Hope that it will help you!

Community
  • 1
  • 1
Dan Byström
  • 9,067
  • 5
  • 38
  • 68