Click here to Skip to main content
15,886,963 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: explicit keyword Pin
George_George10-Dec-07 20:24
George_George10-Dec-07 20:24 
GeneralMore info Pin
Vince Rojas10-Dec-07 19:42
Vince Rojas10-Dec-07 19:42 
GeneralRe: More info Pin
George_George10-Dec-07 20:23
George_George10-Dec-07 20:23 
GeneralRe: explicit keyword Pin
Cedric Moonen10-Dec-07 21:00
Cedric Moonen10-Dec-07 21:00 
GeneralRe: explicit keyword Pin
George_George10-Dec-07 21:10
George_George10-Dec-07 21:10 
GeneralRe: explicit keyword Pin
Cedric Moonen10-Dec-07 21:17
Cedric Moonen10-Dec-07 21:17 
GeneralRe: explicit keyword Pin
George_George10-Dec-07 21:33
George_George10-Dec-07 21:33 
GeneralRe: explicit keyword Pin
Nelek10-Dec-07 23:36
protectorNelek10-Dec-07 23:36 
It is quite clear (or I think so)

Imagine that you derive your CMyString from CString and it can receive a CString as entry parameter, but you have added some funcionality to the derived class by overloading. If you use:

CString strTemp = otherClass.strParameter;
MyFunction (strTemp);


The compiler won't maybe complain, but in the release version you have a bad running result because you are using the added methode inside MyFunction and the CString doesn't have it.

If you force the user by declaring explicit, then the compiler should complain. So it will be needed to use insteads:

CString strTemp = otherClass.strParameter;
MyFunction (CMyString (strTemp));


or

MyFunction (CMyString (otherClass.strParameter));


you will use the data that are comming from the string of otherClass.strParameter but you will be able to use your overloaded/added methodes in CMyString.

The use of that, as cedric already said, Libraries, Dlls that are going to be used by anyone (in example).

Or have I understood you false, cedric?

Greetings.
--------
M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

GeneralRe: explicit keyword Pin
George_George11-Dec-07 0:14
George_George11-Dec-07 0:14 
GeneralRe: explicit keyword Pin
Nelek11-Dec-07 1:23
protectorNelek11-Dec-07 1:23 
GeneralRe: explicit keyword Pin
George_George11-Dec-07 1:41
George_George11-Dec-07 1:41 
GeneralRe: explicit keyword Pin
Nelek10-Dec-07 23:27
protectorNelek10-Dec-07 23:27 
Questionhow to use MFC data Types in win 32 dll Pin
kmani_soft10-Dec-07 18:57
kmani_soft10-Dec-07 18:57 
AnswerRe: how to use MFC data Types in win 32 dll Pin
CPallini10-Dec-07 22:37
mveCPallini10-Dec-07 22:37 
AnswerRe: how to use MFC data Types in win 32 dll Pin
Mark Salsbery11-Dec-07 6:23
Mark Salsbery11-Dec-07 6:23 
Generalstring array v.s. int array Pin
George_George10-Dec-07 18:51
George_George10-Dec-07 18:51 
GeneralRe: string array v.s. int array Pin
Doc Lobster10-Dec-07 22:10
Doc Lobster10-Dec-07 22:10 
GeneralRe: string array v.s. int array Pin
George_George10-Dec-07 22:33
George_George10-Dec-07 22:33 
GeneralRe: string array v.s. int array Pin
CPallini10-Dec-07 22:21
mveCPallini10-Dec-07 22:21 
GeneralRe: string array v.s. int array Pin
George_George10-Dec-07 22:40
George_George10-Dec-07 22:40 
GeneralRe: string array v.s. int array [modified] Pin
CPallini10-Dec-07 22:51
mveCPallini10-Dec-07 22:51 
GeneralRe: string array v.s. int array Pin
George_George10-Dec-07 23:15
George_George10-Dec-07 23:15 
GeneralRe: string array v.s. int array Pin
CPallini10-Dec-07 23:41
mveCPallini10-Dec-07 23:41 
GeneralRe: string array v.s. int array Pin
George_George11-Dec-07 1:54
George_George11-Dec-07 1:54 
GeneralRe: string array v.s. int array Pin
CPallini11-Dec-07 2:11
mveCPallini11-Dec-07 2:11 

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.