Click here to Skip to main content
15,892,575 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# IPHostEntry Cache??? Pin
leppie21-Aug-04 5:02
leppie21-Aug-04 5:02 
GeneralRe: C# IPHostEntry Cache??? Pin
gman4422-Aug-04 11:25
gman4422-Aug-04 11:25 
GeneralRe: C# IPHostEntry Cache??? Pin
leppie22-Aug-04 11:33
leppie22-Aug-04 11:33 
Questionwhich xml class to use to parse? Pin
vista2720-Aug-04 14:22
vista2720-Aug-04 14:22 
AnswerRe: which xml class to use to parse? Pin
Steven Campbell20-Aug-04 14:59
Steven Campbell20-Aug-04 14:59 
AnswerRe: which xml class to use to parse? Pin
Heath Stewart20-Aug-04 15:12
protectorHeath Stewart20-Aug-04 15:12 
QuestionExposing busines object assemblies to Visual Basic for Applications? Pin
Member 9620-Aug-04 14:21
Member 9620-Aug-04 14:21 
AnswerRe: Exposing busines object assemblies to Visual Basic for Applications? Pin
Heath Stewart20-Aug-04 15:23
protectorHeath Stewart20-Aug-04 15:23 
You should read Exposing .NET Framework Components to COM[^] in the .NET Framework SDK which describes how to expose them to COM. What you won't read about is that you never use auto-generated class interfaces (use ClassInterfaceType.None for the ClassInterfaceAttribute and implement the interface you declared explicitly as the first interface in the list for your COM "coclass"), and always use the GuidAttribute for your assembly (for the typelib ID), your classes (the CLSID for the ones you expose to COM, and your interfaces (the IID). Never change a published interface - always derive from it a new one and implement that as the class interface (or another implemented interface) on the class.

Basically, if you've done COM development (and I don't mean in VB) you've got a pretty good feel for the guidelines. Following them is just as important in the .NET Framework.

Using these concepts, you could actually script your .NET Framework application. You'll need to P/Invoke quite a bit to bootstrap the VBA runtime and provide it the information it requires, but nothing that's too hard. Read Consuming Unmanaged DLL Functions[^] in the .NET Framework SDK, and be sure to read about marshalling for both COM interop and P/Invoke in Interop Marshaling[^]. Understanding both unmanaged and managed data types (like that an unmanaged long is a managed int since both are 32 bits) is important.

There is another way, though. You can let users "script" with managed languages like C# and VB.NET. It's not actually scripting because it's not late-bound like other script languages, but you can write your script and generate an assembly from it. If you design your interface well enough, you could pass some root object (like the Application object in an object model to be scripted, like the Microsoft Office products among many other apps) to the class that encapsulates the user's "script" (the class template you define). Read Generating and Compiling Source Code Dynamically in Multiple Languages[^] in the .NET Framework SDK, and search here at CodeProject for several examples of "engines" (the true engine is the CLR and CodeDom) that use this concept.

 

Software Design Engineer
Developer Division Sustained Engineering, Microsoft
My Articles
GeneralRe: Exposing busines object assemblies to Visual Basic for Applications? Pin
Member 9620-Aug-04 15:29
Member 9620-Aug-04 15:29 
AnswerRe: Exposing busines object assemblies to Visual Basic for Applications? Pin
partyganger20-Aug-04 15:53
partyganger20-Aug-04 15:53 
GeneralRe: Exposing busines object assemblies to Visual Basic for Applications? Pin
Member 9620-Aug-04 15:56
Member 9620-Aug-04 15:56 
GeneralRe: Exposing busines object assemblies to Visual Basic for Applications? Pin
Anonymous21-Aug-04 5:11
Anonymous21-Aug-04 5:11 
GeneralRe: Exposing busines object assemblies to Visual Basic for Applications? Pin
Member 9621-Aug-04 15:24
Member 9621-Aug-04 15:24 
AnswerRe: Exposing busines object assemblies to Visual Basic for Applications? Pin
Nick Parker20-Aug-04 18:58
protectorNick Parker20-Aug-04 18:58 
GeneralRe: Exposing busines object assemblies to Visual Basic for Applications? Pin
Member 9621-Aug-04 3:31
Member 9621-Aug-04 3:31 
Generalmodifying .NET 1.1 projects to 1.0 Pin
fractor20-Aug-04 13:35
fractor20-Aug-04 13:35 
GeneralRe: modifying .NET 1.1 projects to 1.0 Pin
Heath Stewart20-Aug-04 15:07
protectorHeath Stewart20-Aug-04 15:07 
Generalunicode strings Pin
elena1234520-Aug-04 11:18
elena1234520-Aug-04 11:18 
GeneralRe: unicode strings Pin
Heath Stewart20-Aug-04 12:18
protectorHeath Stewart20-Aug-04 12:18 
GeneralCapture Image of a Control (That is off screen) Pin
richie253920-Aug-04 9:46
richie253920-Aug-04 9:46 
GeneralRe: Capture Image of a Control (That is off screen) Pin
Nick Parker20-Aug-04 11:08
protectorNick Parker20-Aug-04 11:08 
GeneralRe: Capture Image of a Control (That is off screen) Pin
Heath Stewart20-Aug-04 12:23
protectorHeath Stewart20-Aug-04 12:23 
GeneralDIT file size Pin
KoalaCowboy20-Aug-04 9:26
KoalaCowboy20-Aug-04 9:26 
GeneralRe: DIT file size Pin
Not Active20-Aug-04 10:10
mentorNot Active20-Aug-04 10:10 
GeneralRe: DIT file size Pin
KoalaCowboy23-Aug-04 5:00
KoalaCowboy23-Aug-04 5:00 

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.