Type: Posts; User:
October 24th, 2010
You can use the WSH library, if you want.
strUser = CreateObject("WScript.Network").UserName
Wow, this post is a blast from the past. Glad you found the information useful!
Practice safe programming.
September 2nd, 2005
The standard could have just as easily taken into account the order that the objects were initialized in the constructor initialization list and reversed that when destructing. I imagine the reason...
August 5th, 2005
char str1 = "str1";
char* str2 = "str2";
where does "str2" get stored then, if not in memory?
Here's a complete program that loads IE and navigates to a certain website (google, in this case). If you don't mind using COM, it sounds like it would work well for you, with what you're trying to...
"Wizards" do this very thing. You've probably seen them used for installing programs, setting parts of the software up (Internet Connection Wizard is a popular one), etc.
As Kirants said, you can...
I don't see anything wrong with having two function declarations differing only in their constness. And obviously the developers of the C++ language didn't either, or else they would have chosen to...
WM_KEYDOWN, WM_KEYUP, and WM_CHAR are notifications. They are sent to your window AFTER a keystroke occurs. They should not be used to simulate one.
This thread may help:
Here's the OK button handler from a dialog app I wrote a while ago that updates the created/accessed/modified times for a given file (error checking removed):
// Get the name of...
Good catch, kkez. My intuition told me that he was missing quotes -- I just picked the wrong spot! :)
In my resource files, the filename of the icon is enclosed by quotes, so you might want to try this:
ID_ICON1 ICON "test.ico"
Can you think of any other way to determine if the server is available other than calling your RPC method? Maybe you can run a series of shorter tests to ensure that the server is available and...
Looks okay to me, but the buffer used by ReadDirectoryChangesW may hold more than one filename, so you must loop through the buffer until there are no more entries to process. Use the...
You are correct. Based on his original question where he states it will be "sometimes 2, but also sometimes 1" and the fact that he only wants to pad the number to fill a two-character field, I was...
If you're just using character arrays, sprintf can make things easy:
char szResult; // two digits plus null
sprintf(szResult, "%02s", szNumber);
This will always return a two-character...
Also, if your going to use _tcslen() and TCHAR in order to be Unicode-safe, you'll probably want to use _stprintf() instead of sprintf() and _tcscat() instead of strcat().
Never seen that before but are you allowing the toolbar to size the buttons itself (TB_AUTOSIZE, I think)? If so, what happens if you manually specify the width of the button?
Yes, as Wang suggested, you need to define your version BEFORE you include windows.h. Also, depending on what version of VC++ you're using, you may need to download the Platform SDK from Microsoft's...
Not sure about your delete statements but where are you testing for the string length of buffer? I don't see it anywhere in your code.
If you're testing it after your new char operation, the...
The output is:
'cout' : undeclared identifier
because you forgot to include <iostream.h>
Seriously, though, it should be:
13, 12, 12, 10
Starting at the right, the variable value is...
I wasn't suggesting that he change the system font -- only inquire, then set his program's accordingly.
I think you can use the SystemParametersInfo() function with the SPI_GETNONCLIENTMETRICS flag. This should fill a NONCLIENTMETRICS structure that contains LOGFONTS for the current system fonts.
Also, you can register your service using the SC.EXE application. Not sure of its availability but I know it's on XP (for W2K, it may be in the resource kit). If you're deploying it, then you'll...
If hDlg is a handle to your dialog and IDC_EDIT1 is the identifier of your edit control (textbox), then this code should work:
// Create a buffer to hold the text...
Click Here to Expand Forum to Full Width