Solved

Use CodeDOM to add functionality to a Library class

Posted on 2003-11-13
2
196 Views
Last Modified: 2012-03-15
Howdy everyone!

I've been hanging out with the Aspect Oriented Programming crowd, and they talk about doing runtime weaving where they add fields and functions to an already existing compiled class in the library using CodeDOM. However, I've been unable to find any source code for how this might be done.

I need code that will take an existing class and add functionality to it at runtime.

If a specific example is necessary, I'd like to take the base class Control and add a virtual function with the signature
 int minXSize();

Anyone have a clue how to do this, or if it's possible? The guys in AOP land say they are doing it, but again, I haven't seen any code.

I know this is a tough question, so I'm throwing out the big points.

-Kelly
0
Comment
Question by:kellycoinguy
2 Comments
 
LVL 2

Accepted Solution

by:
dhodge earned 500 total points
ID: 9749763
Did you investigate VSA, I know it's not quite adding a function at run time however with a little rethought it could help.

For example you could add a public function to the base object that simply ran a script in a known place, thus you'd be kind of giving yourself the flexibility to add what ever you want to the code.

I am also very interested in CodeDOM and like you never got anywhere, I have had a little success with Microsoft.Vsa though.
0
 
LVL 1

Author Comment

by:kellycoinguy
ID: 10453476
Thanks for at least trying to answer the question dhodge... I know this is a very tough one.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now