Click here to Skip to main content
15,929,025 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: check disk API Pin
Iain Clarke, Warrior Programmer28-Jul-09 23:38
Iain Clarke, Warrior Programmer28-Jul-09 23:38 
Questionobtain minimum allowed new User ID from a table by SQL Pin
includeh1028-Jul-09 17:04
includeh1028-Jul-09 17:04 
AnswerRe: obtain minimum allowed new User ID from a table by SQL Pin
_AnsHUMAN_ 28-Jul-09 18:36
_AnsHUMAN_ 28-Jul-09 18:36 
Questionhow to capture the URL of the image Pin
shi baoshi28-Jul-09 16:55
shi baoshi28-Jul-09 16:55 
AnswerRe: how to capture the URL of the image Pin
shi baoshi28-Jul-09 21:26
shi baoshi28-Jul-09 21:26 
GeneralRe: how to capture the URL of the image [modified] Pin
Code-o-mat28-Jul-09 21:49
Code-o-mat28-Jul-09 21:49 
GeneralRe: how to capture the URL of the image Pin
shi baoshi29-Jul-09 3:14
shi baoshi29-Jul-09 3:14 
GeneralRe: how to capture the URL of the image Pin
Code-o-mat29-Jul-09 3:28
Code-o-mat29-Jul-09 3:28 
GeneralRe: how to capture the URL of the image [modified] Pin
shi baoshi29-Jul-09 3:51
shi baoshi29-Jul-09 3:51 
AnswerRe: how to capture the URL of the image Pin
Rozis29-Jul-09 10:37
Rozis29-Jul-09 10:37 
GeneralRe: how to capture the URL of the image [modified] Pin
shi baoshi30-Jul-09 4:19
shi baoshi30-Jul-09 4:19 
Questionneed a class for generating security file Pin
includeh1028-Jul-09 16:29
includeh1028-Jul-09 16:29 
AnswerRe: need a class for generating security file Pin
«_Superman_»28-Jul-09 16:35
professional«_Superman_»28-Jul-09 16:35 
GeneralRe: need a class for generating security file Pin
includeh1028-Jul-09 16:55
includeh1028-Jul-09 16:55 
QuestionCTime and time zone calculations Pin
john john mackey28-Jul-09 13:25
john john mackey28-Jul-09 13:25 
AnswerRe: CTime and time zone calculations Pin
David Crow29-Jul-09 2:51
David Crow29-Jul-09 2:51 
QuestionVector C++ Pin
resolvequestion28-Jul-09 12:23
resolvequestion28-Jul-09 12:23 
AnswerRe: Vector C++ Pin
David Crow29-Jul-09 2:53
David Crow29-Jul-09 2:53 
QuestionOverloaded functions - best approach Pin
john john mackey28-Jul-09 11:57
john john mackey28-Jul-09 11:57 
AnswerRe: Overloaded functions - best approach Pin
Rick York28-Jul-09 15:04
mveRick York28-Jul-09 15:04 
AnswerRe: Overloaded functions - best approach Pin
«_Superman_»28-Jul-09 16:37
professional«_Superman_»28-Jul-09 16:37 
GeneralRe: Overloaded functions - best approach Pin
john john mackey29-Jul-09 6:31
john john mackey29-Jul-09 6:31 
AnswerRe: Overloaded functions - best approach Pin
KarstenK28-Jul-09 21:07
mveKarstenK28-Jul-09 21:07 
AnswerRe: Overloaded functions - best approach Pin
Iain Clarke, Warrior Programmer28-Jul-09 23:57
Iain Clarke, Warrior Programmer28-Jul-09 23:57 
Erm, I may be a bit thick...

But to read your post:


john john mackey wrote:
CMyClassA
bool GetAbsTime(SYSTEMTIME *startTime, double hourTime, ClockTime *absTime);
...
CMyClassB
bool GetAbsTime(SYSTEMTIME *realWorldTime, double hourTime, ClockTime *absTime);
...


You have two classes, and they have method that have the same name. So what? I can do the following if I like:
CCorrect
{
public:
    UINT HowCoolIsIain () { return 99; }
};
CWrong {
public:
    UINT HowCoolIsIain () { return 1; }
};

main ()
{
  CCorrect answer1l;
  CWrong answer1l;

  cout << answer1.HowCoolIsIain ();
  cout << answer2.HowCoolIsIain ();
}


This is not operator overloading. I could have called those two functions Alive and Bob, and it would have generated the same machine code. Done the same thing... It can be handy doing this sort of thing - many of my classes have a GetSize () method for how large they'd be if stored on the hard disk, etc.

Iain.

I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]

GeneralRe: Overloaded functions - best approach Pin
john john mackey29-Jul-09 6:25
john john mackey29-Jul-09 6:25 

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.