
Anyways, I've been programming in C# now, but because I use PureBASIC for some of my functions that I can't translate to C# still, I figured someone could be interested in running their PB DLLs in C#, so here it goes:
MyDLL.pb:
Code: Select all
ProcedureDLL show_message()
ProcedureReturn Ansi2Uni("This is a test")
EndProcedure
Code: Select all
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
using System.Text;
using System.Diagnostics;
namespace ConsoleApplication1
{
class Program
{
[STAThread]
[DllImport("MyDLL.dll", CharSet = CharSet.Auto)]
public static extern string show_message();
static void Main(string[] args)
{
Console.WriteLine(show_message());
Console.ReadLine();
}
}
}
Yay
