|
Hi,All
In My application i am using CPropertySheet class for tabed dialog.
I have to change the Tab Cotrol Back color and TabColor.
For this i tried with
CMyDislplay::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
if( nCtlColor == CTLCOLOR_DLG)
{
pDC->SetBkColor(RGB(181,195,222));
pDC->SetTextColor(RGB(255,255,255));
return (HBRUSH)(m_pDlgBKBrush->GetSafeHandle());
}
HBRUSH hbr = CPropertySheet::OnCtlColor(pDC, pWnd, nCtlColor);
}
//CMyDislplay is derived from CPropertySheet.
In above trial the dialog color is changed,but Tab Color not changing
----
Can any one help me...
how can i change the Tab Color as wel as dialog color
thank in
advance..
anju
|
|
|
|
|
I have been developing some application that requires the use of the windows com port. The windows driver seems to be behaving rather erratically when used with a non intel motherboard.
Symptoms:
Win XP/2K, intel motherboard, intel cpu
Windows serial driver works without error when receiving data from physical serial com port.
Win XP/2k, ALi/VIA motherboard with intel/AMD cpu,
Windows serial driver seems to be dropping data or had buffer overflow problems when receiving a few hundred kilobytes of data. Therefore the data i received when using the readfile(); would be invalid.
This is a very consistent problem and very repeatable.
Below is my configuration:
dcb.BaudRate= 57600;
dcb.fParity = FALSE;
dcb.Parity = FALSE;
dcb.StopBits= FALSE;
dcb.ByteSize= 8;
dcb.fOutxCtsFlow = TRUE;
dcb.fOutxDsrFlow = FALSE;
dcb.fDtrControl = DTR_CONTROL_DISABLE;
dcb.fDsrSensitivity = FALSE;
dcb.fRtsControl = TRUE;
dcb.fOutX = FALSE;
dcb.fInX = FALSE;
dcb.fBinary = TRUE;
dcb.fNull = FALSE;
dcb.fAbortOnError = FALSE;
I tried searching around for configuration advises to the windows com port for the ALI and VIA chipsets but couldn't find any writeouts on them.
Please do advise on this issue...
Best Regards
spc
|
|
|
|
|
Hi, everyone!
I want to develop a remote desktop share/remote control
program, like terminal service in XP.
The reason why I want to develop a program like this has
two reasons:
1. I want to control the authentication method more flexibly,
for example, replace windows authentication method with
LADP method. But XP can only use windows authentication.
2. XP terminal service can not let more than two users to
share the same desktop.
My quetions are:
1. Does Microsoft have SDK to develop applications like this?
2. Are there some source codes that I can refer?
Thanks in advance,
George
|
|
|
|
|
VNC[^] is an open source cross-platform remote desktop application, so you should be able to modify that to include your own custom authentication.
I believe it allows multiple users to remote view the same desktop (and you can have a choice of just remote displaying the desktop, or actually allowing the remote user to control it)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Thanks, benjymous buddie!
It is a very nice open source software!
George
|
|
|
|
|
I used most of time dynamic memory allocation. But I am asking my self how much could be a static allocated array in a Visual C++ application.
Is something related to Operatong System like : for 16 bit win mak is 64kbytes.
For the Visual C++ 6, I didn't found some specification related to this problem.
IS for sure the I tryed with a bigger buffer, but how sure could be ?
Thanks
Cutty
|
|
|
|
|
the maximum size of a statically allocated array in a function is limited by the size of the program's stack. the maximum size of an array allocated outside of a function is probably limited at run-time by the system (ie. how much memory is available).
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
Hi, all!
Here's a plain old C++ program that you have to modify such that it prints "Hello, world!" before it prints "Bye, world!" :
<br />
<br />
#include <iostream.h><br />
<br />
int main()<br />
{<br />
cout<<"Bye, world!";<br />
return 0;<br />
}<br />
<br />
But here's the catch: You should NOT modify main() - in fact, you should'nt do anything to main() at all, but apart from that, you can do anything.
In fact, I already know of TWO ways to do this (of which one works everywhere and one works on Turbo C++ but not on VC++), and I just want to find out if there are any more.
Right now, it's 11 AM IST (5:30 AM GMT). I'll be back around 4:00 PM IST (10:30 AM GMT) for the answers.
Happy brain-racking!
Vikram.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
This is not a standard C++ program, it uses iostream.h instead of iostream.
Surely if you create a class which prints hello world in it's constructor and create a global instance of it you'll get the desired result ?
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Christian Graus wrote:
This is not a standard C++ program, it uses iostream.h instead of iostream.
Yeah, you've got a point. But that's not the point.
Christian Graus wrote:
Surely if you create a class which prints hello world in it's constructor and create a global instance of it you'll get the desired result ?
That's right. That's one way of doing it- the portable way.
The "other" way is doing it in Turbo C++ , like this:
<br />
<br />
#include <iostream.h><br />
<br />
void Hello()<br />
{<br />
cout<<"Hello, world!";<br />
}<br />
#pragma startup Hello<br />
<br />
int main()<br />
{<br />
cout<<"Bye, world!";<br />
return 0;<br />
}<br />
<br />
It does'nt work with the Win32 compiler (the pragma is implementation-dependant).
BTW, what happened to poor Vinod's article? Did it get chucked out? Poor guy!
I woulda loved to see his next article on RAM or something- his articles make funny reading. The humor content is way high.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
Vikram Punathambekar wrote:
Yeah, you've got a point. But that's not the point.
I know, but I'm pedantic.
Vikram Punathambekar wrote:
BTW, what happened to poor Vinod's article?
It was removed and he was advised to modify and resubmit if he wanted to. I don't think he did.
I like the operator << solution better. iostreams rock. I dunno why I didn't think of it, because I play with them quite a bit. And when I said 'doesn't this work', it's because I didn't try it, and I too wasn't sure if iostreams were up and running prior to main(). I guess they are, but if the standard says they must be is another thing.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Christian Graus wrote:
I know, but I'm pedantic.
So am I. I've got an eye for detail.
The << overload is definitely more "elegant", but you're indirectly modifying what is inside main() . So is the guy who used a #define on cout (see replies to this thread). That's something a purist (and pedants like you and me) would frown upon. The cleanest solution (IMHO) is the global constructor. Anyway, I like the << overload best (though I'm a purist).
Poor Vinod. All he wanted was to make us laugh.
Any other solutions for the original question, do let me know at binarybandit@operamail.com .
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
Vikram Punathambekar wrote:
So is the guy who used a #define on cout
*grin* Well, that would work, but it would leave me feeling rather dirty....
Vikram Punathambekar wrote:
The cleanest solution (IMHO) is the global constructor.
Oh, absolutely. And the only one that does not modify main().
Vikram Punathambekar wrote:
Anyway, I like the << overload best (though I'm a purist).
Yes, I like it too.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Declare a new << operator
ostream& operator << (ostream& os, char* str)
{
const char* temp = "Hello World!\n";
return os << temp << (const char*)str;
} this works because ostream has a <<(const char*) operator, but not a <<(char*) operator.
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!
|
|
|
|
|
That makes it three. I never thought of doing it like this. One way I knew was what Christian said- use a constructor for a global object. The other is non-portable, and you can find it in my reply to Christian's post.
I guess I'm grateful (!) to you for this.
Vikram.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
This is the best one. Personally I don't like the others because you might be making assumptions about initialization orders and such. Does the standard specify that iostream has been fully initialialized prior to main being invoked? Probably, but I am not sure.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
This is the best one.
This? What do you mean by this? The constructor or the operator overloading? The latter is more elegant, but the first one comes more readily to mind.
There's been another reply- somebody used a #define on cout itself (!).Check it out.
Regards,
Vikram.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
How about getting the preprocessor to do it for you?
#define cout cout << "Hello, world"; cout
I also came up withe the operator<< override myself, although I was a bit too unfamiliar to write it.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
WOW!
I never woulda thought of that! Err... maybe I would, given some time. Anyway, full credits to you!
No offense meant, but if you see closely, I don't want anything inside main() to be changed. Your solution and the << overload solution indirectly do that. They change the behavior of what is inside main() from outside. A purist wouldn't like it. The "cleanest" is the global constructor solution, while the dirtiest is the pragma (see my earlier post for code).
Nice work!
Regards,
Vikram.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
How can I handle directories with space when passed into ParseCommandLine. It seems to treat them as paramaters. Any ideas?
ie c:\documents and files\
Thanks
|
|
|
|
|
Surround them with double quotes when passing them in.
e.g. "c:\documents and files\"
Dave
|
|
|
|
|
|
I tried adding a static variable inside a class. ie static CButton m_button and I get a linker error. Any ideas.
Thanks
|
|
|
|
|
If you add a variable as a static it is declared, but not defined. You need this:
class a
{
static int i;
}
int a::i = 0;
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Hello,
I am having trouble with FindResource() when trying to find a resource of custom type.
This code returns null:
<br />
HRSRC hResource = ::FindResource(hInst, "IDR_MYNAME", "MYTYPE");<br />
I also tried FindResourceEx with my language locale, but all the same.
Any ideas as to what I am doing wrong?
|
|
|
|