|
1. I am working out a similar issue with fast user switching problems. I use the WTSRegisterSessionNotification to know when the session is going to be/is locked and unlocked.
2. There is some vague recommendation in the terminal services and fast user switching (FUS) documentation mentioning that you should draw to a memory DC and then blit onto the screen. Maybe you cna keep a memory DC for your window, draw into it, and only do the blit really fast once your 'drawing' is done?
3. The Sleep call may be the problem ... from MSDN "You have to be careful when using SleepEx and code that directly or indirectly creates windows. If a thread creates any windows, it must process messages. Message broadcasts are sent to all windows in the system. If you have a thread that uses SleepEx with infinite delay, the system will deadlock. Two examples of code that indirectly creates windows are DDE and COM CoInitialize. Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx, rather than SleepEx."
4. If you respond to the WTS_SESSION_??? messages, maybe you can invalidate your window when you see the appropriae message and then your repainting will be fine.
I think you should respond to WTS_SESSION_??? messages and avoid all draing if you are disconnected or locked out. Then you can redraw if your are connected or unlocked. If you get the lock and disconnect messages, you can also free your GDI resources to avoid the leaks.
|
|
|
|
|
Hi,
Blake Miller
Thanks a lot for thorough explanation.
regards
Balkrishna Talele
|
|
|
|
|
Hi i am working on a MDI application, and would like to implement a Visual Studio .NET dynamic help-style help pane (dockable) into my application. I am using BCG Pro for most of the GUI work (including the dockable control bars), so is there any libraries, APIs, or classes that could do this easily for me? Or should I just code up my own CHM viewer pane by myself? thanks in adv.
|
|
|
|
|
I need to make a source code file using C++ in order to make the game Reversi or Othello work
|
|
|
|
|
What do you mean make? do you mean you have a file and want to make it into a binary or that you want to write source code?
If it's the latter, you'll find a great reference[^] on CP. It's written in C#.
Or you can google.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Hi all,
I have two options, one is encapsulate my functions as a DLL, the other
is exports them as a DLL. Can anyone compare .lib with .dll? what are the
advantages and disadvantages of the both? So far, I know how to make DLL however, no idea how to make a lib file? any suggestions?
Thank you
David
|
|
|
|
|
.lib are statically linked to the EXE
in the VC++ new project screen choose win32 satic link library.
|
|
|
|
|
If there is ever-such a thing, that now i believe there can be, it can happen to writers/publishers (Getting Writers Block)... but how do i ever recover from this? its been going on for 1 Year now, and its stressing me out, I want to write a specific Code, and its in my head.. then.. i get at the key-board.. and it dissapears... like in a instant... i wonder if its Adult ADHD??? HAHAHAHAAHAHAAHAHA.. seriously now.....
|
|
|
|
|
add more RAM to your brain. hehe.
|
|
|
|
|
|
Thats a good one, i like it
|
|
|
|
|
I need to write a utility that integrates into the shell with right click support that will perform some of the tasks that are done with the IIS website administrator tool.
Which version of VC++ supports this?
Does anyone have any experience with this?
TIA
Glano perictu com sahni delorin!
|
|
|
|
|
are u looking for WMI (Windows Management Instrumentation). in msdn.
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
|
You got my 5!
Thanks for this 100% relevant link!
Glano perictu com sahni delorin!
|
|
|
|
|
(Strictly not a Visual C++ question, but I hope I won't be flayed alive since it's at least a programming question!)
10 points to the first person who can tell me how to extract a token (delimited by ".") from an argument (always of the form "a.b.c.d", where a, b, c, and d are strings of varying length) passed to a .CMD file. My guess is you'll want to use the FOR command to loop thru the string. I've going nuts trying to get this to work!
C:\> myExtractor welcome.to.Code.Project
Found token welcome
Found token to
Found token Code
Found token Project
C:\>
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
maybe I am totally missing the point, but can you not write a simple DOS filter in C or assembler that would take your input string and output the tokens? Examples of filters are DOS commands like SORT, FIND, or MORE. You would of course need a compiler that creates DOS files (As opposed to console programs). I am sure it could be done using pipes and maybe IO redirection.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Yes, I've already written a tiny console exe that does what I want (which is really to create a .h file that's #includ ed by my .rc ). But I'd like to reduce our build's dependency on an externally built module (which can get out of synch). Hence the desire to do it all at the DOS (actually CMD ) level.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
use strtok() or write you own simple extractor.
INTP
|
|
|
|
|
See my reply to PJ's response.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I have read your reply and do not understand the problem.
The header files string.h and stdio.h are ansi c, they are stable and should not get you out of sync; unless I am missing something.
The example I just look up under strtok will do the job with only minor changes: (1) change main(int agc,char *argv[]), (2) use arc[1] insted of the global string variable and change the printf output in any way you want.
That is DOS programming; and if you compiled it under UNIX or almost any other operating system, it would still work.
INTP
|
|
|
|
|
Hi John,
Introducing another dependency (the tokenizer app) in the build process introduces another point of failure in the build script. It's not hard to write the app that produces what I want (I've already done that to verify that the process works), but I'd prefer to do it in a DOS/CMD script (i.e. bare metal) that's part of the existing build script.
Just downed several cups of coffee in quick succession... I think I've got it to work! Will post a (hopefully positive) reply soon!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
So why are you asking here? Try some DOS shell conferences
Robert-Antonio
"Science is a differerntial equation.
Religion is a boundary condition."
|
|
|
|
|
I have a problem with mapping keys to buttons on the dialog.
I tried by catching WM_CHAR message like this
void CDialogbasedDlg::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch(nChar)
{
case '1': //do sth
break;
//...
}
CDialog::OnChar(nChar, nRepCnt, nFlags);
}
but it didn't work. The application just beeps when I press '1'.
|
|
|
|
|
Does the dialog have keyboard focus ? Did you set a breakpoint ? Your code WILL do nothing when a '1' is pressed.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|