473,395 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

create a class dynamicaly at run-time?

How to create a class dynamicaly at run-time?
Some documentations in MSDN say that it is feasible
using the class "TypeBuilder",but I don't know how to do.
Is there anyone who can help me? Sample code is
appreciated.

Jul 21 '05 #1
3 1698
Hi peter,

Do you want to create a new instance from a class or create a new class and
an instance from it?
If you are interested in the first option then take a look at Activator
Class (Activator.CreateInstance).
If you are interested in the other you might consider using CodeDom.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"peter" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
How to create a class dynamicaly at run-time?
Some documentations in MSDN say that it is feasible
using the class "TypeBuilder",but I don't know how to do.
Is there anyone who can help me? Sample code is
appreciated.

Jul 21 '05 #2
peter <an*******@discussions.microsoft.com> wrote:
How to create a class dynamicaly at run-time?
Some documentations in MSDN say that it is feasible
using the class "TypeBuilder",but I don't know how to do.


Look in the MSDN for TypeBuilder - you'll find there's an example
there.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3
Hi
chek this URL out
http://www.west-wind.com/presentatio...ynamicCode.htm
you'll find good documentation on this one along with a complete working
sample. I used it in my programs no complains yet

Prasanna

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
peter <an*******@discussions.microsoft.com> wrote:
How to create a class dynamicaly at run-time?
Some documentations in MSDN say that it is feasible
using the class "TypeBuilder",but I don't know how to do.


Look in the MSDN for TypeBuilder - you'll find there's an example
there.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jeff Thies | last post by:
I have a number of elements of "some-class". I'd like to change the styles of some-class: from ..some-class{color: red; display: block} to
2
by: Paul | last post by:
I am trying to get a form to dynamicaly add hidden elements. Below is the function I've created, basicaly it loops thru an array and attempts to add those values to a newly created hidden input...
1
by: Daniel | last post by:
How do i dynamicaly load and unload a C# dll at runtime
3
by: minigitoo | last post by:
Hi I try to get dynamicaly all requests made to DB2 I process like this: 1) I stop then start my instance of database in the db2 control center 2) I use : db2 update monitor switches using...
1
by: Roman Muntyanu | last post by:
Hi all, I created resource dll dynamicaly using this code AppDomain curDom = AppDomain.CurrentDomain; AssemblyName myAssemblyName = new AssemblyName(); imagesAssemblyName.Name = "Images";...
2
by: Daniel | last post by:
how to create a gif or png dynamicaly in .aspx and return in response?
2
by: Marc Nederhoff | last post by:
Hi all, Is it possible to add the <link rel="stylesheet"....> dynamicaly. All pages in my site use the same style sheet, and I don't want to add the link manualy because of maintenance. Marc
7
by: moondaddy | last post by:
I want to dynamically create a JavaScript file and cache it on the client for re-use. I know how to write javascript to a web page from the code behind, but I don't know how to actually create a...
12
by: Michael Maes | last post by:
Hello, I have a BaseClass and many Classes which all inherit (directly) from the BaseClass. One of the functions in the BaseClass is to (de)serialize the (inherited) Class to/from disk. ...
0
by: bala | last post by:
hi can anyone tell me how to create crystal report dynamicaly(runtime)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.