Click here to Skip to main content
15,881,803 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionConstructor Pin
Lamos Paul15-Feb-12 13:42
Lamos Paul15-Feb-12 13:42 
AnswerRe: Constructor Pin
Richard Andrew x6415-Feb-12 13:55
professionalRichard Andrew x6415-Feb-12 13:55 
AnswerRe: Constructor Pin
Luc Pattyn20-Feb-12 8:48
sitebuilderLuc Pattyn20-Feb-12 8:48 
Questionerror C2143: syntax error : missing ';' before '*' Pin
Sam Hobbs13-Feb-12 18:56
Sam Hobbs13-Feb-12 18:56 
AnswerRe: error C2143: syntax error : missing ';' before '*' Pin
Richard MacCutchan13-Feb-12 22:34
mveRichard MacCutchan13-Feb-12 22:34 
GeneralRe: error C2143: syntax error : missing ';' before '*' Pin
Sam Hobbs13-Feb-12 23:36
Sam Hobbs13-Feb-12 23:36 
GeneralRe: error C2143: syntax error : missing ';' before '*' Pin
Richard MacCutchan13-Feb-12 23:43
mveRichard MacCutchan13-Feb-12 23:43 
QuestionWhich is better - a long list of potentially null parameters or a Key Value list Pin
Ger Hayden8-Feb-12 4:18
Ger Hayden8-Feb-12 4:18 
I have a simple function to check Totals on any table in my system (and similar ones for deleting and existence)

The parsed SQL is along these
Select Count(*) from AnyTable
Where ColumnA = 1
and  ColumnB = 2

Written in C++/CLI as a command String
Select Count * from {0}
Where {1} = {2}
And {3} = {4}

Alternatively
And ({3} = {4} Or {3} is null}
- This is controlled by an CallArgument driven switch construct.

~The function executing this statement takes the TableName, Column 1, Value 1, Column 2,Value 2 and CallArgument as parameters.

And this all works very well until I find I need a third Key/Value pair so I have to add to the parameters and recompile, amend my dynamic SQL etc.

I am thinking of passing in a list based on a class the members of which will be Key, Value, and NullAction.

Extending the parameter list and switch every time an extra clause has to be checked is a primitve and ugly looking approach by comparison to passing in the list and using a 'for each' loop to add a clause for what ever number of parameters are present.
This new approach has the added benefit of being low maintenance, in as far as possible, future proof.

But is it just style over substance?

Will there be a performance price to pay for passing in a list of key/values over specifiying each pair explicitly in the parameter list, subistuting in nullptr for the ones not required on any given call?

Note NullAction would controll whether or not a column needs to consider Null / not Null in an and / or capacity similar to the example above.
Ger

AnswerRe: Which is better - a long list of potentially null parameters or a Key Value list Pin
Luc Pattyn8-Feb-12 4:28
sitebuilderLuc Pattyn8-Feb-12 4:28 
GeneralRe: Which is better - a long list of potentially null parameters or a Key Value list Pin
Ger Hayden8-Feb-12 7:47
Ger Hayden8-Feb-12 7:47 
AnswerRe: Which is better - a long list of potentially null parameters or a Key Value list Pin
Luc Pattyn8-Feb-12 8:17
sitebuilderLuc Pattyn8-Feb-12 8:17 
GeneralRe: Which is better - a long list of potentially null parameters or a Key Value list Pin
Ger Hayden8-Feb-12 21:46
Ger Hayden8-Feb-12 21:46 
AnswerRe: Which is better - a long list of potentially null parameters or a Key Value list Pin
Philippe Mori19-Feb-12 2:15
Philippe Mori19-Feb-12 2:15 
QuestionDLL Not getting registered Pin
arc.dream2-Feb-12 22:21
arc.dream2-Feb-12 22:21 
AnswerRe: DLL Not getting registered Pin
Wes Aday8-Feb-12 9:41
professionalWes Aday8-Feb-12 9:41 
AnswerRe: DLL Not getting registered Pin
rana ray14-Feb-12 19:07
rana ray14-Feb-12 19:07 
AnswerRe: DLL Not getting registered Pin
Chandrakantt29-Feb-12 6:29
Chandrakantt29-Feb-12 6:29 
QuestionOTS COM elevation problem standard user not seeing debug messages or writing to the registry Pin
Christine_Irene25-Jan-12 9:33
Christine_Irene25-Jan-12 9:33 
QuestionHow can I get /clr support it's giving errors Pin
appollosputnik24-Jan-12 0:58
appollosputnik24-Jan-12 0:58 
AnswerRe: How can I get /clr support it's giving errors Pin
Wes Aday24-Jan-12 3:18
professionalWes Aday24-Jan-12 3:18 
GeneralRe: How can I get /clr support it's giving errors Pin
appollosputnik24-Jan-12 19:59
appollosputnik24-Jan-12 19:59 
GeneralRe: How can I get /clr support it's giving errors Pin
Wes Aday25-Jan-12 3:05
professionalWes Aday25-Jan-12 3:05 
GeneralRe: How can I get /clr support it's giving errors Pin
appollosputnik26-Jan-12 17:35
appollosputnik26-Jan-12 17:35 
GeneralRe: How can I get /clr support it's giving errors Pin
Wes Aday27-Jan-12 3:28
professionalWes Aday27-Jan-12 3:28 
GeneralRe: How can I get /clr support it's giving errors Pin
Wes Aday27-Jan-12 3:51
professionalWes Aday27-Jan-12 3:51 

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.