|
Hi,
In my MDI-Application, a MDI Child "A" opens a new MDI Child "B".
But during the open of the B-Child a lot of ugly visualizations happens.
I can see all this via a "ScreenShot-Video", in SlowMotion i see many movements.
So, i need a SetRedraw(FALSE) before the Opening and a SetRedraw(TRUE) after
the complete initialization of Child "B".
But a SetRedraw is only working on the current CWnd-Objekt, for example only on Child A.
I need a SetRedraw(FALSE) for the entire application.
Before the opening a total-freeze and after the opening a total-release
I hope it exists a possibility
Thanks
|
|
|
|
|
Do you use the OnDraw() function in View "B"? If so, try putting ShowWindow(SW_SHOW); at the top of the function, and ShowWindow(SW_HIDE); at the bottom of it.
[EDIT] Nevermind, that won't work...
[EDIT] How about calling SetRedraw(FALSE) in OnInitialUpdate() , and then calling SetRedraw(TRUE) at the end of your painting routine. You may also need to call UpdateWindow() before calling SetRedraw(TRUE) .
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks for your fast reply.
Thats a good possibility to resolve the problem if the loading of all elements of a Grid performs
an ugly visualization.
But in my case, it's the creating of the entire Child ( the Frame, it selfs )
At first, a small Frame is created, than the Frame grows to the given size, than moves to the center
of the Workspace. The User can't see all these steps, but a kind of flashing, that's the problem.
So, an entire Refresh-Disable of the entire Application doesn't exists ?
Mmh
|
|
|
|
|
In that case, try the ShowWindow method, and see if you can resolve it that way.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
baerten wrote: SetRedraw(FALSE)
You could try to Validate the region, until Child B appears.
|
|
|
|
|
Thanks too.
But that also does not resolve the problem
|
|
|
|
|
Have you looked at LockWindowUpdate? You can only lock one window at a time. Mixing all this with showwindow might do the trick though.
"Acceptance without proof is the fundamental characteristic of Western religion, rejection without proof is the fundamental characteristic of Western science." - Gary Zukav
|
|
|
|
|
I have a project in wich a want to map many Win32 API Errors to exception classes derived from std::runtime_error. All of these follow one pattern :
class RegCreateKeyExException : public std::runtime_error
{
public:
RegCreateKeyExException(const std::string& message, LONG lErrorCode)
: runtime_error(message)
{
}
LONG getErrorCode() { return m_lErrorCode; }
private:
LONG m_lErrorCode;
};
Whenever i want to create a new class, i have to copy/paste this and just change the name. I was thinking about a way to create a class-template that generates generic exception-classes, but i found no way that wasn't ugly. Then again i'm no template crack, so maybe someone out there has an elegant solution to that problem (or the clear answer that there is none and i can stop searching).
wbr Brainley
|
|
|
|
|
Using VS2005/SP1, writing an MFC application...
I needed to add a call to CoInitialize() in my code, and in the process of adding it, I found something in MSDN that said we should now be using CoInitializeEx() instead, so I did the required #include (it seems you need DCOM to use the new version), and made the call.
Now, when I start up my app, I get the following warning message:
OLE initialization failed. Make sure that the OLE libraries are the correct version.
And the app then starts up.
To avoid the problem, I just went back to using CoInitialize() . Does anyone know what OLE libraries I need that aren't already on a Win2KPro/SP4 box? I though I had DCOM in Win2K...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Did you by chance not do this?
"You must include the #define _WIN32_DCOM preprocessor directive at the beginning of your code to be able to use CoInitializeEx."
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
Which concurrency model are you specifying? I don't think you can use COINIT_MULTITHREADED
in an MFC app.
Mark
|
|
|
|
|
--------------------------------------------------
Posted yesterday
--------------------------------------------------
VS2005 (NOT with SP1)/MFC
When I add the OnSysCommand message handler to my app (without adding anything to it), the system menu starts acting weird. The left mouse button no longer displays the menu, and the right mouse button positions it incorrectly. On top of that, I can't resize the main window by click/dragging the border, and I can't move the window.
If I remove the OnSysCommand handler, the app behaves normally.
Has anyone ever seen that? Remember, I'm using the un-patched VS2005 with MFC.
I don't recall that happening in VC6.
--------------------------------------------------
Today
--------------------------------------------------
When I got home from work, I tried the same thing on my machine. At work, we are in the middle of a few projects and will not be applying VS2005 SP1 because that means we'd have to regression test everything we've written in the last year and a half. At home, I don't have those concerns, and I applied SP1 right after it came out.
The original problem described above doesn't appear to occur in an app created in SP1.
Hmmmmm....
-- modified at 6:01 Friday 26th January, 2007
WHY was this voted a 1? WHAT THE F*CK IS WRONG WITH YOU PEOPLE!?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I found out what was happening, and posted an article about it.
http://www.codeproject.com/menu/System_Menu.asp[^]
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I was just about suggesting you do a small article about it !!
Thanks!
|
|
|
|
|
i'm trying to call vb dll in VC++, n i follow the tutorial from www.codeproject.com/com/vb_from_vc.asp?df=100&forumid=104&exp=0&select=1000246
but i'm stuck when calling the midl myDll.idl /h myDll.idl command? it is said that cannot recognize the midl compiler.
where can get the compiler? is it already installed in the MsDEv?
thx.
|
|
|
|
|
Is it a simple dll or an activeX ?
If it is a simple dll, you shouldn't do that but instead simply load the dll and get the addresses of the exported functions (I don't know how VB does to create dlls).
|
|
|
|
|
i think it should be an activex dll. i create the dll by myself for testing. but i got confuse when i try to load it directly from VC++. so i follow the tutorial.. ? any recomendation??
|
|
|
|
|
Cedric Moonen wrote: Is it a simple dll or an activeX ?
VB can produce only activeX ones.
|
|
|
|
|
Hi,
can we use return statement in "?:" conditional ternay operator.
I am using like this (avar == 2)?return:executesomethng(..);
but the compiler is not allowing me do that, and it gives the error C2059(syntax error : 'token').
Regards,
Mushq
|
|
|
|
|
Either way, in my opinion you're putting a lot of time and effort to write code that is hard to read and understand, even for yourself if you return to it two months from now.
My suggestion is that you rewrite it: use an ordinary if-statement.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
A well written method would have only one return point. The way to do this is,
if (avar != 2)
{
executesomething(..);
}
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
(avar == 2)?return:executesomethng(..);
err am i missing something here or should this be:
(avar == 2) ? return executesomethng(); : return executesomethngelse();
"Life begins at 140"
|
|
|
|
|
Actually, I agree that there should be just one return, and the correct syntax for what you're trying would be
return (avar == 2) ? executesomething() : executesomethingelse();
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I have somewhat of a strange problem. When I create a window for use with D3D the systems appstarting cursor is set in place when really it should be a normal pointer. I do not programaticaly change the cursor in any way. I have tried showing/hiding the cursor from both IDirect3DDevice9 and the standard api, so far I have been unable to change this behaviour.
I could set the cursor myself but why should I?
Another point to note is that I am using the October 2006 SDK on windows vista
|
|
|
|
|
Hi!
Is there a good reliable way to determine how much memory is in use by my process?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|