On 13 avr, 15:08, timor.su...@gmail.com wrote:
> Hi all,
>
[quoted text clipped - 20 lines]
>
> S.
Let me add some information, if i try with System.Random that is part
of mscorlib
this :
hr =
ClrCreateManagedInstance(L"System.Random,mscorlib,PublicKeyToken=b03f5f7f11d50a3a",
IID_IManagedObject, (void**)&pWrap);
is working :)
but if i try with my own assembly :
hr = ClrCreateManagedInstance(L"MyAssembly.Class1,MyAssembly",
IID_IDispatch, (void**)&pDisp);
i have the hresult : E_NOINTERFACE value
Nb : my assembly isn't strong signed
Thanks for your answer
Ben Voigt - 13 Apr 2007 20:38 GMT
> On 13 avr, 15:08, timor.su...@gmail.com wrote:
>> Hi all,
[quoted text clipped - 34 lines]
> hr = ClrCreateManagedInstance(L"MyAssembly.Class1,MyAssembly",
> IID_IDispatch, (void**)&pDisp);
What compiler version is your assembly built with? Did you call
CorBindToRuntimeEx? If not, the documentation indicates that the .NET 1.0
runtime gets loaded and you won't be able to load newer assemblies.
> i have the hresult : E_NOINTERFACE value
>
> Nb : my assembly isn't strong signed
>
> Thanks for your answer
Ben Voigt - 13 Apr 2007 20:41 GMT
> On 13 avr, 15:08, timor.su...@gmail.com wrote:
>> Hi all,
[quoted text clipped - 34 lines]
> hr = ClrCreateManagedInstance(L"MyAssembly.Class1,MyAssembly",
> IID_IDispatch, (void**)&pDisp);
Maybe ClrCreateManagedInstance doesn't load the assembly for you. Try
loading System.Reflection.Assembly from mscorlib, and call Assembly.Load.
See http://msdn2.microsoft.com/en-us/library/y6k08yft(VS.80).aspx
> i have the hresult : E_NOINTERFACE value
Have you set the COMVisibleAttribute on your class?
> Nb : my assembly isn't strong signed
>
> Thanks for your answer
> Hi all,
>
[quoted text clipped - 20 lines]
>
> S.
You can't instantiate S.W.F.MessageBox, because it has a private constructor
:-)
Marcus