|
Hi!
Write slow, even if You can write fast, double check functions/methods/algos.
Review code You have recently wrote, test often (from user point of view - use release
version), etc.
It is better to write 50% slower and generate less errors, than write fast generate many errors, and then spend huge amount of time on corrections.
(of course, those are my opinions)
Mukkie
|
|
|
|
|
It is better to write 50% slower and generate less errors, than write fast generate many errors, and then spend huge amount of time on corrections.
(of course, those are my opinions)
But very valid ones. Bugs are can be very expensive to fix.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I have a lot of problem especially on windows 2000 to set focus input to windows in a multithread context (several threads manage windows)
I have found this remark in an MSDN article concerning SetForegroundWindow function :
Windows NT 5.0 and later: An application cannot force a window to the foreground while the user is working with another window. Instead, SetForegroundWindow will activate the window (see SetActiveWindow) and call theFlashWindowEx function to notify the user.
Is somebody can explain me what "while the user is working with another window" means exactly or where i can find it
|
|
|
|
|
Basically what it means is that from Win2K upwards, applications cannot steal focus from other applications. You can set the focus to any window in your app as long as the current focus is with one of the other windows in your app. But if the focus is on a window in a different app, then you cannot steal the focus.
I believe there is some undocumented registry setting to disable this prevent-steal-focus setting.
Regards
Nish
My most recent CP article :-
A newbie's elementary guide to spawning processes
www.busterboy.org
|
|
|
|
|
Which would be a VERY bad thing to change on users without their consent.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
First thank you for your quick response to my problem on "The Code Project".
What you say seems to me very logical, but I have also the case in a multithreaded application where SetForegroundWindow fails to give the focus to the good window. In fact it seems that no window has the focus until I click on a window.
Do you know a logical explanation about that or a place to find an explanation to this problem.
Regards
gwen
|
|
|
|
|
Perhaps in a larger program the size of a STL program becomes more the same as a program without STL, however, I'm am creating some example programs and have realized that the little 50 or so line example programs I'm writing are building up to 500k or more in debug and 100k or more in release.
I looked a little closer and saw that there are quite a few dependencies that must be the reason. Is there any way around this? Is this normal? Do you guys/gals find it not as big of a problem with larger programs as the templatized functions and containers make up for themselves?
Thanks for you input in advance,
Travis D. Mathison ---
--- After three days without programming, life becomes meaningless ...
|
|
|
|
|
Debug code is ALWAYS really bug, don't worry about it.
In release mode, check your compiler optimisations. Default is optimise for execution speed, you can do a lot to bring the size down.
But the single biggest thing that affects your average windows program (maybe not STL though), is whether you statically link with MFC or dynamically link. dynamic linking is smaller, but your program has more dependancies.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Does anyone have a RELIABLE serial port class that uses messages for notification, etc. Thanks
Marcus
Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope
-- Daniel Burnham
|
|
|
|
|
Ramon de Klein's Serial library for C++ is very popluar here at CodeProject and meets your requirements.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm trying to get my program to send text to the edit box of another window.
I have no probelm getting the window's handle, and according to my "if" statements, its working.
this is what I have set up for my code while winvar is the variable for the window im sending text to:
::SendMessage(winvar, WM_SETTEXT, 0, (LPARAM)_T("text"));
Nothing appears in the windows edit box when I run the function, and it should be working according to my if statements.
|
|
|
|
|
|
When you do that, does it send the text to the title bar, or into the edit box?
I just tried the exact same code as you, and it changed the "Calculator" on the calculator window to "Hello World".
What I am trying to do is send text to the edit box... I'm not sure if that is the right name for it, so I'm going to say that i want to send text to the box that displays the numbers in the calculator window.
|
|
|
|
|
Try this then :- [it makes the title of calc "hello world" and the text box "chk"
void CTest_deleteDlg::OnButton1()
{
HWND hWnd;
::SendMessage(hWnd=::FindWindow(NULL,"Calculator"),
WM_SETTEXT,0,(LPARAM)"Hello World");
::EnumChildWindows(hWnd,EnumChildProc,0);
}
BOOL CALLBACK EnumChildProc( HWND hwnd,LPARAM lParam )
{
::SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)"Chk");
return false;
}
My most recent CP article :-
A newbie's elementary guide to spawning processes
www.busterboy.org
|
|
|
|
|
|
I have a program that communicates to other computers on the network via a service.
I want to know how to determine a computers logon status. I.e whether it is logged on or not.
how do I know if a computer has not been logged on
|
|
|
|
|
Hi, I want to open a http connection, call an asp page, and read the response from that asp page. However, I need to go through a proxy to do this. Could someone show me actual code that would achieve this?? I have searched heaps and only found vague information on how to do it.
1. POST data to an asp page
2. receive the response from the asp page
3. must go through the proxy
Please help!! Thanks!
|
|
|
|
|
|
CHttpFile *s;
CHttpConnection *c;
CInternetSession *is;
if (useProxy)
is = new CInternetSession(NULL, 1, INTERNET_OPEN_TYPE_PROXY, ProxyURL);
else
is = new CInternetSession(NULL, 1, INTERNET_OPEN_TYPE_DIRECT);
c = is->GetHttpConnection("ip", (INTERNET_PORT) 4000);
wsprintf (param,"nickname=%s&password=%s&entranceRoom=%s",User,PassWd,RaumName);
wsprintf (length,"Content-Length: %d\r\n",strlen(param));
strcpy (header,hdrs2);
strcat (header,hdrs3);
strcat (header,hdrs4);
strcat (header,length);
strcat (header,hdrs5);
wsprintf(rline, "/Login.html");
s = c->OpenRequest("POST",rline,referer,0,NULL,"HTTP/1.1",INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD);
LPCTSTR lpszHeaders = header;
s->SendRequest(lpszHeaders, strlen(header), param, strlen(param));
f = new fstream("back.html", ios::out);
while (s->ReadString(l) != FALSE)
{
... // some *f things
}
delete f;
s->Close();
delete s;
delete c;
delete is;
this is only a little example from my code ... not even perfect but its working.
u always have to check ur headers and the things that you send.
best way to check is a html browser and a packet sniffer. there are many outta there. with the sniffer u see the original header and data. and could also check your program that it send also the right one.
bye
|
|
|
|
|
i have made a program that uses a file format that i have created called *.sts and i need to make the file (when double clicked) open my program and load the file in?
|
|
|
|
|
|
Hi,
I have created a CPropertySheet modal window, and I'd like to be able to remove the OK, Cancel, Apply Now, and Help buttons but don't know how.
Please help me
Fabian
|
|
|
|
|
found something, no more help needed
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q141039
|
|
|
|
|
Has anyone gotten this to work? I keep getting script errors.
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
Frankly AOL should stick to what it does best: Fooling millions of americans into believing that it, AOL, is the web. -Paul Watson
|
|
|
|
|
Consider the following 2 program code segments. Which one utilizes main memory more efficiently, and which one takes up more space in main memory for variables?
Code segment #1:
int score1, score2, score3;
.
.
Code segment #2:
int score[3];
.
.
Loli10
|
|
|
|
|