Solved

Use CodeDOM to add functionality to a Library class

Posted on 2003-11-13
2
201 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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