|
as notify() is a member of a class, then it implicitely receives the this pointer as a parameter...
to solve this, declare it like this :
static void notify(TBK_BOOL note);
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
You can't (as you've seen) assign a pointer to a member function to a normal function pointer. A pointer to a member function would look like this:
typedef void (Listener::*)(TBK_BOOL note) NEW_LISTENER_NOTIFICATION_FUNCTION;
To call this pointer you would need more information then with a normal function pointer, you need to supply the this pointer. A call could look like this:
Listener x;<br />
NEW_LISTENER_NOTIFICATION_FUNCTION pFunc = &Listener::notify;<br />
(x.*pFunc)(Some_Value);
The functionality you're after seems more like a delegate then a C++ style member pointer. I believe there is an article on the code project which provides such delegates - but these can only be used from C++.
Steve
|
|
|
|
|
|
It doesn't modify the class but it does access a member variable. I assumed that in the real implementation the function would be more elaborate.
Steve
|
|
|
|
|
|
Hi
I have a dialog based MFC application in which I want to handle an event which occurs when user presses Ctrl+Alt+Del and from Windows Security dialog it select "Lock Computer" button and it locks the computer.
I want to know which event occurs and how to trap this event?
Any help would be strongly appreciated.
Mahesh
|
|
|
|
|
IIRC, you cannot "trap" the SAS (CTRL-ALT-DEL ) due to security reasons.
I am not sure if applications can register (or receive) notification that the system has been locked.
You can also see an earlier post I made about Desktops in http://www.codeproject.com/script/comments/forums.asp?msg=1362087&forumid=1647#xx1362087xx[^].
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Receiving notice when Ctrl+Alt+Del has been pressed will require your own GINA DLL. However, whenever the computer has been locked, see ISensLogon::DisplayLock() .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi David...
Thankx a lot for giving some time to my problem
Isn't there any such message which we receive when it locks computer by pressing "Lock Computer" button. Like we receive "WM_QUERYENDSESSION" when it goes logoff event or shutdown event.
Mahesh
|
|
|
|
|
Amarelia wrote: Isn't there any such message which we receive when it locks computer by pressing "Lock Computer" button.
Perhaps, but I'm unaware of what it might be.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
|
This seems like a Terminal Services solution, rather than a general-purpose one. Yes?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Windows XP actually uses a dumbed down version of Terminal Services (for fast user switching / remote desktop, etc), I just tried it to double check myself and it does work.
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
|
Hi Gavin
Thaknx a lot for u'r kind support.
But this works in Windows Server 2003 and Windows VISTA only.
I need solution for Windows 2000 Professional. Is there any such another functions or something like that?
Mahesh
|
|
|
|
|
Hi,
I am using a tool bar in a dialog box, the problem is that it doesn't have the same look and feel (flat buttons which embose on mouse over) as the toolbars normally have in SDI or MDI application. It Seems that i have placed number of small buttons side by side
Is there any way to make the look & feel of toolbar in Dialog Box same as in SDI or MDI?
I am thinking in the direction of making my tool bar owner drawn but dontt know how to do it. please help me
thanks
Muhammad Azam
|
|
|
|
|
Set this style TBSTYLE_FLAT .
Owner drawn
Jesus Loves
|
|
|
|
|
Using win32 api i have open a word document.In that when u click open to open a document it should open the document only from specified directory.It can be possible or not tell me or tell me some alternate option.
|
|
|
|
|
sundar_mca wrote: In that when u click open to open a document it should open the document only from specified directory.
What exactly are you wanting here?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
template <<typename MYTYPE>> class CClassBase{<br />
...<br />
void Function();<br />
...<br />
};<br />
<br />
class CClassDouble: public CClassBase<<double>>{<br />
...<br />
};
Somewhere, in ANOTHER project file:
CClassDouble x;<br />
x.Function();
this give a link error:
CClassBase<<double>>::Function not find
But if I use the same lines in the same file of the classes declaretion everything works well!
what's wrong??
NOTE read the double << and >> as a single sign (else problems with html code in this forum)
Have a nice code day
|
|
|
|
|
You have to define function in the class definition, not just declare it. i.e.
template <<typename MYTYPE>> class CClassBase{<br />
...<br />
void Function()<br />
{<br />
}<br />
...<br />
};
On compiles that support the export keyword you can't avoid this. Not many do - None of the MSVC compilers do.
Steve
|
|
|
|
|
What a stupid (stupid, stupid, stupid, stupid , stupid ...) bug!!!
Now it works,
thank you
you got a 5!
Have a nice code day
|
|
|
|
|
|
_Russell_ wrote: NOTE read the double << and >> as a single sign (else problems with html code in this forum)
Why not use the < and > symbols located right above the smileys?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Sorry,
I see they only now!
thank you
Have a nice code day
|
|
|
|