|
Check if in the resource.h header file you have that ID.
And if in the header of your Dlg class you have the include of the resource.h
Cheers!!!!
Carlos Antollini.
|
|
|
|
|
The ID's are in resource.h, which is included only in my CWinApp-derived class. The app's header is included automatically in every cpp file in the project. So, when I compile the class in question, it picks up the include and works fine, but when I build the project, it apparently looks at the headers first and gives me trouble. should i include the app's header in the problem header, instead of in it's cpp file?
|
|
|
|
|
First. Try to include the header in the header of the class dialog.
Second. Check if the value of IDD_DIALOG1 is correct, or if is dupplicated.
If the problem persist, try to sen me the project by mail.
Good luck!!!!
Carlos Antollini.
|
|
|
|
|
I am using a printer outside the Framework.
I declare a variable to hold a RecordSet Field:
CString m_MyCString;
I set the variable to the record set field:
m_MyCString = m_pSet->m_MyStringField.
All is OK so far.
After I start the document:
if (pDC.StartDoc(&pMyDoc)>0)
{
etc.
}
the CString variable m_MyCString gets changed to a different value.
Duh!!
Richard
|
|
|
|
|
i have set the transparent check box in the properties of the control but i still have a white background on the list control
how can i make the list box trasparent or change all the background to the color of the dialog box.
thank you
|
|
|
|
|
|
He also has to make it owner draw too, doesn't he?
|
|
|
|
|
He also has to make it owner draw too, doesn't he?
Have no idea - it depends how Windows draws items in the listbox. If DC has no TRANSPARENT bkmode set, he'll have to go ownerdraw.
The easiest solution would be switching to CListCtrl and using CListCtrl::SetBkColor and CListCtrl::SetTextBkColor.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I've got an very urgent question.
I want to get the Serialnumber of a Disk (Floppy Disk, Hard Disk (IDE &
SCSI), CD,...) into a CString (- the disk where my program is saved).
I've only found Source Code for IDE Hard Disks.
Is there an API function to get the number.
(There is one in VB.)
Gerhard
|
|
|
|
|
|
Does anybody know how to insert a new line
into a CRichEditCtrl/View?
for example like this:
rectrl.InsertText("\nnew line\");
thanks in advance
|
|
|
|
|
Use CRichEditCtrl::ReplaceSel. If there is no current selection, the replacement text is inserted at the insertion point, that is, the current caret location.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
is it no something weird like,
two carriage returns and then a line feed.....
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
Can you please tell me what's wrong with this code:
CMyRichEditView *pView;
CRichEditCtrl& pCtrl = pView->GetRichEditCtrl();
pCtrl.ReplaceSel("\r\r\ntest");
I get a debug assertion in the third line.
thanks
|
|
|
|
|
I've never used a RichEditCtrl before, so I might be wrong, but it looks like you're declaring a pointer and never constructing it, so pCtrl is probably NULL or invalid somehow. Something like that
Jake
|
|
|
|
|
Yes, it seems to be NULL, by why?
|
|
|
|
|
If you have a Assertion is because your code didn get the RichEditCtrl.
In others words pCtrl is NULL.
Do you really have the view of the richedit?
Best Regards!!!
Carlos Antollini.
|
|
|
|
|
That's a good question.
I thought this is the correct way to get the CRichEditCtrl of a CRichEditView.
|
|
|
|
|
How you get the view of the richEdit?
You made something like this?
CRichEditCtrlView* pView = (CRichEditCtrlView*)GetDlgItem(IDC_RICHCTRL);
I saw taht you get the view from a derived class or from your own class of RichEditView I think that the problem start there....
Carlos Antollini.
|
|
|
|
|
NO, the other way round
I want to get the control from my SDI-application, which has a CRichEditView class
|
|
|
|
|
Have a look at the Wordpad example and all your problems will be solved.
Question: What does pView point to????????
Exactly so how can you call GetRichEditControl?
|
|
|
|
|
I think this is the problem.
pView points into nothing
I changed the code to
CMyRichEditFTPView *pView = (CBMyRichEditDoc*)GetView();
CRichEditCtrl& pCtrl = pView->GetRichEditCtrl();
pCtrl.ReplaceSel("\r\r\nTest");
But the compiler says that GetView() ist an undefined expression (or something like that, I have the german visual c++), although it is defined in the MSDN as follows:
CRichEditDoc::GetView
I'm totally confused now
|
|
|
|
|
You are a little confussed.
The getView is for get a view pointer from the RichEditDoc.
Please read how you can get a good view from a RichEdit Using the GetDlgItem function. I put an answer before.
After that you can get a pointer to the CRichEditCtrlCtrl
Regards!!!
Carlos Antollini.
|
|
|
|
|
In what class is this code?
|
|
|
|
|
It is in the MainFrame class of my SDI appliction, and all I want to do is to insert a line into the CRichEditView
|
|
|
|