Click here to Skip to main content
15,885,876 members
Home / Discussions / C#
   

C#

 
AnswerRe: Wrong Target set in Desktop shortcut Pin
Richard MacCutchan21-Dec-11 3:06
mveRichard MacCutchan21-Dec-11 3:06 
GeneralRe: Wrong Target set in Desktop shortcut Pin
iamdking21-Dec-11 19:24
iamdking21-Dec-11 19:24 
GeneralRe: Wrong Target set in Desktop shortcut Pin
Richard MacCutchan21-Dec-11 21:56
mveRichard MacCutchan21-Dec-11 21:56 
GeneralRe: Wrong Target set in Desktop shortcut Pin
iamdking21-Dec-11 23:56
iamdking21-Dec-11 23:56 
GeneralRe: Wrong Target set in Desktop shortcut Pin
Richard MacCutchan22-Dec-11 0:55
mveRichard MacCutchan22-Dec-11 0:55 
GeneralRe: Wrong Target set in Desktop shortcut Pin
iamdking22-Dec-11 3:09
iamdking22-Dec-11 3:09 
NewsDirectX.Capture save wmv Pin
is90057james21-Dec-11 0:08
is90057james21-Dec-11 0:08 
Questionobject to intialize and some function call question Pin
Blubbo20-Dec-11 10:04
Blubbo20-Dec-11 10:04 
I have these 5 method objects. These 5 method objects have exactly same function calls. Example as below:

int method = 3;
int result = 0;

Method1 m1 = new Method1();
Method2 m2 = new Method2();
Method3 m3 = new Method3();
Method4 m4 = new Method4();
Method5 m5 = new Method5();

switch (method)
{
case 1: m1.SolveThis(ref int result); break;
case 2: m2.SolveThis(ref int result); break;
case 3: m3.SolveThis(ref int result); break;
case 4: m4.SolveThis(ref int result); break;
case 5: m5.SolveThis(ref int result); break;
}

(inside each m* contains different methods, for the sake of arugment).


Is it possible to do this as below?

Object mm;
int method = 3;
int result = 0;


switch (method)
{
case 1: mm = new Method1; break;
case 2: mm = new Method2; break;
case 3: mm = new Method3; break;
case 4: mm = new Method4; break;
case 5: mm = new Method5; break;
}

mm.SolveThis(ref int result); // this line doesn't see "SolveThis" funtion in .NET.

Anyone have any thoughts?
AnswerRe: object to intialize and some function call question Pin
Luc Pattyn20-Dec-11 10:19
sitebuilderLuc Pattyn20-Dec-11 10:19 
GeneralRe: object to intialize and some function call question Pin
Blubbo21-Dec-11 2:30
Blubbo21-Dec-11 2:30 
AnswerRe: object to intialize and some function call question Pin
Luc Pattyn21-Dec-11 2:55
sitebuilderLuc Pattyn21-Dec-11 2:55 
AnswerRe: object to intialize and some function call question Pin
RobCroll20-Dec-11 10:30
RobCroll20-Dec-11 10:30 
GeneralRe: object to intialize and some function call question Pin
Blubbo21-Dec-11 2:12
Blubbo21-Dec-11 2:12 
AnswerRe: object to intialize and some function call question Pin
SilimSayo20-Dec-11 15:06
SilimSayo20-Dec-11 15:06 
AnswerRe: object to intialize and some function call question Pin
BillWoodruff21-Dec-11 18:21
professionalBillWoodruff21-Dec-11 18:21 
QuestionProblem withhalo effect using .MakeTransparent and .AntiAlias in GDI+ C# Pin
jerute20-Dec-11 7:01
jerute20-Dec-11 7:01 
QuestionMarshalDirectiveException Pin
korrea8020-Dec-11 4:13
korrea8020-Dec-11 4:13 
AnswerRe: MarshalDirectiveException Pin
Richard Andrew x6420-Dec-11 6:39
professionalRichard Andrew x6420-Dec-11 6:39 
GeneralRe: MarshalDirectiveException Pin
korrea8021-Dec-11 0:48
korrea8021-Dec-11 0:48 
QuestionXML Serialization Pin
rk288120-Dec-11 2:42
rk288120-Dec-11 2:42 
AnswerRe: XML Serialization Pin
Subin Mavunkal20-Dec-11 4:39
Subin Mavunkal20-Dec-11 4:39 
GeneralRe: XML Serialization Pin
rk288120-Dec-11 19:35
rk288120-Dec-11 19:35 
AnswerRe: XML Serialization Pin
Eddy Vluggen20-Dec-11 6:30
professionalEddy Vluggen20-Dec-11 6:30 
AnswerRe: XML Serialization Pin
SledgeHammer0120-Dec-11 6:37
SledgeHammer0120-Dec-11 6:37 
GeneralRe: XML Serialization Pin
rk288120-Dec-11 19:54
rk288120-Dec-11 19:54 

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.