directx component prevents windows forms elements from being draw correctly

akuehn3000

Newcomer
Joined
Jan 29, 2004
Messages
18
i´m using a directx device in a panel which is embedded in a windows form
next to some standard windows forms components (textbox, button, etc.).
while i refresh the view of the directx panel (tried with onpaint with
invalidate and with a timer), the standard windows forms components are not
drawn
correctly or lose focus. what can I do to prevent this and still having the
directx panel refreshed often enough to play i.e. a fluent animation?
 
Can you maybe show a screenshot or some sample code that would illustrate the problem you are having? That kind of setup works fine for me.
 
screen1.jpg


As you might see on the pic, when changing selecting another tabpage, its content is not fully drawn because the same time, i suppose, the black area (directx panel) gets redrawn.

currently the directx panel is drawn with onpaint and invalidate. i also tried to let it draw by a timer but the problem remained. all other components except the directx panel are not drawn correctly and lose focus often.
 
I´m not sure if I can reproduce the problem with few code. I´ve solved the problem by putting the redraw method in a single thread.
Now my remaining problem is a problem with the focus of the input.

When using DIrectInput in the DirectX-Panel, do you know how to make it possible that the rest of the form still receives mouse and key events? By setting a cooperative level on directinput I receive an index out of expected range error.
 
You mean you were using controls in multi-threaded environment? Control and not thread safe so you shouldn't do that.

As for DirectInput, you can only set the cooperative level to a form. Im not sure what is the probelm you are describing.
 
it´s not an multithreaded environment. just now I use a thread in the onpaint method of my directx form to repaint it. that´s the only way I managed to let the directx panel redraw without disturbing the rest of the form.

as for the input I used the main form of the application to set the cooperative level. but still it gives me this nasty error.
 
Back
Top