|
WM_LBUTTONUP & WM_RBUTTONUP may help you someway.
"Fear not of those who can kill the body and not the soul, rather fear Him who can kill both body and soul" - Bible
Prakash,
India.
|
|
|
|
|
Hi,
how to generate random. random number value lies between particular range. any one help to me. thanks in advance.
Have A Nice Day!
Murali.M
|
|
|
|
|
int k;
k = rand() / n;
Have A Nice Day!
Murali.M
|
|
|
|
|
|
you can try this
int min=10;
int max=30;
int randno = min + Rand()%(max-min);
"Fear not of those who can kill the body and not the soul, rather fear Him who can kill both body and soul" - Bible
Prakash,
India.
|
|
|
|
|
You'd need to use min + rand()%(max-min+1) , otherwise, 30 would never appear in the result set.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanx
Prakash,
India.
|
|
|
|
|
Hi all,
How I can make a win32 Callback function as a data member of my class?
I tried it making a static function but then i can't acess the data memeber of my class.The callback function is keyboard hook proc function?
<br />
class MyClass<br />
{<br />
static LRESULT CALLBACK MyKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam);<br />
}<br />
<br />
Myclass::MyClass()<br />
{<br />
m_Hook = SetWindowsHookEx(WH_KEYBOARD,MyKeyboardProc,NULL,GetCurrentThreadId());<br />
}<br />
Any idea?
Thanks in advance.
Abhishake
|
|
|
|
|
|
Hi Hspc,
thanks for reply. The link which you have send primarly talks about making the callback function as a static member function of class but what if I want to access the class data members. any pointer to that will be a valuable inputs.
Again thanks in advance,
Abhishake
|
|
|
|
|
the reason it is a static member is obvious if u think about it a little bit ... a callback that u register with the system cannot be duplicated everytime u instantiate a new object of the type ... if it were then which actual function would the system call as the callback?
HTH
"there is no spoon" biz stuff about me
|
|
|
|
|
Hi:
I make a programme based on IWebbrowser, and I want to insert a script to the htmlpage loaded by my programme.(the script maybe looks like:
...
)How could I do?
I find a article "http://www.codeguru.com/ieprogram/HtmlMemory.html" .It tells us how to modify the content of the SCRIPT,but didn't tell how to add to "SCRIPT" tag to the htmlpage.
Thanks
Benben
|
|
|
|
|
You would add a <script> tag just like you would any other tag.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks,
Could you tell me how to add "script" tag? I try IHtmldocement2::createElement, but it doesn't work?
Thanks
Benben
|
|
|
|
|
Hi!
What does &255 do?
I have microseconds in 6 integers, and will place them in a 3 byte unsigned char[3] = {1, 2, 3};
I'm trying to use &255, but it doesn't work so well.
Can someone help me with my problem?
|
|
|
|
|
It's the bitwise AND operator, which in this case, is ANDing with the value 255.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi! I'm new to programming in VC+++, maybe someone here could help me out.Im using an 'InvalidateRect' in my application's 'OnIdle' message handler and it is returning an error.
here is the code :
InvalidateRect( hwnd, NULL, TRUE);
and the error:
hwnd : undeclared identifier
hwnd seems to be a pointer to the main window? do I have to define it?
|
|
|
|
|
mortishroom wrote:
hwnd seems to be a pointer to the main window?
Probably a window handle, rather than a pointer.
mortishroom wrote:
do I have to define it?
Not to pacify the compiler, but it must be declared. At runtime, it must be defined with a valid value.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Are you using MFC or win32, The api that you are calling is of win32.
For win32 api you need to have a valid window handle to send the notification to.
if you are using MFC then first parameter is not required.
In win32 you can use IsWindow(HWND) api to check wheather the hWnd is valid or not.
Since you say you are biggener, You should check in ur code wheather you are creating any window, if so are you storing the pointer somewhere else.
In Windows, The ui are targeted for certain function or api using the windows handle.
Simple speaking you need a valide windows handle to call the above api.
Hope i clear ur problem.
"Fear not of those who can kill the body and not the soul, rather fear Him who can kill both body and soul" - Bible
Prakash,
India.
|
|
|
|
|
Mr.Prakash wrote:
Are you using MFC or win32, The api that you are calling is of win32.
Im using MFC w/the vc++ mfc app wizard.
passing it NULL instead ov hWind worked just fine.
thank you.
|
|
|
|
|
Strange, dont know how it works, I need to go back to books to understand that.
Is it really working the way you are expecting it??
If you dont mind try replaying the NULL with m_hWnd its a predifined window handle in MFC.
"Fear not of those who can kill the body and not the soul, rather fear Him who can kill both body and soul" - Bible
Prakash,
India.
|
|
|
|
|
'm_hWnd' gives me an undeclared identifier error.
Null is working exactly how i expected; and my code refreshes the screen at 90 million mph, causing everything to flicker uncontrollably.
I geuss the next thing i need to learn is about 'frame rate'.
|
|
|
|
|
1. If you pass InvalidateRect(NULL, rect) , it invalidates all application windows. So I don't wonder, that it flickers.
2. Where are you calling the InvalidateRect from? Generally, in MFC you must retrieve a pointer to redrawn window (CWnd* ) and then call CWnd::InvalidateRect(CRect rc, BOOL erase) . You needn't to deal with HWND 's.
Robert-Antonio
"CRAY is the only computer, which runs an endless loop in just 4 hours"
|
|
|
|
|
a pointer? hmm. thanks for the info - I'll have to look into it next time I get a chance.
|
|
|
|
|
You can just use this->Invalidate(TRUE); from within the window you want to repaint's loop.
|
|
|
|