|
In my app, main frame has 5 child windows (base class is CWnd), the 5 children fully occupy client area of main frame and overlapped each others - similar to 5 property pages.
every time,only one of them is visible.
the 5 children are heavily painted in OnPaint().
problem is that when one is shown by ShowWindow(SW_SHOW) and others are hidden by ShowWindow(SW_HIDE), there is always some annoying visible flash at page changing time.
the reason I guess is that the paint is too heavy, so I use memory DC and disable OnEraseBkgnd() - howerver, the urgly flash still can be seen.
Do you have idea to kill the annoying flash?
Do I have to use ShowWindow() function to make one visible and others invisible?
Any suggestions are highly appreciated.
Thanks
|
|
|
|
|
What order are you making the ShowWindow(SW_SHOW) and ShowWindow(SW_HIDE)
calls in?
Try showing a child window before hiding the previous child window.
Also, if the main frame is always covered by one of the children, then
disable the main frame's OnEraseBkgnd.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
This apppears to be a problem with single threaded programs doing a lot of work! I consider it a design flaw in WINDOWS, and have been fighting with it for several years now. When the window you are working with gets a heavy task, and you send prior to that a SW_HIDE message, it hides your window. XP in particular (I Don't know about vista) seems will paint the most previous window immediately below it that it can find a thread for. This just could be the spreadsheet in which you were working out Staff Redundancies, or an email to the mistress. The only reason I can see behind this is that it avoids 'Blackness', and people thinking the machine crashed. A solution would be if the OS would show some non-descript blank screen (Nice Picture etc) instead of the last window of the previous app.
The only way I found out of this is by doing anything timeconsuming on a different thread, and show a 'wait box' This will even cure the short flashes you complain about.
Hope this is helpfull
Bram van Kampen
|
|
|
|
|
|
Hey,
What I'm trying to do is get the ip address that a program is attempting to connect to. I can't use microsoft detours because if there is a similar application running the ip address will get modified before my program receives the data. At the moment I am codecaving on the connect statement below, from there I store the second argument (pSockAddr, EDI + 4) into a DWORD variable. I'm told that it's possible to get the address that the program is trying to connect to from pSockAddr, but I'm not too sure how. I've tried a reinterpret_cast statement, but of course that would be too simple :P
PUSH 10 ; /AddrLen = 10 (16.)
PUSH EDI ; |pSockAddr
PUSH ECX ; |Socket
CALL DWORD PTR DS:[<&WS2_32.#4>] ; \connect
Could anybody guide me in the right direction? I've searched around this site and googled for about half an hour, without any luck. I'd really appreciate some help with this.
Thank you for your time,
urbanyoung.
|
|
|
|
|
If EDI is the address of a sockaddr, then at EDI+4 is a in_addr structure,
which is the 4 bytes of the IP address.
Once you get those 4 bytes into a DWORD, what do you want to do with them?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey everybody
I've been looking for a way to do that for a while, and right before I'm starting to go through the routing table and figure out the packet's trace I am turning to you...
Once a user connects to a VPN it receives an IP inside the organization he/she connected to.
Is there a way to get that IP? (I know it is in the routing table, but I don't know how to recognize that specific IP instead of others that might be...)
Thanks a lot in advance!
|
|
|
|
|
Hi,
I am working on an MFC Application in which there is chat option with sending emoticons/smiley features.
I am having the codes for each emoticons. When the emoticons button is clicked i want its code to de added in the EditBox.
Now the problem i am facing that I am unable to put the code of smiley at the cursor position. Rather I am able to put it either at the begining of the text or at the end of the text.
please help me.
Thanks In Advance.
Dhiraj Kumar Saini
|
|
|
|
|
|
Thanks a lot for the help. It solved my problem.
|
|
|
|
|
Hello,
I am developing a client and server application for bluetooth devoce. My server is desktop PC which has dongle attached and client will be Windows Mobile. As client server get connected server will send to client list of some files. from the client side i should be able to download file means copying file from server to client. I am using sockes for eastablise connections. Now i have to send a file from server to client. How can i send a file? Please help me.
Thanks and regards,
Yudhisthira attry(India, Bangalore)
|
|
|
|
|
I have three class's that I use in nearly every program I create. Each class is from a dialog resource. I want to create a DLL that would contain those dialogs and the class's that represent them. Is this possible? If so could someone point me to an example that loads another program's dialog resource and class?
A C++ programming language novice, but striving to learn
|
|
|
|
|
It's absolutely possible, just keep the three classes in a separate DLL project that you can include in any solution you create. Just include the appropriate headers where necessary, making sure to set the include paths as needed in the project configurations of the other projects, and set the project dependencies to include this DLL.
Not sure if I can point you to an example right now, but this is a rough idea of how it's done.
|
|
|
|
|
How do I include the dialogs the class's represent?
Do I create the dialogs in the DLL or somehow expost the dialogs from the other program into the DLL or what?
A C++ programming language novice, but striving to learn
|
|
|
|
|
Are these CDialog-derived (MFC) classes or your own classes?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes. I've started the DLL. I used the resource editor to create the dialogs in the DLL. Hopefully the programs the DLL is used in won't complain about the DLL's resource file. Will it?
A C++ programming language novice, but striving to learn
|
|
|
|
|
You have a few options, depending on how you want to link
to the MFC libraries and how your DLL will be used.
Read this link VERY carefully, choose the type of DLL you want,
and follow the links to that DLL type....all the info you need to
use them properly is there.
Kinds of DLLs[^]
If your dialog classes are derived from MFC, and only MFC apps will
use the DLL, then an Extension DLL[^] is probably a good choice.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I used "Static" instead of Extension". maybe I can change it?
A C++ programming language novice, but striving to learn
|
|
|
|
|
What is "static"? Statically linked to the MFC libraries?
If so, keep in mind your DLL and EXE will be using two different
MFC library instances. That means you can't pass MFC objects between
the EXE and the DLL.
Extension DLLs must use the shared/DLL version of the MFC library, so
both the EXE and the DLL would use the same instance of the MFC library.
It's up to you which is better for your application.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I guess I'm confused again. My entire program uses the Static MFC Libraries. I thought I would have to use the Static DLL because of that. Is there a Static Extention DLL? I don't see how I can in the "Client" application link to MFC Statically, but in the DLL link Shared? What do you think?
A C++ programming language novice, but striving to learn
|
|
|
|
|
That's why I stated read the link CAREFULLY
You can link all your modules to the MFC libraries statically, but the restriction
I mentioned applies...
every module - EXE or DLL - gets its OWN MFC library. That means you can't pass
any MFC objects between modules. You can't even pass a CWnd to be the parent of
one of your dialog DLLs. Every module gets its own CRT as well, so each has its own heap.
There's no such thing as a "static DLL". We're discussing how MFC is linked TO your DLL.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well, I can't use DLL's then, because CMainFrame passes CWnd to all my dialogs for loading. So I can't use DLL's. I guess DLL's are useful somehow, but I simply can't use them. Thanks for your help though.
A C++ programming language novice, but striving to learn
|
|
|
|
|
If you're linking everything statically, why not make a static library
to hold the common dialogs?
You'll have to make sure resource IDs in the library don't clash with
resource IDs in modules that use the library.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark, I don't know how? Can you tell me how? or point me to an example. I wouldn't know where to begin.
In the DLL I just completed, I, out of habit, checked both programs that the DLL would have been used in, to make sure all Controls were different(Resourse ID's). I didn't know you could make a "Static" Library, or what is supposed to be included in one.
A C++ programming language novice, but striving to learn
|
|
|
|
|
I have taken over several MFC projects in VS 6.0 and .NET that use a lot of the same code. I'm wanting to consolidate a lot of the sources files that are the same so that any changes I make will happen to all the other projects using the same code when they are rebuilt. What is the best way to organize this code? Just put them in a separate directory separate from the projects and include them in the project?
|
|
|
|