ActiveX And Drawing

Started by
3 comments, last by Antorian 21 years, 9 months ago
I''ve got an activeX class (in Win32 VS6 C++) and inside an OpenGl code that draw a picture. It works perfectly but , i would like to know if it''s possible to refresh my scene everytime I need. I would like my code looks like that: void FunctionAnimate() { ManageWindowMessage(); while(EscKey!=Pressed) { DrawOpenGLScene(); } } And it work until Escape Key is pressed... I did a program that use timer to animate my scene but it doesn''t match with my goal. I would like to know how to get WindowMessage (from Cwnd) and to post them to the system during my loop. If I render all the time the scene it halts windows messages and the Iexplorer window doesn''t refresh or move etc... Can someone help me? Sorry for my poor English.
I''m 4 & I draw
Advertisement
the OnDraw method.

override it and then render your vertices.

this method will be called when ever the control needs to be re-drawn.

also you can call refresh to force a draw.

Its my duty, to please that booty ! - John Shaft
Yes I know that OnDraw Method, but It occurs only "when" the control need to be redrawn, I would like to redraw everytime (everyframe) without freezing windows messages management.
If I do OnDraw Method, the animation isn''t self-sufficent and must have an event to evoluate.
I Would like do a loop that always render and animate my scene, and inside let the system manage the systems messages.
It''s like the other way round that I do with onDraw (when mesages occurs I redraw), I must go up to (when I redraw I watch if an event occurs).

But me bay it''s impossible (my knowledge about ActiveX isn''t sufficent).

I would like only get a function that give me the list of event occured and manage them by myself (or posting those I don''t need to the system).

Thx
I''m 4 & I draw
OK, lets see.

Multi-threading is not really possible with ActiveX - has something to do with the threading model. BUT you can actually get an event regularly (for example 20 times per second) and then redraw the anvas everytime you receive the event.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
RegardsThomas TomiczekTHONA Consulting Ltd.(Microsoft MVP C#/.NET)
Yes that was I''ve supposed to be, (using a timer and refresh canvas when OnTimer event occurs)
But I still thinking that it remain a method (like PeekMessage, TranslateMessage, Dispatch Message that is equivalent for CWnd object)
Still searching for that (and I will test your method with event occurence with Timer)

But I wish I can understand how works peekmessage and if it matches with Cwnd

Thx

I''''m 4 & I draw
I''m 4 & I draw

This topic is closed to new replies.

Advertisement