|
I've never had good luck with CTime::Format("%x") . Currently my date format is set to M/d/yyyy, yet Format() incorrectly returns the date as 09/07/11. If I change my date format to dd-MMM-yyyy, Format() reports the same as before.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
With a bit more research, I think CTime::Format("%x") uses the default system locale format, whereas I want the default user locale format.
I changed to using ::GetSystemTime() and ::GetDateFormat() , and I think that will work.
|
|
|
|
|
Hi
I have today a server using the "old" paradigm of one thread per connection. It works fine, but it does have problems when many simultaneous connections hits.
I'm looking at the IO completion, which to me look like the way I would like to go. Reducing the number of threads to ideally one per processor sounds promising.
But I have one problem I have not been able to find a solution for.
The server application is working as a pure request/response application, but a number of the requests will cause the server application to setup a connection to another server, send a request, receive a response, and then answer the original request with this information.
My problem is: How do I avoid blocking the worker thread (that received the original request) while I'm waiting for the connection to the next server to be completed. Is there a way to use IO completion while waiting for the connect() to finalize (without starting a new thread) ?
Thanks
Ole
|
|
|
|
|
In this setup you have to block the thread because the client does not know when the server is going to give it back a response unless you can create a connection back to the client.
Another thing I can think of is have the client connect directly to the second server.
|
|
|
|
|
I'm trying to set up a remote debugging. The application in question is a Windows service so that the program will be running on the system continuously.
The first thing I did was get off the package of "Ms Debbugging for Windows", and I managed to connect remotely using WinDbg. This leads me to having to install the program. My intention is to debug without any installation, according to research I see that there are other applications such as "Kd", "Ntsd", "Remote" that are lighter and require no installation.
Here goes my question, Is it possible in the side of the application to create the application server with any of these applications and light on the side where I hooked to that server debug using WinDbg?
Like I'm off track, is there some other correct settings to make this work?
We accept all kinds of ideas, suggestions, orders ...
Best rewards
kLvin
|
|
|
|
|
Two ways I know of, using Visual Studio and Windbg locally.
1) VS can be done remote, run msvcmon.exe on the target, do an atach to process in VS specifying the target DNS name. (Putthe symbols in the same dir as the exes for the service you are debugging). If you have the process project open you can set breakpoints and so on.
2) Another is to run Windbg on the client, and do an Attach to Process. SPecify the symbol path, image path, and so on.
This is all very well, but what if you want to debug the service early on in its start up, ie before you get the debugger on it?
I have heard of using Image File Executiuon Options http://support.microsoft.com/kb/824344[^] but I never got it working for me.
Instead what I do is hard code a DebugBreak() early in in the services code. With the target booted in debug mode (modify boot.ini or System Configuration, and enable debug on say CPM1 at 15200 baud). When you get a breakpoint hit the machine will wait till a debugger gets attached and then notify it that the break occured.
You can also debug through the kernel with a remote machine but this is a bit complex and doesnt add any benefits over doing it thorough user mode and it is complex.
#1 is OK, #2 I prefer, purely because I use Windbg so much, since I do mostly kernel debugging.
==============================
Nothing to say.
|
|
|
|
|
I've got problem with SetLayeredWindowAttribute, ever since I had set it, it wouldn't receive WM_PAINT anymore. But I have critical code in WM_PAINT.
How to get WM_PAINT again while having SetLayeredWindowAttributes called?
|
|
|
|
|
I've just done a quick search, and found the following msdn article:
http://msdn.microsoft.com/en-us/library/ms997507.aspx[^]
Have look at the "Layered Windows" paragraph, specifically the line:
"This is because SetLayeredWindowAttributes turns on the redirection of the window's drawing..."
I realised it would be hard to experiment with a "real" application - but if I am having trouble, I always make a simple small application to work with, and make changes on. Once you understand how to make your small application that does nothing more that show a small red rectangle on the screen with varying transparency (for example), then you can make educated changes to your real application.
Good luck!
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
Thanks Iain.Your reply is of real help. I agree that we should always test a unknown technique within a small application that has all focus on it.
|
|
|
|
|
Currently i am working in windows application (VC++ 6) and I have decided to do certification : MCPD: window Developer 4. I need your suggestion, whether it is right choice to do? (or) any other certification are there to do? Your opinion help me to take right path.
modified on Tuesday, September 6, 2011 1:10 AM
|
|
|
|
|
Don't get certifications, make real coding experiences instead.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I think it is a good idea!And I am doing it !Come on!
|
|
|
|
|
Hi, thanks for your valuable suggestion. Can you help me which material you are using for this certificate exame or any other links are there? or you are using any dumps links with you? kindly help me.. 
|
|
|
|
|
shanmugarajaa wrote: I need your suggestion, whether it is right choice to do?
Based on what? It requires knowledge of .NET Framework 4, which has nothing to do with VS6. The last certification that VS6 was good for was MCSD.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I decided to do Certification in MCTS: .NET Framewprk 4, window application. whether it is right choice to do this certification to do?.I am currently working in VC6, is there any certification for VC6?.
|
|
|
|
|
Hi,
How to go to the previous control when I press the up arrow key?
Thanks,
Claude
|
|
|
|
|
Could GetNextDlgTabItem[^] help along with SetFocus[^]? (Don't be fooled by the name, it can be used to get the previous item also.)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
How can I make my application exe which should not get debug through any debugger?
|
|
|
|
|
You can use the IsDebuggerPresent API to check the process is being debugged by a user-mode debugger.
However this will not prevent the process from being debugged.
The API is there to alter the behavior of the program when being debugged.
You could not provide the PDB file so that the symbols are not available and debugging becomes difficult.
|
|
|
|
|
|
This sounds suspicious: If I have a license for your app, and I have a license for a debugger, I have (as per the EEC law on software copyrights) the full right to run a debugger on it.
If you prevent it and I need it, I can even take you to a court to impose you to remove that protection.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Laws in other places are different however.
|
|
|
|
|
Not that much.
The principle "It sis yopur software, but that's not your computer" was applied by the US court that made Sony BMG retire their own "copyright protection systems" and pay some billions in a class action.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
How could I find spefications of C++ operators overload, such as how many arguments should operator+() take, what should be the first operator of operator new(), operator int() qualifies only if it's a member function.
I have <<c++ primer="">>, it lists a few of them.But it doesn't satisfy my needs.could someone help me?
|
|
|
|
|
Does this[^] help?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|