PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Brauche kurz Hilfe



AgainsT
04.09.2010, 01:06
Hi,
ich bräuchte ne C++ DLL oder besser das Projekt mit folgendem Code:
Und den Aufruf in die Main...

#include "MSCorEE.h"

void StartTheDotNetRuntime()
{
// Bind to the CLR runtime..
ICLRRuntimeHost *pClrHost = NULL;
HRESULT hr = CorBindToRuntimeEx(
NULL, L"wks", 0, CLSID_CLRRuntimeHost,
IID_ICLRRuntimeHost, (PVOID*)&pClrHost);

// Push the big START button shown above
hr = pClrHost->Start();

// Okay, the CLR is up and running in this (previously native) process.
// Now call a method on our managed C# class library.
DWORD dwRet = 0;
hr = pClrHost->ExecuteInDefaultAppDomain(
L"c:\\PathToYourManagedAssembly\\MyManagedAssembly.d ll",
L"MyNamespace.MyClass", L"MyMethod", L"MyParameter", &dwRet);

// Optionally stop the CLR runtime (we could also leave it running)
hr = pClrHost->Stop();

// Don't forget to clean up.
pClrHost->Release();
}


Ich würds ja selber machen aber ich hab sowas von keine Ahnung von C, dass ich es mittlerweile 2 Stunden versucht hab ohne Erfolg -.-
Wäre nett wenn das jemand eben fertig macht ;)