|
Hi John,
It has some reason.
1- I want to learn!
2- Customize my needs!
3- Add extra functionality, GUI, charting and ...
Thanks, A. Riazi
|
|
|
|
|
how to disable button on CDlgBar?
I tested this member function
button.EnableWindow(FALSE);
sleep(5000)
this code operate only 5 second
if erase sleep(5000)
code does not operate(exactly speaking... operate 0.001 second?)
I test other formview button
formviewbutton.EnableWindow(FALSE)
is operate correctly...
what's problem CDlgBar?
gjun@netian.com
|
|
|
|
|
How did you declare the button ? If it is declared as a local variable in a function, it will vanish as soon as you leave it. Try out with a member variable.
~RaGE();
|
|
|
|
|
member variable ...
not local variable
and not vanish button.......
I cannot disable button...
|
|
|
|
|
Does it matter if I call the base class first then put in my code, or should the base class call be last. VS does say place your code here...sometimes before and sometimes after, but I just noticed that in some places, the order is not enforced by the person who wrote the sample, yet it still works. Is this dangerous?
void CBKView::OnInitialUpdate()
{
<code>CFormView::OnInitialUpdate();</code>
ResizeParentToFit();
m_FirstSearchKeyInMenu = "None selected";
}
or
void CBKView::OnInitialUpdate()
{
ResizeParentToFit();
m_FirstSearchKeyInMenu = "None selected";
<code>CFormView::OnInitialUpdate();</code>
}
Appreciate your help,
ns
|
|
|
|
|
It mainly depends on the function. In the example you showed, it could matter if you are doing changes on what is done in the base class function, which is almost unprobable. So changing the order is rather harmless. But look at the following example :
CMyDialog::OnOK()
{
...
pWApp->WriteProfileInt("Settings","Window width",m_width);
CDialog::OnOK();
}
compared to
CMyDialog::OnOK()
{
...
CDialog::OnOK();
pWApp->WriteProfileInt("Settings","Window width",m_width);
}
In the first case, you write settings in the registry before calling the base class function. In the second case, you do it after, and your settings are never saved, since CDialog::OnOK() close the window.
In some overrided, you have to comment out the call to base class, for example to change the cursor in OnSetCursor, otherwise your changes won't apply.
I would recommand you to insert your code where the comments invite you to do it, unless you're absolutely sure of what you're doing.
~RaGE();
|
|
|
|
|
I looked up OnSetCursor and saw where you say you shouldnt call the base class.....
The registry example also makes things really clear!
Appreciate your help,
ns
|
|
|
|
|
From a CP article by Brian Hart he has the following:
void CMainFrame::RecalcLayout(BOOL bNotify)
{
CWnd* pClientWnd = CWnd::FromHandle(m_hWndMDIClient);
<code>
pClientWnd->SendMessageToDescendants(WM_SIZEPARENT,
0, 0, FALSE, FALSE);
CMDIFrameWnd::RecalcLayout(bNotify);
}
Its used in:
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CMDIFrameWnd::OnSize(nType, cx, cy);
RecalcLayout();
}
The comment
<br />
worries me.
It seems to work but is it not reliable? Any suggestions/improvements/comments?
Appreciate your help,
ns
|
|
|
|
|
hello!
i have two CStrings:
<br />
CString str1;<br />
CString str2;<br />
I want to combine them:
<br />
CString together;<br />
together=str1+str2;<br />
but between the strings must be a return, because i want to fill the CStrings together into a .txt-file and there must begin a new line, when the second CString is added.
someone in this forum said that in this case you can do this:
<br />
together=str1+0X0A+0X0D+str2<br />
but it does not work.
can someone help me???
thank you
lucky
|
|
|
|
|
|
You need to do this:
together=str1 + CString("\n") + str2
or this:
together.Format("%s\n%s", str1, str2);
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
John Simmons / outlaw programmer wrote:
together=str1 + CString("\n") + str2
Why do you need the CString() called for "\n" ? It's only CString objects, so a simple "\n" should work, in contrast to f.i. LPTSTR used. Or am I wrong?
|
|
|
|
|
great!! thank you very much!
you are not wrong.....it works, too.
lucky
|
|
|
|
|
Because there's a bug in CString where if you add a single character to a string like this:
CString sString = "Test";
sTest += "\n"
sTest = sTest + "\n"
running the program in release mode will generate a memory corruption error (in debug it will work fine). It's a bug in the CString class, and you can find it in the MFC source if you look hard enough.
I don't know if this bug has been fixed in versions of MFC later than 4.2...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
great!! thank you very much!
lucky
|
|
|
|
|
How can we redirect user I/O to a temporary ‘buffer’ space so that all changes are written to the buffer space during the current session. When the computer is rebooted, the I/O reads should be
redirected back to the original file location and all changes made in the previous session
are discarded.(ie. after logg off/reboot)
|
|
|
|
|
You actually think you'll get any more answers if you ask the same question multiple times? Wrong. The more times you ask the same question, the more annoying you'll be percieved.
Disregarding the fact that your both ignorant and annoying, what you say you want to do can't be done. Period.
If you want a "restartable" machine, use something like VMWare.
No please stop asking this question.
|
|
|
|
|
I remember to have once seen an ad for some piece of hardware doing this: It basically was a modified HD-adapter which was before booting cloned a hidden partition onto the work partition. So you had the same setup at every boot.
Great for schools or public computers.
Hope this helps, and you can stop to repeat your postings.
Please do not ask me for a website or more special info, as I do not know any more.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
can anyone help me in putting something to the subject and body of your default mailer. i.e. suppose I have Microsoft outlook and if I want to send a mail through my program I will do it thru ShellExecute..but is there any way likt this only..to write the data into subject and body of new mail message..like send this to a friend and you want the stuff wrote but not the email id. For email Id you will write mailto:email and this will do the work will open a new mail message with the mail id. How to write subject and body of this mail..not into to: field...any help and pointers are surely appreciated..any opinions..please..
thanks in advance..
Himanshu
|
|
|
|
|
Already tried DDE ?
~RaGE();
|
|
|
|
|
thanks rage..but can you give some example..so that I can understand better..
thanks a lot..
Himanshu
|
|
|
|
|
Well, you can surely send DDE orders to the Outlook App. DDE are orders like "File""Open" and so on. If you do not want to automate your Outlook, you could use something like "New Mail","tab","tab",put your object text in clipboard,"Paste",put your msg in clipboard,"tab","Paste".
Look ata DDE in the MSDn, and in the CWinApp API.
~RaGE();
|
|
|
|
|
Hello all,
Does anyone of you know of a simple class to encrypt my password before I write it to a file? And of course decrypt it again so I can use it
I had a look at the 2 articles in system/cryptography, but they don't fit my needs.
I also looked at an app using crypto++[^], but that seemed like a bit of overkill too.
So basically I'm looking for a simple class that encrypts/decrypts my password using whatever algorithm (MD5, PKI, ...). Or any pointers how I can start my own class.
tia
Wim
|
|
|
|
|
Wim Jans wrote:
Does anyone of you know of a simple class to encrypt my password before I write it to a file? And of course decrypt it again so I can use it
Cryptography isn't simple. Period.
If you had a look at some real cryptography but you deemed it "a bit of overkill", perhaps what you want isn't anything cryptographically safe? What about xor'ing the password with some known value and the just hash it? Maybe even a plain SHA or even a CRC32 could be fine...
|
|
|
|
|
Hi Mike,
Thanks for the answer. I will have a look at the CRC32 or SHA stuff.
With 'a bit of overkill' I meant that they offer a wealth of encryption algorithms in one library, while I just needed one.
So it would be nice of one had a class with only eg. a MD5 algorithm in it.
Thanks again
Wim
|
|
|
|