|
Here's a Christmas edit box (adjust colors for your region/season/religion/etc):
(This is MFC code but API calls are similar)
CBrush RedBrush;
...
RedBrush.CreateSolidBrush(RGB(0xFF,0x00,0x00));
...
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (nCtlColor == CTLCOLOR_EDIT)
{
pDC->SetTextColor(RGB(0x00,0xFF,0x00));
pDC->SetBkColor(RGB(0xFF,0x00,0x00));
hbr = RedBrush;
}
return hbr;
}
-- modified at 11:25 Tuesday 5th December, 2006
|
|
|
|
|
Mark Salsbery wrote:
Christmas edit box
he he he
<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
|
|
|
|
|
No no no...
That's "Ho Ho Ho"
|
|
|
|
|
No way
" Nothing is easy , u have to work hard "
Vikas Amin
EATON
PUNE
|
|
|
|
|
|
Hi All,
I need to write some application that send some file ( it can be word document or some exe file ) to some other machine that have with him TCP connection.
The TCP connection is not my problem - my problem\question is - how to read the file and send it to other side ? I know that i need to send the file as byte order - but i don't know how to do it.
Thanks for any help.
|
|
|
|
|
just opent the file in binary mode (e.g. fopen("foo.exe", "rb") ), read from (e.g. using fread ) and the send it through the socket.
Where is it the trouble?
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.
|
|
|
|
|
With Windows Sockets there's the TransmitFile() API (NT 3.51+).
You can also open the file, read a chunk of bytes into a buffer, send the buffer.
On the reveiving side create a file, receive a chunk of bytes into a buffer, write the bytes to
the file.
There are no byte order issues.
Mark
|
|
|
|
|
Yanshof wrote:
he TCP connection is not my problem - my problem\question is - how to read the file and send it to other side ? I know that i need to send the file as byte order - but i don't know how to do it.
open file in binary mode and send chunk by chunk.. remember Sliding Window Protocol!
<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
|
|
|
|
|
how do i drag(move) dialog that doesn't hav title bar?
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
BlitzPackage wrote: ...and assign the necessary variables for the control, but it absolutely refuses to let me do so. I know there is some simple step that I'm forgetting.
Like using ClassWizard (Ctrl+W)? Of course, you can always do it manually.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Talking to yourself again?
|
|
|
|
|
Mark Salsbery wrote: Talking to yourself again?
No, BlitzPackage apparently deleted his post, thus orphaning mine.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Maybe he gets his answer then delete his question
|
|
|
|
|
Very stealthy.
The masked inquisitor strikes again!
|
|
|
|
|
Hi,
I can get the ActiveX ID from Client by using GetCtrlID, but I need to get the ID from ActiveX itself by calling GetCtrlId in ActiveX itself.
(in the same way as we get for a Dialog using dialogobj.GetCtrlID)
If I use it in ActiveX iam getting it as Zero in Client.
Thanks in Advance
Today is a gift, that's why it is called the present.
|
|
|
|
|
Hi, All
In one function of my project I need a 2-D vector array consisting of elements of struct STRU_A.
struct STRU_A{
char ch[20];
float score;
};
However, the two dimensions both dynamic. That is, the dimension sizes depend on the input to the function.
How to declare and use a 2-D vector array of such kind.
thank you
|
|
|
|
|
Use a double std::vector.
typedef std::vector< std::vector< STRU_A> > T2DArray;
The typedef is usefull so that you can easily declare a new instance without typing everything:
T2DArray MyArray;
|
|
|
|
|
|
Hi,
Iam using VC8.0 .
I have a dialog with two buttons placed on Left side.I Invoke Domodal dialog boxes having no borders with each button clicks.
SettingsDlg.DoModal();
In One of the DoModal diaog invoked I have an Edit box.In OnOK of that Dialog box I check for the EditBox validation if Nothing is entered I return the before CDialog::OnOk prompting the user to type the text.
if(m_strProfileName.IsEmpty())
{
AfxMessageBox(_T("Profile Name must be Entered"));
GetDlgItem(IDC_EDIT_PROFILE_NAME)->SetFocus();
return;
}
OnOK();
The Problem Iam facing is upon clicking OnOk without entering the Text in Edit box Iam losing the Focus.Now, If I click other button its DoModal Dialog box is getting Invoked even when the First DoModal is there.
How can I overcome this problem? Any Suggestions would be helpful.
Today is a gift, that's why it is called the present.
|
|
|
|
|
your editbox certainly has the focus, but without selection. isn't it what you want ?
if so, add a SetSel(0, -1); call after your SetFocus()
|
|
|
|
|
yes my edit box has the focus , but when I click other button its Onclick handler shouldnot execute as Is the Funtionality of the DoModal.i.e when we DoModal until we close the dialog no other function can be done on other windows.
I think you got my point
As I specified I have a main dialog box with two buttons.
On each button click iam invoking a DoModal Dialog Box.
When I click a button,Until I close the DoModal I cant click the Other button.
But for me I could click the Other button.
Today is a gift, that's why it is called the present.
|
|
|
|
|
can you please show a piece of code ? (don't forget to use the <pre> tag for code samples)
|
|
|
|