|
No, I suspect you'll need to use a rich edit. To use one, don't forget to call AfxInitRichEdit(); in your constructor, and definately read your MSDN, they are odd beasts.
Reality check here - why do the Redmondians require me to call AfxInitRichEdit(); ??? Is there a possibility I put a rich edit in my dialog because I DON'T want it to work ?????
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
> do the Redmondians require me to call AfxInitRichEdit();
Because you need to load the DLL that contains rich edit control. RichEdt32.dll. AfxInitRichEdit() takes care of that for you.
Peace!
-=- James.
|
|
|
|
|
I see - you're contending that there is a possibility I will want to put a rich edit in my dialog but NOT load the dll ? Why don't all the common controls give me this amazing functionality then ?
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Use rich edit instead and on the codeguru.com in the Edit Link, there are 4 very good samples, check them.
|
|
|
|
|
Hello.
I created a dialog based application using VC++6.0. In the main dialog properties, I chose no
title bar (which means no system menu). When I run the application, the taskbar shows a blank rectangle
for the application. I would like it instead to show an icon and the application title like any other regular
program. Any ideas on how to fix this? I'd appreciate any help.
Thank you.
-Jake
|
|
|
|
|
Hello.
I created a dialog based application using VC++6.0. In the main dialog properties, I chose no
title bar (which means no system menu). When I run the application, the taskbar shows a blank rectangle
for the application. I would like it instead to show an icon and the application title like any other regular
program. Any ideas on how to fix this? I'd appreciate any help.
Thank you.
-Jake
|
|
|
|
|
You can use SetWindowText() to essentially reinstate the Caption text that was nuked when you removed the Title Bar. Not sure about the icon - thats linked to the System menu. Guess you could draw it yourself, or allow the Title bar and System menu then just remove menu entries programmatically, say in OnInitDialog:
CMenu * menu = GetSystemMenu(0);
menu->DeleteMenu(3, MF_BYPOSITION);
menu->DeleteMenu(2, MF_BYPOSITION);
menu->DeleteMenu(1, MF_BYPOSITION);
menu->DeleteMenu(0, MF_BYPOSITION);
Note that this also disables the close button, if shown. I've read of another way where you just modify the style bits removing WS_SYSMENU in PreCreateWindow() , but I am not sure it works for dialogs, and would probably kill the icon anyway.
|
|
|
|
|
I have disabled the Edit control and I want the Font of the Content in the control to be changed.
As I have made it Read only the content in the Control is not clear hence the need.
|
|
|
|
|
2 things
1). use m_edit.SetFont(...) if you have a control variable of type ceditctrl mapped to the edit control
2). instead of disabling the edit control (it greys out) try setting it to read only instead (m_edit.SetReadOnly(TRUE)
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
newbie question
dialog based prog created file using CFile but cant write to it how do i write data from edit box to file
msvc+ 6.0 modal dialog prog
thanks to all for the help
|
|
|
|
|
get the data from the edit box into a cstring (using UpdateData(FALSE) or m_editbox.GetWindowText(...)) and then write the cstring to the file using CFile.Write(m_cstring)
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
newbie question
dialog based prog created file using CFile but cant write to it how do i write data from edit box to file
msvc+ 6.0 modal dialog prog
thanks to all for the help
|
|
|
|
|
newbie question
dialog based prog created file using CFile but cant write to it how do i write data from edit box to file
msvc+ 6.0 modal dialog prog
thanks to all for the help
|
|
|
|
|
newbie with question
dialog based prog,i created a file using CFile now i want to write text and append how do i do this try and keep it as simple as possible
thanks to all who have helped me
|
|
|
|
|
Dear all,
If I have two window dialogs opening, say, A and B.
And if A is activating, I want that in A::OnOK(), it can call a function in B, say B::bfunction(). However, there is some CWnd function, e.g UpdateData(), SetForeGroundWindows(), SetWindowText() etc...included in the bfunction(), then it will fail in run time..
A::OnOK()
{
B dlg;
dlg.function();
}
Can I know how to solve it?
My target is, when A is activating, if the user press OK, then the B dialog will bring to top and A will call the B's function.....and then close A dialog.
Please help! Thanks a lot!!!
|
|
|
|
|
However, there is some CWnd function, e.g UpdateData(), SetForeGroundWindows(), SetWindowText() etc...included in the bfunction(), then it will fail in run time.
That's because the dialog isn't created until you call b.DoModal() or b.Create(). Just creating the C++ object doesn't create the dialog, so any functions that operate on the dialog via its HWND will fail.
--Mike--
http://home.inreach.com/mdunn/
I'm finger-lickin' good!
|
|
|
|
|
QUESTION on message pumping:
I have posted this a while back. But I hope to confirm my understanding is correct:
QUESTION 1:
What generates the BN_CLICKED message when a user click a mouse button over a button? Is the following description correct?
1. The user clicks a mouse button.
2. The mouse driver puts an item into the system input queue.
3. A system thread, which handles user input, retrieves this item and, using coordinates recorded by the driver, determines to which window this message
should be posted. Mouse messages are always sent to the window under the cursor (unless another window has captured mouse input).
Given the window handle the system detemines the thread to which this window belongs and posts WM_LBUTTONDOWN and WM_LBUTTONUP messages to the
message queue of this thread. Note, the message is posted to only one message queue since the system knowns to which thread the window belongs.
4. The application object, derived from CWinApp, will pickup the message from its thread message queue. Then route this message to the appropriate controls/windows.
5. Button window procedure receives WM_LBUTTONUP message and do the following:
(i) update the display of the button (depressed state and then the release state.)
//QUESTION: SendMessage( ) OR PostMessage( )??
(ii) sends WM_COMMAND/BN_CLICKED notification to "the parent window" or a "particular" control.
(iii) posts WM_COMMAND/BN_CLICKED notification to the application/thread message queue
6. Message map can be "expanded" to a subroutine that searches the message map upon reciept of a message/notification, then route the message to "appropriate" message handler in response a mapped message.
(This brings up the issue of message routing. ie. Things like searching the view class maps, then the document class, then the frame windows, then the app...)
QUESTION 2:
Quote from MSDN:
[OPEN QUOTE]
"This message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
WM_COMMAND wNotifyCode = HIWORD(wParam); (EXAMPLE: BN_CLICKED??)
wID = LOWORD(wParam);
hwndCtl = (HWND) lParam; (WHY DO U NEED HANDLE WHEN CONTROL IDENTIFIER IS PROVIDED - wID ??)
"
[CLOSE QUOTE]
(1) When a button is clicked, is a WM_MESSAGE sent (or posts) to its parent window? or to its parent window's message queue? or to its parent's window procedure?
(2) Which parent? Immediate or top level in the hierachy?
(3) When a button is clicked, is a WM_MESSAGE (with BN_CLICKED as wParam) sent or is a BN_CLICKED messages sent?
(4) Does "notification" messages and "messages" refer to the same thing?
Thanks.
|
|
|
|
|
I guess the reason your message has gone unanswered is that its tough to answer - here's just a couple of thoughts...
First, there's a mix of win32 messaging architecture and MFC here - MFC has a way cool way of allowing you to map command messages to classes that you wouldn't ordiarily expect to get them (i.e. have no hwnd), and this mech is the stuff of DiLascia-like articles in itself, but I would think we should get the win32 stuff nailed down first.
Second, a recommendation - I've been struggling lately with a messaging problem that has me baffled - I picked up Jeffrey Richters book 'Advanced Windows' to check out his chapter on Windows Messaging and Asychronous Input - I think now I better read the whole book! You might want to check it out.
There's so much to look at here - just hard to do all at once. HTH
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
I want to set Check Sign inside text in menu.
My program is in dialog based mode.
void CTestglobalDlg::OnUpdateKhar(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(TRUE);
}
So, please say to me, how can i set dynamicaly check sign ...
Hadi Rezaie
|
|
|
|
|
<<< In the name of GOD >>>
There is an article on Codeproject on doing this in a dialog app, I remember seeing it.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
I want to set Check Sign inside text in menu.
My program is in dialog based mode.
void CTestglobalDlg::OnUpdateKhar(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(TRUE);
}
So, please say to me, how can i set dynamicaly check sign ...
Hadi Rezaie
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
I want to set Check Sign inside text in menu.
My program is in dialog based mode.
void CTestglobalDlg::OnUpdateKhar(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(TRUE);
}
So, please say to me, how can i set dynamicaly check sign ...
Hadi Rezaie
|
|
|
|
|
i am writing an audio codec as part of a larger project. it involves playing etc of wave and mp3 files. i am using a class that simplifies the use of idirectsound for wave and xaudio.lib for the mp3s. in the test file (dialog based) i have written my class works fine but when added to a console application it won't play anything or it is not outputting sound
can anyone shed any light on this matter?
can dsound.lib be used in a console based app or only dialog based?
thanks
ruth
|
|
|
|
|
Hi,
I am trying to compile and link a workspace for a dll which has
only resource files. Before it used to complie and link..
I changed a a bitmap file by just replaing it with a new one
with the same name..
After that whenever i try to build, i get the following errors:
"CVTRES : fatal error CVT1106: cannot write to file"
"res32.res : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt"
I cleaned and tried to rebuild all, also tried restarting the machine.
Still the same error is being displayed.. can anybody suggest me to avoid
this error? The recent bitmap opens perfectly in mapaint or vc editor..
Regards,
Nayan
|
|
|
|
|
have you tried deleting the output directory completely (ie, debug or release) ?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|