|
yes, but how can I know when a window is created and I could set the title at once, or I set a Timer ??
|
|
|
|
|
I am curious as to what you intend to do with such a program. Is it part of an annoyance utilities package?
Just kidding pal
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
Nish - Native CPian wrote:
Is it part of an annoyance utilities package
LOL. I think we've just found the next killer app
Michael
Errata 1: p. 154, section 'Defusing'. For 'red wire' read 'blue wire'.
|
|
|
|
|
I have a tab control on that i had placed a list controls .
If i select some item in the list control & move some other window over that then close that window.Now my list control will disapper.If i won't select anything in the list control,then it works fine.
Any idea?
Neha
|
|
|
|
|
How can a move this part of the complex.cpp into the header file:
double A,B,C,D;
char letter;
cout << "s Sum\nd Differnce\np Product\nq Quotient" << endl;
cout << "The operation is ";
cin >> letter;
cout << "A is ";
cin >> A;
cout << "B is ";
cin >> B;
cout << "C is ";
cin >> C;
cout << "D is ";
cin >> D;
//complex.cpp
// Complex
#include <iostream.h>
#include "complex.h"
main()
{
double A,B,C,D;
char letter;
cout << "s Sum\nd Differnce\np Product\nq Quotient" << endl;
cout << "The operation is ";
cin >> letter;
cout << "A is ";
cin >> A;
cout << "B is ";
cin >> B;
cout << "C is ";
cin >> C;
cout << "D is ";
cin >> D;
complex com1(A,B);
complex com2(C,D);
switch(letter)
{
case 's':
(com1+com2).print();
break;
case 'd':
(com1-com2).print();
break;
case 'p':
(com1*com2).print();
break;
case 'q':
(com1/com2).print();
break;
}
return 0;
}
// Header File
#ifndef _complex_h
#define _complex_h
class complex
{
public:
complex();
complex(double,double);
complex operator + (complex);
complex operator - (complex);
complex operator * (complex);
complex operator / (complex);
void print();
private:
double r, i;
};
complex::complex()
{
r=0;
i=0;
}
complex::complex(double a, double b)
{
r=a;
i=b;
}
complex complex::operator+(complex value)
{
double a,b,c,d,x,y;
a=r;
b=i;
c=value.r;
d=value.i;
x=a+c;
y=b+d;
complex answer(x,y);
return answer;
}
complex complex::operator-(complex value)
{
double a,b,c,d,x,y;
a=r;
b=i;
c=value.r;
d=value.i;
x=a-c;
y=b-d;
complex answer(x,y);
return answer;
}
complex complex::operator*(complex value)
{
double a,b,c,d,x,y;
a=r;
b=i;
c=value.r;
d=value.i;
x=a*c-b*d;
y=a*d+b*c;
complex answer(x,y);
return answer;
}
complex complex::operator/(complex value)
{
double a,b,c,d,x,y;
a=r;
b=i;
c=value.r;
d=value.i;
x=((a*c)+(b*d))/((c*c)+(d*d));
y=((b*d)-(a*d))/((c*c)+(d*d));
complex answer(x,y);
return answer;
}
void complex::print()
{
cout << r;
if (i>=0)
cout << "+";
cout << i << "i" << endl;
}
#endif
|
|
|
|
|
|
Anybody know a way to programmatically change the IE Connection Options? Is there an API or a specific registry key?
I need to change it from "Never dial a connection" to "Dial when a network connection is not present".
Like it or not, I'm right.
|
|
|
|
|
Look at the changes at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings. When setting the value from "Never dial a connection" to "Dial when a network connection is not present" the value EnableAutodial changes from 0 to 1.
Easy util for monitoring registry changes: http://www.sysinternals.com/ntw2k/source/regmon.shtml.
Succes!
|
|
|
|
|
Thank you very much!
Like it or not, I'm right.
|
|
|
|
|
Hi everyone,
I have a question, I am curious about the greatness of Cstring, can I used this in non MFC projects? I was trying to use it like this:
#include <Cstring>
#include <iostream>
int main(){
String str("The stars are aligned");
int n = str.Find('e', 5);
cout << n;
}
Code above contains an error "error C2065: 'CString' : undeclared identifier"
Did i miss something? or CString does not work with non MFC projects?
Thanks/Regards
Sidney
|
|
|
|
|
CString will not work in non-MFC projects, it derives from CObject.
If you are going to use STL you may want to consider the basic_string<T> template class.
Or WTL contains a version of CString in the atl_misc.h file.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Ok Thanks for the great help info
Thanks/Regards
Sidney
|
|
|
|
|
BTW, basic_string<T> is typedef'ed to string in VC++
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
CString is part of MFC. You can use the STL string object in non-MFC apps. See this link [new window] for more information.
/ravi
Help put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ok Thanks for the great help info
Thanks/Regards
Sidney
|
|
|
|
|
If you have VC++ 7, then you can use CString in non-MFC files by including the ATL headers. CString is now shared between ATL and MFC
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
can you show me sample code to do this? i will really appreciate it if you can
Thanks/Regards
Sidney
|
|
|
|
|
Another thing is that I dont have VC++ 7 I'm using VC++ 6 so I guess I cant do this kind of thing right
Thanks/Regards
Sidney
|
|
|
|
|
Correct. There are tons of implimentations of CString type classes if std::string does not do it for you though.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
|
I use ShowWindow( SW_HIDE ) in my program and it flashes the frame of what would be the window but then it hides. I've tried commenting out a lot of stuff but nothing seems to work. How can I get rid of the flashing?
-Raffi
Why do today what can be put of until tommorrow?
|
|
|
|
|
Try using this instead:
::SetWindowPos(hWnd, NULL, 0,0,0,0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE);
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
G'day all!
I have been using CRichEditCtrl class and every 20ms or so, I add things on to the display using this class. So you can imagine there's a whole heap of lines in the display.
I have been trying very hard to make sure that the Vertical Scroll Bar is placed at the latest updated position. Could anyone help me with this one?
Any help will be appreciated!
This above all, to thine own self be TRUE.
William Shakespeare
|
|
|
|
|
I didn't try the following but I believe it should work:
1) Call long GetTextLength() to get number character
2) Call long LineFromChar( long nIndex ) to get line index
3) You may want to call LineLength() to get line length
4) Call LineScroll() by removing the offset of the GetFirstVisibleLine( ) .
CRichEditCtrl ctrl;
int nLine = ctrl.LineFromChar(ctrl.GetTextLength());
ctrl.LineScroll(nLine-ctrl.GetFirsVisibleLine());
Good luck!
One good thing about getting older, you don't lose the ages you've been!
|
|
|
|
|
Thank you Ernest!
It works great, thanks!
Life is like fishing. We are all waiting for a bite
|
|
|
|