C language > Expert questions

Net interface from C

(1/2) > >>

TimoVJL:
We have to test this:
https://codingvision.net/calling-a-c-method-from-c-c-native-process

It's also an example to test poide debugging.

EDIT:
Example with MetaHostMin.h and libs and test_dll

frankie:
Hello Timo, this seems interesting.
I have compiled and run it. I got an error 0x80070002 ==> "File not found". I think this refers to the random.dll with the managed code.
I'm too annoyed to compile also the managed right now, but when in mood I'll look for useful codes to run.

Ok I was too curious to see, so I created the DLL and ... it works. That's all.
Now I'll relax, then I'll think to something useful...  ;)

For those who want test it I attach a version compatible with PellesC V11.

frankie:
A hint: replace

--- Code: ---       if (pMetaHost->lpVtbl->GetRuntime(pMetaHost, L"v4.0.30319", &IID_ICLRRuntimeInfo, (LPVOID*)&pRuntimeInfo) == S_OK) {

--- End code ---
with:

--- Code: --- wchar_t pwszVersion[256];
DWORD   pcchVersion = 256;
if (pMetaHost->lpVtbl->GetVersionFromFile(pMetaHost, DLL_TO_RUN, pwszVersion, &pcchVersion) != S_OK)
{
printf("error: .NET version unavailable.\n");
return (1);
}
printf("Managed code will be run under .NET %ls.\n", pwszVersion);
       if (pMetaHost->lpVtbl->GetRuntime(pMetaHost, pwszVersion, &IID_ICLRRuntimeInfo, (LPVOID*)&pRuntimeInfo) == S_OK) {

--- End code ---
This to assure to use the correct runtime version for the assembly.  ;)

John Z:
Checking for understanding  - Is this providing a similar capability to Frankie's fGdiPlusFlat.h for C to use C++ GDI features, in that this allows standard C calls to access system capabilities built for .NET programing ?  So having .NET becomes a little less worthless consumer of my bandwidth and hard disk space  :)

John Z

TimoVJL:
fSDK gives those include / lib for building those examples.

For example, oracle have Oracle.ManagedDataAccess.dll for database connections, dll size is less that 4 Mb and with it is possible to connect to database.
An native oracle libs are from hell, size is horrible, worst database client in the world.

Navigation

[0] Message Index

[#] Next page

Go to full version