Greetings,
I have a C program that is hosting a CLR. It is able to call C# methods. However, I want to be able to have the C# code call the host's C functions too. I can't use DllImport because that would be out of the context of the C call to C#. For example:
C psudo code:
global var X = 4
init CLR
call C# myMeth
myFun() {
printf X;
}
C# psudo code:
myMeth() {
call native myFun()
}
So, C calls C# and then the C# code calls back into the host's myFun in the same context as C's call into C#. Therefore X is still visible. I am running on Linux and happy to use MS or Mono.
Thanks!
area-Interop-coreclr @jeffschwMSFT @AaronRobinsonMSFT @lambdageek
Greetings,
I have a C program that is hosting a CLR. It is able to call C# methods. However, I want to be able to have the C# code call the host's C functions too. I can't use DllImport because that would be out of the context of the C call to C#. For example:
C psudo code:
global var X = 4
init CLR
call C# myMeth
myFun() {
printf X;
}
C# psudo code:
myMeth() {
call native myFun()
}
So, C calls C# and then the C# code calls back into the host's myFun in the same context as C's call into C#. Therefore X is still visible. I am running on Linux and happy to use MS or Mono.
Thanks!
area-Interop-coreclr @jeffschwMSFT @AaronRobinsonMSFT @lambdageek