Click here to Skip to main content
15,892,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WriteFileEx (I have reposted with pre tags) Pin
noalias___6-Jan-10 7:05
noalias___6-Jan-10 7:05 
AnswerRe: WriteFileEx Pin
noalias___6-Jan-10 7:02
noalias___6-Jan-10 7:02 
GeneralRe: WriteFileEx Pin
Luc Pattyn6-Jan-10 7:12
sitebuilderLuc Pattyn6-Jan-10 7:12 
GeneralRe: WriteFileEx (with inditation) Pin
noalias___6-Jan-10 7:18
noalias___6-Jan-10 7:18 
GeneralRe: WriteFileEx (with inditation) Pin
Richard MacCutchan6-Jan-10 7:37
mveRichard MacCutchan6-Jan-10 7:37 
GeneralRe: WriteFileEx (with inditation) Pin
noalias___6-Jan-10 7:59
noalias___6-Jan-10 7:59 
AnswerRe: WriteFileEx [modified] Please help Pin
cmk6-Jan-10 15:40
cmk6-Jan-10 15:40 
QuestionDifferentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 0:46
Code-o-mat6-Jan-10 0:46 
Hello folks!

This is probably a very simple question i just don't know how to/where to look for the answer...so, i better give you an example:
//I declare two function pointer types:
typedef int(* FUNC_ONE)(int);
typedef int(* FUNC_TWO)(int, int);

//I create two functions with the same name but different parameters
int Func(int x)
{
  return x;
}

int Func(int x, int y)
{
  return x + y;
}

//I create 2 pointers and try to assign them values
FUNC_ONE pFuncOne = Func;
FUNC_TWO pFuncTwo = Func;

My question is: how do i tell the compiler to use the one parameter version of Func when assigning the value to pFuncOne and use the two param version of Func when assigning the value to pFuncTwo. As it is written in the example it passes the first pointer assignment but gives error on the second one as it is trying to assign the first, one parameter version of Func to the FUNC_TWO type pointer too. I wonder, if i explicitly specify the types, like this:
FUNC_ONE pFuncOne = (FUNC_ONE)Func;
FUNC_TWO pFuncTwo = (FUNC_TWO)Func;
will it use the correct function address or will it in both cases use the one parameter version just convert it to FUNC_TWO in the second assignment.
Thanks for any help in advance. Oh, and happy new year to you all!

p.s: i would like to solve this without having to rename the functions.

> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <

AnswerRe: Differentiating 2 methods with the same name for a pointer Pin
Richard MacCutchan6-Jan-10 2:12
mveRichard MacCutchan6-Jan-10 2:12 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 2:15
Code-o-mat6-Jan-10 2:15 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
molesworth6-Jan-10 2:51
molesworth6-Jan-10 2:51 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 3:44
Code-o-mat6-Jan-10 3:44 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Richard MacCutchan6-Jan-10 3:36
mveRichard MacCutchan6-Jan-10 3:36 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 3:47
Code-o-mat6-Jan-10 3:47 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Richard MacCutchan6-Jan-10 3:55
mveRichard MacCutchan6-Jan-10 3:55 
AnswerRe: Differentiating 2 methods with the same name for a pointer Pin
SimonSays6-Jan-10 5:07
SimonSays6-Jan-10 5:07 
AnswerRe: Differentiating 2 methods with the same name for a pointer Pin
Moak6-Jan-10 15:30
Moak6-Jan-10 15:30 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 21:29
Code-o-mat6-Jan-10 21:29 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Moak7-Jan-10 0:32
Moak7-Jan-10 0:32 
QuestionDataBase Pin
jannathali5-Jan-10 22:38
jannathali5-Jan-10 22:38 
AnswerRe: DataBase Pin
_AnsHUMAN_ 5-Jan-10 23:09
_AnsHUMAN_ 5-Jan-10 23:09 
AnswerRe: DataBase Pin
«_Superman_»6-Jan-10 0:26
professional«_Superman_»6-Jan-10 0:26 
QuestionCapturing check/uncheck in checkbox in listcontrol Pin
itkid5-Jan-10 22:16
itkid5-Jan-10 22:16 
AnswerRe: Capturing check/uncheck in checkbox in listcontrol Pin
Naveen5-Jan-10 22:46
Naveen5-Jan-10 22:46 
GeneralRe: Capturing check/uncheck in checkbox in listcontrol Pin
itkid5-Jan-10 22:49
itkid5-Jan-10 22:49 

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.