C#(ClassLibrary):
Код: Выделить всё
using System;
using System.Runtime.InteropServices;
namespace helloworld
{
public class Class1
{
[ComVisible(true)]
public string GetMessage()
{
return "Hello, World!";
}
}
}
Код: Выделить всё
Declare PtrSafe Function GetMessage Lib ""C:\Users\Documents\Visual Studio 2015\Projects\helloworld\helloworld\bin\x64\Debug\helloworld.dll"" () As String
Sub CallDLL()
Dim message As String
message = GetMessage()
MsgBox message
End Sub
Подробнее здесь: https://stackoverflow.com/questions/781 ... -error-453
Мобильная версия