Author Topic: How to call O2 dll from C#  (Read 138 times)

0 Members and 1 Guest are viewing this topic.

chrisc

  • Newbie
  • *
  • Posts: 30
How to call O2 dll from C#
« on: January 26, 2018, 08:21:02 AM »
I have C# programs that can call powerbasic dll  and that they work very well.

I want to know how C# can call oxygen dll , any sample codes please?
Regards
Chris

Charles Pegge

  • Author
  • *****
  • Posts: 3365
    • Oxygen Basic
Re: How to call O2 dll from C#
« Reply #1 on: January 26, 2018, 10:32:19 AM »
OxygenBasic produces standard dlls.

Here is a demo 32bit standalone dll to try:

Code: [Select]
% dll
% filename "t.dll"
uses rtl32

function greet(s as char) as long, export
print "hello "+s
return 42
end function

chrisc

  • Newbie
  • *
  • Posts: 30
Re: How to call O2 dll from C#
« Reply #2 on: January 26, 2018, 06:03:18 PM »
Thanxx Charles

Do you have a C# code to make the calling ?


John

  • Hero Member
  • *****
  • Posts: 2843
Re: How to call O2 dll from C#
« Reply #3 on: January 26, 2018, 10:26:21 PM »
Quote
Do you have a C# code to make the calling ?

Would you like Charles to make dinner for you as well?  ::)

Aurel

  • Full Member
  • ***
  • Posts: 134
Re: How to call O2 dll from C#
« Reply #4 on: January 26, 2018, 10:42:53 PM »
easy johnny...easy....  ;D


@chris
just found some code in C# or VB.net which call dll.s
something like this:
http://www.dreamincode.net/forums/topic/121314-creating-a-dll-and-using-it-in-your-application/

Charles Pegge

  • Author
  • *****
  • Posts: 3365
    • Oxygen Basic
Re: How to call O2 dll from C#
« Reply #5 on: January 27, 2018, 02:16:02 AM »
I have never used .net but this enquiry might help:

https://stackoverflow.com/questions/16332701/how-to-call-c-dll-in-c-sharp

OxygenBasic does not mangle DLL function names, and does not alter the case of the name,  unless you specify an alias to use.