Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using a C DLL in a C# Application... Pin
Judah Gabriel Himango23-Mar-06 7:08
sponsorJudah Gabriel Himango23-Mar-06 7:08 
Questionupload file to the server c# win form Pin
fady_sayegh23-Mar-06 5:57
fady_sayegh23-Mar-06 5:57 
QuestionUserSettings in VS 2005, how they serialize? Pin
TigerNinja_23-Mar-06 4:49
TigerNinja_23-Mar-06 4:49 
AnswerRe: UserSettings in VS 2005, how they serialize? Pin
TigerNinja_23-Mar-06 5:28
TigerNinja_23-Mar-06 5:28 
QuestionRelay information back to parent window. Pin
zaboboa23-Mar-06 4:01
zaboboa23-Mar-06 4:01 
AnswerRe: Relay information back to parent window. Pin
LongRange.Shooter23-Mar-06 4:22
LongRange.Shooter23-Mar-06 4:22 
GeneralRe: Relay information back to parent window. Pin
zaboboa23-Mar-06 4:32
zaboboa23-Mar-06 4:32 
Questioncasting an abstract class to a subclass Pin
gregbowe23-Mar-06 3:53
gregbowe23-Mar-06 3:53 
I have created an abstract class called "BASE", that will have 10-20 subclasses. In a config file I will have pairings of MessageIDs and subclass names. MessageID is a custom identifier for the message type. So my config will look like this:
1,TestApp.subClassSample
2,TestApp2.NewSubclass
3,TestApp2.OldSubClass

In pseudo-code, I want my code to work like this
BASE b = null;<br />
string classname = getMessageIdsClass(2) ; // 2 will eventually be passed in runtime<br />
//so classname is now "TestApp2.NewSubclass"<br />
b = new classname; // this line is junk<br />
b.SomeFunctionInAbstractClass();<br />


b = new classname obviuosly is not valid. I can create a Type object based on the string, but can't figure out how to cast BASE to the subclass.

Any thoughts would be appreciated!



Greg
AnswerRe: casting an abstract class to a subclass Pin
Stefan Troschuetz23-Mar-06 4:04
Stefan Troschuetz23-Mar-06 4:04 
GeneralRe: casting an abstract class to a subclass Pin
gregbowe23-Mar-06 4:29
gregbowe23-Mar-06 4:29 
GeneralRe: casting an abstract class to a subclass Pin
J4amieC23-Mar-06 4:47
J4amieC23-Mar-06 4:47 
GeneralRe: casting an abstract class to a subclass Pin
gregbowe23-Mar-06 5:17
gregbowe23-Mar-06 5:17 
GeneralRe: casting an abstract class to a subclass Pin
Stefan Troschuetz23-Mar-06 4:59
Stefan Troschuetz23-Mar-06 4:59 
QuestionPLEASE HELP ME IN THIS PROBLEM Pin
snouto23-Mar-06 3:00
snouto23-Mar-06 3:00 
AnswerRe: PLEASE HELP ME IN THIS PROBLEM Pin
leppie23-Mar-06 9:41
leppie23-Mar-06 9:41 
QuestionOutlook Pin
Talktorajeev23-Mar-06 2:46
Talktorajeev23-Mar-06 2:46 
AnswerRe: Outlook Pin
Judah Gabriel Himango23-Mar-06 6:11
sponsorJudah Gabriel Himango23-Mar-06 6:11 
GeneralRe: Outlook Pin
Talktorajeev23-Mar-06 16:13
Talktorajeev23-Mar-06 16:13 
GeneralRe: Outlook Pin
Judah Gabriel Himango23-Mar-06 16:30
sponsorJudah Gabriel Himango23-Mar-06 16:30 
QuestionPlease see this problem..... Pin
sam_g123-Mar-06 1:08
sam_g123-Mar-06 1:08 
AnswerRe: Please see this problem..... Pin
Adiphe23-Mar-06 1:20
Adiphe23-Mar-06 1:20 
GeneralRe: thanks Adiphe Pin
sam_g123-Mar-06 1:38
sam_g123-Mar-06 1:38 
QuestionHelp needed !!!! Pin
Ahmad Mahmoud [candseeme]23-Mar-06 0:53
Ahmad Mahmoud [candseeme]23-Mar-06 0:53 
AnswerRe: Help needed !!!! Pin
mav.northwind23-Mar-06 3:53
mav.northwind23-Mar-06 3:53 
QuestionHow to access unmanaged function in c# Pin
Killer323-Mar-06 0:29
Killer323-Mar-06 0:29 

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.