Re: C loader of .NET runtime (mscoree.h include errors)

Tech-Archive recommends: Speed Up your PC by fixing your registry



thanks for this precious tidbits of information Willy, will see how it
works....

"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:e7YhRPadFHA.1612@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:uNDkmiVdFHA.1036@xxxxxxxxxxxxxxxxxxxxxxx
>> I'm trying to compile with GCC a very simple .NET loader.
>> (I'm using SDK.NET 2.0 beta 2)
>> the code is attached...
>>
>> Anyway there is an include of <mscoree.h>
>> it produces plenty of error kind of:
>> ../mscoree.h:487: error: syntax error before numeric constant
>> ../mscoree.h:487: warning: data definition has no type or storage class
>>
>> At line 487 there is something like that:
>> EXTERN_GUID(LIBID_mscoree,
>> 0x5477469e,0x83b1,0x11d2,0x8b,0x49,0x00,0xa0,0xc9,0xb7,0xc9,0xc4);
>>
>> Which means nothing to me...
>> Any idea about what the error could be?
>>
>>
>
> The unmanaged hosting API's are still un-documented, your only source of
> info will be the header files in the sdk.
>
> First of, the CLR is loaded/managed through a bunch of COM interfaces,
> ICLRRuntimeHost is such a COM interface, so it requires a pointer
> declaration...
> ICLRRuntimeHost* runtime;
>
> If you look in mscoree.h, you'll see that CorBindToRuntimeEx takes the
> CLRRuntimeHost class id and a interface id as 4th and 5th argument. So
> what you need is this...
>
> hr = CorBindToRuntimeEx(NULL, NULL, 0, CLSID_CLRRuntimeHost,
> IID_ICLRRuntimeHost, (LPVOID*) &runtime);
> ... where runtime is the pointer to the ICLRRuntimeHost interface, all
> methods on this interface must be called using "runtime" as pointer.
>
> Your call to ExecuteApplication has some invalid and the wrong number of
> arguments, and the ExecuteApplication method needs to be called on the
> interface pointer returned by CorBindToRuntimeEx.
>
> Willy.
>
>
>
>


.



Relevant Pages

  • Re: C loader of .NET runtime (mscoree.h include errors)
    ... ICLRRuntimeHost is such a COM interface, so it requires a pointer ... and the ExecuteApplication method needs to be called on the ...
    (microsoft.public.dotnet.framework)
  • Re: C# DLL mittels COM-Interop aus C aufrufen
    ... Have u tried the IDispatch interface, which is used for those language ... which doesnot have capability of maintaining VTables. ... The __cplusplus symbol is defined automatically when you're compiling C ... appropriate function pointer type. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Pointers in derived types, help needed
    ... subroutine/function must have an explicit interface. ... C is not a pointer. ... then probably the best thing to do is use allocatables. ...
    (comp.lang.fortran)
  • Re: Why ABCs make bad Interfaces
    ... > equivalent to an Abstract Base Class (ABC). ... > because it is common practice to implement an interface using ABC's. ... To convert an object to its interface, you return a fat pointer ... The NaiveInt constructor has to set up the vtables, ...
    (comp.object)
  • Re: another COM-Question: how to inject a type-lib into a dll?
    ... > But let me ask just another question on this: If this pointer is ... This is why the object exposes the COM interface in the first ... Make sure SomeObject has a reference count of 1 at this point. ... The declaraion of SomeOtherCOMMethod has a different signature. ...
    (microsoft.public.vc.atl)