|
transoft wrote: I did not get solution from you.
Maybe not the solution you wanted, but I did explain what you need to do, part of which includes some research into fonts.
|
|
|
|
|
Hi,
I have a few property pages where I have collected all of the classes and implementation in one file (used the class wizard to do this).
On one of my property pages I get a strange run time exception on MS code in routine DDX_CBString.
I also noticed that the dialog "add variable" tool does not see any of the variables for the various resources (list boxes, comboboxes etc.) so it seems to be lost. Before this I noticed it would hang when I tried to create a variable for a resource or it reported file was read only. Also, I cannot add variables to new resources on this property page (wizard completes but variable not added to code).
I can delete all of my variables in the file and try to re-create them with the wizard but I thought I'd ask to see if anyone has experienced this.
Using VS 2005.
Thanks
|
|
|
|
|
al2500 wrote: On one of my property pages I get a strange run time exception on MS code in routine DDX_CBString.
An exception or an assertion?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I forget - bad pointer value.
I had to delete everything related to this property page and rebuild it - add variable wizard hangs even on startup.
|
|
|
|
|
I found a difference between a combobox data variable that works (in a different property page) and the one that gives an error.
The one that works uses -
DDX_Text
The one that has a run time error uses -
DDX_CBString
As far as I know all of the properties for the combobox are the same.
I looked these up in help and I can't tell why one would be used over the other but simply changing DDX_CBString to DDX_Text still results in a run time error.
modified on Tuesday, October 27, 2009 12:29 PM
|
|
|
|
|
It looks as though you are using a CString variable for your combobox instead of a CComboBox variable.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Yes CString,
I change the add wizard category to value vs. control since I don't need to control the resource.
Back to the wizard issue - I still got a "can't add/remove because class is read only" message when trying to add a variable but I restarted VS 2005 and it succeeded.
I noticed that when you use the class wizard to place multiple classes into one file it repeats the #includes at every class implementation and it also places a #include for the .h file with path.
I deleted all of these #includes except for the necessary ones at the beginning of the file and so far it seems to have helped but I can't be sure yet.
Just to be clear here is what you might see-
#include "stdafx.h"
#include "Myproject.h"
#include "c:/dir1/dir2/dir3/MyPropertySheetClass.h"
Perhaps the wizard gets confused by the multiple #includes or the inclusion of the path which appears to be unnecessary.
|
|
|
|
|
I would suggest that you try the following.
Close your project and exit visual studio. Then, delete any .ncb, .aps, or .clw file that you find in the project folders. Next restart visual studio and try again.
This sometimes can occur when the .ncb file becomes corrupted. Those files will be rebuilt as needed automatically.
Hope this helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I am currently developing an application using C++ and MFC. After gathering user data, it runs for a bit and produces its output in a separate window. I created this output window by deriving from the class CframeWnd and then defining CoutputWindow::OnCreate. I would consider this to be fairly standard.
It works and the output displayed is correct but I would the user to be able to highlight part or the entire window using his/her mouse and then type control-C to copy the highlighted text to the clip board. That part does not work. Is there an easy way for me to make this work? Did I make the wrong decision when I derived from CframeWnd? By any chance, is there a standard class in MFC that supports this feature with little or no additional work by the programmer?
Bob
|
|
|
|
|
I would suggest putting a ES_READONLY edit box in the floating output window, and putting text into that. Thena all the selection and cut and paste comes free.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Iain,
Thanks for the response. I added the flag ES_READONLY to the create call of the window. However, it did not have any effect. Here is what the code now looks like:
Create( NULL, TEXT("CtlDemo2"),<br />
WS_OVERLAPPEDWINDOW|ES_READONLY, rectDefault,<br />
NULL, MAKEINTRESOURCE( IDR_MAINFRAME ) );<br />
Is that what you meant? Is there something else I should do to make it work?
Thanks
Bob
|
|
|
|
|
BobInNJ wrote: I added the flag ES_READONLY to the create call of the window.
What type (i.e., class) of window?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
David,
The class of the window is COutputWindow (my class) and it is derived from CFrameWnd.
Bob
|
|
|
|
|
Those are MFC classes, not window (or system) classes. In any case, ES_READONLY is only for "Edit" classes.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
David,
Thanks for the response. Well, I guess using ES_READONLY will not work. Do you have a solution that will work for me?
Bob
|
|
|
|
|
BobInNJ wrote: Do you have a solution that will work for me?
Have you tried Iain's suggestion?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
David,
Thanks for the response. Please see my response to him in this thread.
Bob
|
|
|
|
|
David's right - you didn;t read my suggestion fully.
I could spell things out a bit more though.
I assume you need a frame to get the floating-ness, or dockaability. Or look at (eg) CControlBar , or CDialogBar .
Rather than just a Frame window, create a child window inside that frame. That child window should be an EDIT window, or a CEdit . ES_READONLY would be applicable then.
I hope that is clearer.
You can;t just use things blindly. If you don't know about ES_READONLY, then you should have looked it up on MSDN. There, it will tell you that it is an edit style. It's at best meaningless when used with another window. At worst, it could do something bad.
I hope that helps?
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Iain,
Thanks for the response. However, it does not help. I tried some of the things you suggested but it did not work. I would be happy to send you the code. I am still badly confused.
Bob
|
|
|
|
|
BobInNJ wrote: Did I make the wrong decision when I derived from CframeWnd?
Not exactly; but it is usually best to put a CView derived window in the client area of the Frame. I think that either CEditView or CRichEditView may provide what you are looking for.
|
|
|
|
|
Richard,
Thanks for the response. I tried using the class CEditView in a small test program and the small test program broke. As I understand it, the class CEditView is part of the Document / View model. The test examples that I have tried with the Document / View model did not seem to work or had issues. I am thinking that to change my code to use CEditView is going to be a major change. Do I have that right?
Bob
|
|
|
|
|
Think in more general terms.
CWnd wnd;
wnd.Create("Edit", "My Window", WS_VISIBLE, ...); You could also create a popup window by using CreateEx() instead. If that does not work, then use a dialog with an edit control on it.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
David,
Thanks for the response. However, it is not making sense to me. When I try these things, they do not seem to work. I am badly confused. I tried what you suggested but it did not work.
Bob
|
|
|
|
|
Hello,
I have made a window which is readonly but a cursor appears on the wondow . do i have to remove the cursor.
pritha
|
|
|
|
|
prithaa wrote: do i have to remove the cursor.
How are we to know that?
Do you ever turn the read-only style off? If so, have you considered using a static control instead? What if you disabled the control instead of making it read-only? Have you tried setting the focus to the next control?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|