Hi Vadim,
Thank you very much for your interest in this strange project idea :)
Well, you suggestion is surely the best for use with managed
environments....
the one I'm trying to do will cooperate with old legacy applications that
already exposes objects in the old scripting strategy. So I can change the
scripting language for a legacy unmanaged application to a new powerful one
(real c#).
My idea to simulate late bound calls is to use the
System.__ComObject.InvokeMethod. So I will inject in the user supplyed code
one class for each named item whit the same name.
Further, these (public) classes, will expose *static* methods or property
named as the ones contained in the original com object. I will do this in
the unmanaged portion of the environment, using the more confortable ( for
me ;) ) ITypeInfo.
[quoted text, click to view] "Vadim Melnik" <vmnews@REMOVETHISdocsultant.com> wrote in message
news:uO6LtQvRDHA.384@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> > Not exactly.... I want to use C# as Script engine, so I create my script
> dll
> > in unmanaged code,and inside it I'm hosting the CLR.
> > ( the objective is to give old applications hosting script engine tu use
> C#
> > instead ov vbscript )
>
> Why do not use VSA to host JScript.NET or VB.NET? C# doesn't support
> built-in late bound calls.
>
> "Visual Studio for Applications Provides Customized Scripting Facilities
for
> Your .NET Project"
>
http://msdn.microsoft.com/msdnmag/issues/02/08/visualstudioforapplications/d efault.aspx
[quoted text, click to view] >
>
> > The problem is that Named Items are COM object, but C# can't directly
> manage
> > them !
>
> Does Marshal.GetIUnknownForObject/Marshal.GetObjectForIUnknown help?
>
>
> > So I read some documentation and I reached this point: Create 'on the
fly'
> > an interop dll for each named item... don't know if it's a good idea...
> tell
> > me your opinion, please :)
>
> Sorry, I didn't understand why do you need interop assembly? From previous
> post, I see old Active Script used for scripting host, and it's COM based.
> Just return IUnknown interface pointer retrieved from C# object inside
> IActiveScriptSite::GetItemInfo implementation.
>
>
> ..
> Regards,
> Vadim.
>
>