Jump to content
Xtreme .Net Talk

Read dll done in C++ with console F#


Recommended Posts

Guest Metaconta
Posted

I want to make this code in C # console, adapt it to F #.

What it does is read a dll made in C ++.

 

using System;

using System.Runtime.InteropServices;

 

namespace Consola_cs

{

class Program

{

static void Main(string[] args)

{

Console.WriteLine(Marshal.PtrToStringAuto(SUPER_DLL.Mensaje()));

Console.WriteLine(SUPER_DLL.Suma(1764, -764).ToString());

 

// Pulse cualquier tecla para salir.

Console.ReadKey();

}

internal class SUPER_DLL

{

[DllImport("Super_dll.dll")]

extern static public int Suma(int a, int b);

[DllImport("Super_dll.dll")]

extern static public IntPtr Mensaje();

}

}

}

 

 

Thank yoy.

 

 

 

 


 

http://electronica-pic.blogspot.com

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...