|
You should put all of your drawing stuff inside the OnDraw message handler. OnMouseMove and OnTimer should only change the state of your class and then notify the area should be updated (so that OnDraw will be called).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
what about an underestimated call of Invalidate() ?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
That's contemplated in 'notify the area should be updated'
It is a logical step, implementation details left as exercise.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Ah, i think I understand. If I move my image update function to OnDraw() it should keep everything on the same "Timer". If I try this, how do I get OnDraw() to be called? The timer?
|
|
|
|
|
When you need a re-paint to occur (and hence a call to OnDraw happen) you've to code the sequence
InvalidateRect(NULL);
UpdateWindow();
Please read the related documentation [^], [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: Heh - I should refresh more often...
I suggest you InvalidateRect /UpdateWindow , for the purpose...
Iain Clarke, Warrior Programmer wrote: Great minds think alike:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You need to do a bit of reading of windows stuff.
The OnDraw method is called from the OnPaint hander. That wraps WM_PAINT for you.
To make windows issue a WM_PAINT when next convenient, use InvalidateRect function.
Lastly, to force an update, use the UpdateWindow function.
If you search for those functions on msdn, hopefully how windows works will become clearer.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Ok. I have tried using Invlaidate and UpdateWindow to get a message to prompt the OnDraw function to no avail. I have added these to my OnInitDialog and to the OnTimer functions. If there is nothing drawn to begin with do these functions still work? Thanks to everyone for their timely responses.
|
|
|
|
|
So... OnDraw() is for MDI, OnPaint() SDI . Now all I need is a good hammer/smileyface option for my last 4 posts. Thanks guys.
|
|
|
|
|
It's a little more complex than that (but only a little).
The OS issues a WM_PAINT message. MFC by default uses a message handler called WM_PAINT. (See the OM_WM_PAINT macro).
On a lot of windows, that's as far as it goes. But CView implements a slight fancy version of OnPaint which does the whole BeginPaint / EndPaint functions, and calls a virtual method called OnDraw.
So, assuming you're drawing something in a vew class, forget about OnPaint, and just use OnDraw.
Again, assuming you used a wizard to make your MFC class, it will have given you an OnDraw method ready for you to fill in.
As a bonus, the printing stuff built into MFC also calls your OnDraw method for printing - so one bunch of code, two wins!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
So, if I have an SDI, not a view class, I don't have built in OnDraw functionality. So in order to do what is needed I have to just stick everything that I want drawn with ON_WM_PAINT into OnPaint(). Correct? Sorry for the confuion with OnDraw and OnPaint.
|
|
|
|
|
You need to read your own code better.
SDI = Single Document Interface. You may only have one, but you still have a view.
Look at the classes. One of them will be CxxxxView, and inherit from CView, or CScrollView, or some other view class.
If you have a dialog only application, that's not SDI.
If I'm stull wrong, and you don;t have any classes that inherit from CView, or CDocument, then please tell me how you created your project.
Iain.
(Ok, SDI was also Strategic Defense Initiative, but I doubt you're writing that. If so, refresh issues are not your biggest problem).
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi All,
We are developing one program that capturing items under mouse in different browsers.
We are using IAccessible Interface and AccessibleObjectFromPoint to get the different elements of perticular item under mouse.
Right now we are facing a problem with Google chrome.
Its not giving any information of item under mouse, for example name,value,role ,etc...
Is there any method available to do this in Google Chrome with or without IAccessible?
Thanx in advance.
Jay.
|
|
|
|
|
Hmmm. My demo program here has no problem with Chrome. Take a look.
|
|
|
|
|
Hi Hans,
Thanx for your reply.
As in your given link documentation the code will work for Chrome version 1.
But we want all the information for Chrome version 4,So program failed to find chrome browser running.
To make chrome browser visible for XMSAALibTest exe,We had changed class name of chrome from "Chrome_XPFrame" to "Chrome_WindowImpl_0" in XMSAALibTest program.
And the output is as below for "EnumAllBrowserObjects" button.
XMSAALibTest v1.0
Found Google Chrome browser
Object enumeration started
NAMELESS[window - invisible] {Description: ?, Location: (-31997, -31473, -31947, -31453), Value: ?}
NAMELESS[application - visible,focusable] {Description: ?, Location: (-31997, -31473, -31947, -31453), Value: ?}
NAMELESS[editable text - visible,read only,focusable] {Description: ?, Location: (-31997, -31473, -31947, -31453), Value: ?}
Object enumeration complete
Writing XML to file MSAALib.xml
So we cannot get all information like IE or Firefox in XMSAALibTest.
Do we need to change more things in XMSAALibTest demo program to make XMSAALibTest exe workable for Google chrome version 4?
-Jay
|
|
|
|
|
Have you tried the latest Chrome with any of the other tools I reference in the article?
|
|
|
|
|
yes i tried with all tools and also used tools available from microsoft.
|
|
|
|
|
This sounds like something basic has changed with Chrome. I suggest looking at Usenet/google newsgroups for messages on "IAccessible + Chrome".
Please let us know what you find out.
|
|
|
|
|
hello sirs,
i working one sample application ...when i build the application ..its displaying registry error ...how to solve this problem ..
this is the error message
<br />
error PRJ0050: Failed to register output. Please ensure you have the appropriate permissions to modify the registry. Polygon<br />
thanks
|
|
|
|
|
I suppose the OS is Vista and you are using VS 2005.
You need to be logged as administrator to modify the registry.Try to run Visual Studio as administrator or try to register the library manually with regsvr32.exe .
Life is a stage and we are all actors!
|
|
|
|
|
think about the error message and you will understand what to do. I start VS often with Administrative rights to avoid that error.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
I am unable to load my test.dll using LoadLibrary() API. I get error code 126 (Module not found)using GetLastError().
By Dependency Walker, I have come to know that my test.dll depends on "xerces-c_2_7.dll" and "Xalan-C_1_10.dll". These dlls were already present on the same path as the exe.Still I am getting the error.
So I tried to load both the above mentioned third party dlls using LoadLibrary() which returned handle as 0x10000000. By GetLastError() I am getting error code 6 (Invalid Handle).
Can anyone please guide me on why I am getting the Invalid Handle error?
HINSTANCE hLib = LoadLibrary(_T("Xalan-C_1_10"));
TCHAR szMessage[MAX_PATH];
FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS|
FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
szMessage, MAX_PATH, NULL);
hLib = LoadLibrary(_T("xerces-c_2_7"));
FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS|
FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
szMessage, MAX_PATH, NULL);
|
|
|
|
|
Have you tried this:
HINSTANCE hLib = LoadLibrary(_T("test.dll"));
I noticed that the file extension is missing in your sample code.
|
|
|
|
|
Yes. It is not making any difference.
|
|
|
|