Click here to Skip to main content
15,916,835 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Printing with MFC without a CView Pin
Antti Keskinen29-Jan-04 10:25
Antti Keskinen29-Jan-04 10:25 
GeneralQuestion on VC++ and MS Word Pin
skinnyreptile29-Jan-04 9:39
skinnyreptile29-Jan-04 9:39 
GeneralRe: Question on VC++ and MS Word Pin
basementman30-Jan-04 10:25
basementman30-Jan-04 10:25 
QuestionOutlook 2003 contact like grid control? Pin
Joe Woodbury29-Jan-04 9:35
professionalJoe Woodbury29-Jan-04 9:35 
AnswerRe: Outlook 2003 contact like grid control? Pin
Antti Keskinen29-Jan-04 10:29
Antti Keskinen29-Jan-04 10:29 
GeneralRe: Outlook 2003 contact like grid control? Pin
Joe Woodbury29-Jan-04 11:11
professionalJoe Woodbury29-Jan-04 11:11 
AnswerRe: Outlook 2003 contact like grid control? Pin
Ivor S. Sargoytchev29-Jan-04 11:32
Ivor S. Sargoytchev29-Jan-04 11:32 
GeneralPassing WndProc as a method parameter (Function Pointers Pin
Senkwe Chanda29-Jan-04 9:18
Senkwe Chanda29-Jan-04 9:18 
Hi guys, I have a question about function pointer passsing. The following
code is the beginnings of a Win32 app.

////////////////////////////////////////////////////<br />
main.cpp<br />
////////////////////////////////////////////////////<br />
<br />
#include "windows.h"<br />
#include "classOne.h"<br />
<br />
<br />
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)<br />
{<br />
	//empty for code clarity<br />
	return 0;<br />
}<br />
<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,<br />
	LPSTR lpCmdLine, int nCmdShow)<br />
{<br />
	Nothing n(WndProc);<br />
<br />
	return 0;<br />
}



As you can see, all I'm trying to do is pass the WndProc function as
a parameter to the constructor of a class called Nothing.


////////////////////////////////////////////////////////<br />
Nothing.h<br />
////////////////////////////////////////////////////////<br />
<br />
#include "windows.h"<br />
<br />
class Nothing<br />
{<br />
public:<br />
	Nothing(WNDPROC wndProc);<br />
};



////////////////////////////////////////////////////////<br />
Nothing.cpp<br />
////////////////////////////////////////////////////////<br />
<br />
#include "classOne.h"<br />
Nothing::Nothing(WNDPROC wndProc)<br />
{<br />
	int kk = 0;<br />
}



Well my question is, why is it that when I step into the constructor of
the "Nothing" class, wndProc appears to have a different address than
the one I passed in? For the life of me I can't see why this is the case as
WndProc is typedef'd as LRESULT (*WNDPROC)(HWND, UINT, WPARAM, LPARAM)

I'm sure that if I go any further, I'm likely to get an error for example,
when I use that address to initialize and register a window class.

Any hints??

Woke up this morning...and got myself a blog
GeneralRe: Passing WndProc as a method parameter (Function Pointers Pin
Antti Keskinen29-Jan-04 10:57
Antti Keskinen29-Jan-04 10:57 
Questioncan i use two projects in one work space ,, how ??? Pin
Zeeshan Bilal29-Jan-04 8:45
Zeeshan Bilal29-Jan-04 8:45 
AnswerRe: can i use two projects in one work space ,, how ??? Pin
Antti Keskinen29-Jan-04 11:06
Antti Keskinen29-Jan-04 11:06 
AnswerRe: can i use two projects in one work space ,, how ??? Pin
Mukkie29-Jan-04 11:07
Mukkie29-Jan-04 11:07 
Questioni want to send my char array of 1 MB through CSocket .. it Contains Sound data. How i typecast it or ,,,,,? Pin
Anonymous29-Jan-04 8:41
Anonymous29-Jan-04 8:41 
AnswerRe: i want to send my char array of 1 MB through CSocket .. it Contains Sound data. How i typecast it or ,,,,,? Pin
Dean Goodman29-Jan-04 8:56
Dean Goodman29-Jan-04 8:56 
GeneralProblem with ListCtrl on Windows 98 Pin
Brigg Thorp29-Jan-04 8:31
Brigg Thorp29-Jan-04 8:31 
GeneralRe: Problem with ListCtrl on Windows 98 Pin
Nick Nougat30-Jan-04 5:15
Nick Nougat30-Jan-04 5:15 
GeneralMDI question.. Pin
RobJones29-Jan-04 8:14
RobJones29-Jan-04 8:14 
GeneralNever Mind.. Figured it out.. Pin
RobJones29-Jan-04 8:24
RobJones29-Jan-04 8:24 
GeneralLink Error LNK2019 which makes no sense! Pin
bneacetp29-Jan-04 7:33
bneacetp29-Jan-04 7:33 
GeneralRe: Link Error LNK2019 which makes no sense! Pin
ZoogieZork29-Jan-04 8:58
ZoogieZork29-Jan-04 8:58 
GeneralRe: Link Error LNK2019 which makes no sense! Pin
bneacetp29-Jan-04 10:04
bneacetp29-Jan-04 10:04 
GeneralVS.Net2k3 prob: links, but doesn't create .lib Pin
Steve The Plant29-Jan-04 6:52
Steve The Plant29-Jan-04 6:52 
GeneralRe: VS.Net2k3 prob: links, but doesn't create .lib Pin
Dean Goodman29-Jan-04 8:16
Dean Goodman29-Jan-04 8:16 
GeneralRe: VS.Net2k3 prob: links, but doesn't create .lib Pin
Steve The Plant29-Jan-04 8:25
Steve The Plant29-Jan-04 8:25 
GeneralRe: VS.Net2k3 prob: links, but doesn't create .lib Pin
Antti Keskinen29-Jan-04 11:23
Antti Keskinen29-Jan-04 11:23 

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.