Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
GeneralDatabinder question Pin
Peter Cresswell12-Jun-03 2:36
Peter Cresswell12-Jun-03 2:36 
GeneralMemory leak woes. Pin
EvilDingo12-Jun-03 2:28
EvilDingo12-Jun-03 2:28 
GeneralRe: Memory leak woes. Pin
Philip Fitzsimons12-Jun-03 3:34
Philip Fitzsimons12-Jun-03 3:34 
GeneralRe: Memory leak woes. Pin
CBoland12-Jun-03 6:35
CBoland12-Jun-03 6:35 
GeneralRe: Memory leak woes. Pin
totig12-Jun-03 22:17
totig12-Jun-03 22:17 
GeneralCreating an instance of type using string litteral Pin
Venkatraman11-Jun-03 23:42
Venkatraman11-Jun-03 23:42 
GeneralRe: Creating an instance of type using string litteral Pin
Rocky Moore12-Jun-03 0:05
Rocky Moore12-Jun-03 0:05 
GeneralRe: Creating an instance of type using string litteral Pin
shaunAustin12-Jun-03 0:12
shaunAustin12-Jun-03 0:12 
You can instantiate a class using a "partial" name... i.e. the type name as a string literal, one way is...

<br />
string path = "MyApp.MyAssembly"; // assembly name<br />
string class = "MyClass"; // class in the assembly <br />
<br />
object MyObj = Assembly.Load(path).CreateInstance(class);<br />


This is most useful when your class implements a known interface but you want to dynamically load the implementation because you can do the following.

<br />
IFooBar fooBar = Assembly.Load(path).CreateInstance(class) as IFooBar<br />


This stuff is my favourite thing about .net... Big Grin | :-D Cool | :cool:

HTH

Shaun Big Grin | :-D

-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!! Big Grin | :-D

GeneralRe: Creating an instance of type using string litteral Pin
Venkatraman12-Jun-03 0:38
Venkatraman12-Jun-03 0:38 
GeneralRe: Creating an instance of type using string litteral Pin
Kannan Kalyanaraman12-Jun-03 0:12
Kannan Kalyanaraman12-Jun-03 0:12 
GeneralRe: Creating an instance of type using string litteral Pin
Venkatraman12-Jun-03 0:19
Venkatraman12-Jun-03 0:19 
GeneralRe: Creating an instance of type using string litteral Pin
CBoland12-Jun-03 6:43
CBoland12-Jun-03 6:43 
GeneralAbout loading an image from resource... Pin
Weiye Chen11-Jun-03 23:22
Weiye Chen11-Jun-03 23:22 
GeneralRe: About loading an image from resource... Pin
Rocky Moore11-Jun-03 23:52
Rocky Moore11-Jun-03 23:52 
General'System.ObjectDisposedException' Pin
dratti11-Jun-03 19:13
dratti11-Jun-03 19:13 
GeneralRe: 'System.ObjectDisposedException' Pin
shaunAustin11-Jun-03 21:49
shaunAustin11-Jun-03 21:49 
GeneralRe: 'System.ObjectDisposedException' Pin
CBoland12-Jun-03 6:49
CBoland12-Jun-03 6:49 
GeneralInputbox Pin
Nick Seng11-Jun-03 17:22
Nick Seng11-Jun-03 17:22 
GeneralRe: Inputbox Pin
Kannan Kalyanaraman11-Jun-03 18:53
Kannan Kalyanaraman11-Jun-03 18:53 
GeneralRe: Inputbox Pin
Nick Seng11-Jun-03 19:57
Nick Seng11-Jun-03 19:57 
QuestionAdd copyright symbol to Label or TextBox, anyone? Pin
Khang Nguyen11-Jun-03 12:54
Khang Nguyen11-Jun-03 12:54 
AnswerRe: Add copyright symbol to Label or TextBox, anyone? Pin
dynamic11-Jun-03 13:39
dynamic11-Jun-03 13:39 
GeneralRe: Add copyright symbol to Label or TextBox, anyone? Pin
Khang Nguyen12-Jun-03 5:02
Khang Nguyen12-Jun-03 5:02 
GeneralC# Excel COM Add-in Pin
Francis B.11-Jun-03 9:32
Francis B.11-Jun-03 9:32 
GeneralRe: C# Excel COM Add-in Pin
Kannan Kalyanaraman11-Jun-03 19:01
Kannan Kalyanaraman11-Jun-03 19:01 

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.