Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3042

How to use C# dll?

$
0
0
myDLL.dll was generated from IKVM. Use in C# project is perfectly fine. HOW to: 1. call a static method in C++. in C# code, it is `com.myApp.Initialiser.initialise(object, string, int)` 2. create a new instance in C++. in C# code it is `new com.myApp.requests.MyRequest()` Code: --------- #include "stdafx.h" #include using namespace std; #include #include #include #include typedef void (*Initialise)(void*, std::string, int); int main(){ HINSTANCE myDLL = LoadLibrary(TEXT("myDLL.dll")); HINSTANCE ikvmCoreDLL = LoadLibrary(TEXT("IKVM.OpenJDK.Core.dll")); if(myDLL && ikvmCoreDLL){ cout << "dlls loaded" << endl; //how to do 1 and 2 using myDLL.dll? Initialise ptr = (Initialise) GetProcAddress(myDLL, "initialise"); //not working } return 0; } ---------

Viewing all articles
Browse latest Browse all 3042

Trending Articles