![]() | |
| |||||||
| Home | Register | Blogs | FAQ | Members List | Calendar | Downloads | Arcade | Mark Forums Read |
| Languages, Compilers and Interpreters C,C++,C#,.NET,Java,PHP,Perl,SQL and more |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Младенец Join Date: May 2004 Location: pakistan
Posts: 14
Rep Power: 0 Reputation:
10 | Hi: I want to use ::EnumWindows() in MFC. But have a problem in last argument. I want if i click on a button in dialog box ::EnumWindows() API should call. I write this code: void mydialog: nButton1(){ ::EnumWindows((WNDENUMPROC)EnumWindowsProc, LPARAM(this)); } But i have an error message that this operator should not use in global functions. So how i gain last argument, what value of last argument (LPARAM) i pass to this function? Burhan |
| | |
| | #2 |
| Грустно... | Cheat: mydialog * pdialog = this; ::EnumWindows(..., (LPARAM)pdialog);
__________________ http://аvitya.livejournal.com Хотели, как лучше, а получилось даже хуже... Лозунг шахматиста: На каждый шах - ответим матом! |
| | |
| | #3 |
| Administrator | the second parameter in that "EnumWindows()" shold be pointer to some data structure you're willing to fill in by your callback function, say, misc. parameters ot the window you'll find during window enumeration or smth. else. PHP Code:
__________________ И повешенные могут качаться в неположенную сторону. /С.Е.Лец/ |
| | |
| | #4 | |
| Младенец Join Date: May 2004 Location: pakistan
Posts: 14
Rep Power: 0 Reputation:
10 | another Error Quote:
mydialog * pdialog = this; ::EnumWindows(..., (LPARAM)pdialog); But have an error: error C2440: 'type cast' : cannot convert from '' to 'int (__stdcall *)(struct HWND__ *,long)' None of the functions with this name in scope match the target type Any Idea? Burhan | |
| | |
| | #5 | |
| Младенец Join Date: May 2004 Location: pakistan
Posts: 14
Rep Power: 0 Reputation:
10 | Siir i dont want this. Quote:
Sir i dont want to fill 2nd parameter lparam in callback function. I want to know how i call ::EnumWindow() in MFC dialog application. I try to call this function through a button, but i dont know what i pass to 2nd argument (LPARAM) of this function? If u have sample project of this then plz send me. Burhan | |
| | |
| | #6 |
| Грустно... | Teh problem is in the first param. As you can deduce from error message.
__________________ http://аvitya.livejournal.com Хотели, как лучше, а получилось даже хуже... Лозунг шахматиста: На каждый шах - ответим матом! |
| | |
| | #7 |
| Administrator | I've already past-ed the sample function to you. Could you tell me why're you passing "this" ? If you don't need it then pass NULL as a second param. The error appears because your "EnumWindowsProc()" does not appropriate to the expected one. The prototype I've already shown to you, will repeat below: PHP Code:
__________________ И повешенные могут качаться в неположенную сторону. /С.Е.Лец/ |
| | |