|
Please show the relevant code-snippet.
(And delete the other, unused, forum posts. Thank you!)
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Already posted this, and tried out <altimage.h> didn't work
anything else you might suggest
|
|
|
|
|
please don't post multiple posts.....
|
|
|
|
|
Hi,
I start first instance of my activex control in IE it works fine, but when i launch another instance of IE that contains my activex control it crashes, does anyone know about it?
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
what i under stood from your question is you have developed an AX in vc++ and using in html right. confirm me i will try to answer.
|
|
|
|
|
Thanks for reply.
chandu004 wrote: you have developed an AX in vc++ and using in html right.
Yes exactly, sorry for vague question.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
You've provided no details so it's hard to say much.
Steve
|
|
|
|
|
As per MSDN is have implemented the method
HRESULT CreateComponentCategory(CATID catid, WCHAR *catDescription)
HRESULT RegisterCLSIDInCategory(REFCLSID clsid, CATID catid)
HRESULT UnRegisterCLSIDInCategory(REFCLSID clsid, CATID catid)
and modified the method
STDAPI DllRegisterServer(void)
STDAPI DllUnregisterServer(void)
My code compile perfectly, but still my ocx show the same warning when i initialize the ocx from my web page.
Can any one help me.
Is any certificate required to do so?
Regards
gr
|
|
|
|
|
HI
Why is my window displaying the previous content after i resize it and draw it completely ????.
Thanx'n'Advance.
|
|
|
|
|
If the window dont have the class styles CS_VREDRAW and CS_HREDRAW, then the window will not be redrawn automatically. Then you have to call the Invalidate to get the window redrawn, in the OnSize().
- NS -
|
|
|
|
|
Thank u.
I am sorry for mentioning it as window. its a dialog box , and i found that
its calling paint immediately after WM_SIZE as its painting the client area,
but the previous content remains at that position.
Once i min/max or send a wm_paint to dialog box the previous content gets disappeared
Thanx'n'Advance
|
|
|
|
|
arshadkc wrote: the previous content remains at that position
I think you are not erasing the background. Can you show me the code in OnPaint and OnEraseBkgnd?
arshadkc wrote: i min/max or send a wm_paint to dialog box the previous content gets disappeared
It is expected, right?
- NS -
|
|
|
|
|
this is what i do.....in paint
CRect rect(10,10,200,200);
this->GetClientRect(&rect);
CPaintDC dc(this);
dc.FillRect(&rect,new CBrush(RGB(255,0,255)));
dc.Rectangle(rect.Width()/2,rect.Height()/2,100,100);
i dnt process WM_SIZE or WM_ERASEBKGND
ya thats what i expect.....
|
|
|
|
|
|
Use UpdateWindow immediately after ShowWindow function which force it to Update its contents.
|
|
|
|
|
Thank u all for replyin
this is what i do.....in paint
CRect rect(10,10,200,200);
this->GetClientRect(&rect);
CPaintDC dc(this);
dc.FillRect(&rect,new CBrush(RGB(255,0,255)));
dc.Rectangle(rect.Width()/2,rect.Height()/2,100,100);
i dnt process WM_SIZE or WM_ERASEBKGND
if WM_SIZE repaints whole client area, why is it not filling the rect coz of which the previous content is displayed... am i correct??
Thanx'n'advnance
|
|
|
|
|
Code is doing exactly what it should do.. what do you want to do buddy ??
|
|
|
|
|
ok
I want to display a rectangle at the middle of dialog box.
for that i
. first fills my whole client area with a particular color
. then i draw a rectangle at the middle of ma client area.
. Now when i maximize my window i get two rectangle's. one at top left and
other at middle.
. so i just want to know why am i gettin the top left rectangle when i maximize.
Hope u got it... may be i am wrong , if wrong please help me...
Thanx'n'advance
|
|
|
|
|
The problem is what I said before. Dialog will not have CS_VREDRAW or CS_HREDRAW styles. So you have to call Invalidate( FALSE ) in the OnSize(). It will solve the issue.
Please note:
arshadkc wrote: dc.FillRect(&rect,new CBrush(RGB(255,0,255)));
This is wrong. The objects will not be deleted.
You can use FillSolidRect for simple fills.
- NS -
|
|
|
|
|
ya i have done it. its working fine. thank u
but what my doubt is if its not calling OnPaint then how whole client area
is filled (ie dc.FillRect(&rect,new CBrush(RGB(255,0,255))???
and thanx for FillSolidRect.
|
|
|
|
|
it getting filled because u have given entire client area as parameter "&rect" which u had retried with GetClientRect() and then you r drawing a rectangle with default WHITE brush so it drawn as white box. WM_SIZE always repaints entire window. if u want only middle rectangle to filled use dc.SelectObject(new Brush) function and then dc.Rectangle() function which will draw rectangle with selected brush.
|
|
|
|
|
It is true that the window is not painted while resizing.
But it will be painted in all other scenarios. That is at the time of creation, when some window moves over it, etc.
Hope you got the idea.
And I found that your code for drawing a rectangle in the centre of the window is not fine.
You may have to update it as,
CPaintDC dc( this );
CRect rect;
GetClientRect( &rect );
dc.FillSolidRect( &rect, RGB( 255, 0, 255 ));
const int nWidth = 100;
const int nHeight = 100;
int nX1 = ( rect.Width() - nWidth ) / 2;
int nY1 = ( rect.Height() - nHeight ) / 2;
dc.Rectangle( nX1, nY1, nX1 + nWidth, nY1 + nHeight );
- NS -
|
|
|
|
|
Actually i am just trying out some Device context functions. i just want to place
a rectangle somewhere middle. anyways thanx for placing it exactly.
But stil i didnt get whats happening.
I feel that a call is made to OnPaint after OnSize thats why its painting
whole client area. According to me after i paint my whole client area i should
not see any previous content. But here its not happening like that.??
Can anyone clear my doubt??
|
|
|
|
|
i don't understand which previous content u r seeing ?? all is new after resize of window.
|
|
|
|
|
ya exactly thats what i want , everything should be new...
this is what happening
. I display a rect(i ll name it "rectA") at center of dialog.
. when i maximize the dialog. i get two rectangle's. One is my previous one
(ie "rectA") at the top left and the other one is at the center.
. what i expect is only one rectangle at center. i dont want "rectA" to be displayed again when i maximize because everything should be cleared.
|
|
|
|