Click here to Skip to main content
15,913,669 members
Home / Discussions / C#
   

C#

 
GeneralRe: running scripts inside a c# application Pin
johanna4223-Aug-04 11:57
johanna4223-Aug-04 11:57 
GeneralRe: running scripts inside a c# application Pin
mav.northwind23-Aug-04 22:44
mav.northwind23-Aug-04 22:44 
GeneralThank you! Pin
johanna4224-Aug-04 4:15
johanna4224-Aug-04 4:15 
GeneralRe: Thank you! Pin
Heath Stewart24-Aug-04 7:16
protectorHeath Stewart24-Aug-04 7:16 
GeneralRe: Thank you! Pin
mav.northwind24-Aug-04 21:53
mav.northwind24-Aug-04 21:53 
GeneralRe: Thank you! Pin
Heath Stewart25-Aug-04 11:01
protectorHeath Stewart25-Aug-04 11:01 
GeneralRe: Thank you! Pin
mav.northwind25-Aug-04 20:46
mav.northwind25-Aug-04 20:46 
GeneralRe: Thank you! Pin
Heath Stewart26-Aug-04 7:01
protectorHeath Stewart26-Aug-04 7:01 
I wasn't upset, but tend to get so when people tell me to "calm down".

If IVsaItems.CreateItem (or rather the implement of it) is exposing objects, then it - as I mentioned in my previous post - is marshalling calls from COM to .NET.

Trust me - script revolves and exists solely on automation. Not only do I speak from experience and from what's written in the Platform SDK documentation (among other places), I'm actually working with script source at Microsoft.

The fact is that script wouldn't work without automation. IDispatch is not "deep down" - it is the heart and soul of automation. It - along with ITypeInfo - exposes properties and methods of an object. This provides late-binding to script which calls IDispatch::Invoke with the DISPID of a member (cached or not) along with DISPPARAMS (basically an array of VARIANTs) and other information if necessary.

Every type in an assembly actually has a GUID associated with it. If you use the GuidAttribute, this GUID is fixed instead of assigned at compile time (whether you expose the type to COM or not). It very likely that the implementation of IVsaItems is using that GUID to create objects and to identify the class in order to marshal calls and expose type information (all of which can be easily done thanks to the type metadata).

This still relies on an automation layer, except that you aren't actually registering your coclasses and interfaces, nor a typelib.

Still, you can embed the script host and through the engine expose the objects so long as something is providing a class factory and is marshalling calls.

Scripting your application would only work within your application so long as it provides a root object (like the Application object) from which the OM flows.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles]
GeneralRe: Thank you! Pin
mav.northwind26-Aug-04 20:43
mav.northwind26-Aug-04 20:43 
GeneralRe: running scripts inside a c# application Pin
Steve Maier23-Aug-04 10:06
professionalSteve Maier23-Aug-04 10:06 
Generalneed good (free) editing control Pin
LongRange.Shooter23-Aug-04 7:21
LongRange.Shooter23-Aug-04 7:21 
GeneralRe: need good (free) editing control Pin
Nick Parker23-Aug-04 8:19
protectorNick Parker23-Aug-04 8:19 
GeneralRe: need good (free) editing control Pin
LongRange.Shooter23-Aug-04 8:29
LongRange.Shooter23-Aug-04 8:29 
GeneralRe: need good (free) editing control Pin
Judah Gabriel Himango23-Aug-04 8:39
sponsorJudah Gabriel Himango23-Aug-04 8:39 
GeneralRe: need good (free) editing control Pin
Nick Parker23-Aug-04 9:04
protectorNick Parker23-Aug-04 9:04 
GeneralRe: need good (free) editing control Pin
Nick Parker23-Aug-04 9:01
protectorNick Parker23-Aug-04 9:01 
GeneralRe: need good (free) editing control Pin
LongRange.Shooter23-Aug-04 9:51
LongRange.Shooter23-Aug-04 9:51 
GeneralRe: need good (free) editing control Pin
Heath Stewart23-Aug-04 9:47
protectorHeath Stewart23-Aug-04 9:47 
GeneralRe: need good (free) editing control Pin
Nick Parker23-Aug-04 10:05
protectorNick Parker23-Aug-04 10:05 
GeneralChanging a Password on ActiveDirectory Pin
Colin Angus Mackay23-Aug-04 7:21
Colin Angus Mackay23-Aug-04 7:21 
GeneralRe: Changing a Password on ActiveDirectory Pin
Nick Parker23-Aug-04 8:26
protectorNick Parker23-Aug-04 8:26 
GeneralRe: Changing a Password on ActiveDirectory Pin
Colin Angus Mackay23-Aug-04 11:31
Colin Angus Mackay23-Aug-04 11:31 
GeneralRe: Saving out a picture image Pin
Werdna23-Aug-04 7:21
Werdna23-Aug-04 7:21 
GeneralRe: Saving out a picture image Pin
codemonkey_00123-Aug-04 7:54
codemonkey_00123-Aug-04 7:54 
GeneralRe: Saving out a picture image Pin
Werdna23-Aug-04 8:46
Werdna23-Aug-04 8:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.