|
If u want to enable or disable the button from toolbar then use EnableButton().
e.g
CToolBar m_wndToolBar;
...
..
..
CToolBarCtrl& tbctrl = m_wndToolBar.GetToolBarCtrl ();
if(..)
tbctrl.EnableButton (ID_FILE_NEW,TRUE); // to enable
else
tbctrl.EnableButton (ID_FILE_NEW,FALSE); // to disable
Regards
Amar
|
|
|
|
|
See here if its good for you
<br />
m_wndToolBar.GetToolBarCtrl().SetState(ID_FILE_NEW,TBSTATE_ENABLED);<br />
m_wndToolBar.GetToolBarCtrl().EnableButton(ID_FILE_NEW,FALSE);<br />
|
|
|
|
|
Hi all,
In an SDI APP i am using a modeless dlg. I am creating the dlg in view class.
In view class im using a LinkList .
Now the Problem is i need to access the LinkList from the dlg . while Accessing the LinkList fn(append, del,...) I got an run time access violation
and then the application terminates.
How to resolve this problem.
any body knows...
by
GAN.
|
|
|
|
|
Try passing a pointer of your application to the dialog.
In the dialog you can create a pointer of your parent class and access the variables/member functions of the parent class with the help of that pointer.
You can do this:
in the dialog declare a pointer of view in the header file
CMyParentView *pView;
Now when you are creating the dialog
CMydialog* pMyDlg=new CMyDialog();
pMyDlg->pView=this;
pMyDlg->DoModal(); // Or in whatever manner you are creating the dialog.
In the dialog you can then access the member variables of the view like
pView->myLinkedList.///////Somecode or function here
Try this.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thank you for suggession
when including view.h in dlg.h it got some error
so i shifted mylinklist to doc class
now it workes well
thank u once again for ur reply
|
|
|
|
|
|
Assume that each line of file have data as
aaaaa,bbbbb,ccccc,ddddd,eeeee,............
if want to keep the data of each part to variable such as
str1=aaaaa;
str2=bbbbb;
.......
What is the function or class that support this issue.
If not,Please give me a concept for write it.
Thanks
|
|
|
|
|
Read the data into a CString variable and then tokenize the string using
CString::Tokenize() using "," that seperates the values from each other.
Store each string in different one
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
The concept is called tokenization[^]. Take a look at the strtok function. It is easy to write one, at least to cope with the simple case described here.
The idea is search the source string for the first occurance of the separator. Your first part is the substring from the start until the character before the first separator. The "new start position" is now the character after the separator. Repeat the search from the new start position for the next separator.
Graham
My signature is not black, just a very, very dark blue
|
|
|
|
|
See
CString strextra;
int nPos=0;
CStringArray array;
CString str="aaaa,bbbb,cccc,dddd,eeee,ffff";
if(str[str.GetLength()-1]!=',')
str.Insert(str.GetLength(),",");
while (str.GetLength()!=0)
{
nPos = str.Find(",");
strextra= str.Left(nPos);
array.Add(strextra);
str.Delete(0,nPos+1);
}
</code>
|
|
|
|
|
Hi all,
I am in a task of making a Registry Cleaner.
But I hve some questions to be answered about this project. Those are
1) What are the steps involved in Registry Cleaning ?
2) What all can be cleaned ?
3) What all should not be done ?
4) How do we clean a particular Key ?
5) What are the different operations involved ?
6) Do we have the technology to implement all the operations ?
7) Can we automate all the operation if you have a database of
things to be cleaned?
8) Where do we get the list of database of things to be cleaned ?
Please Help me.
Thanks in Advance
George K Jolly <georgekjolly@yahoo.com>
|
|
|
|
|
Seehere[^]if its good for you
|
|
|
|
|
hello everyone,
I have a small problem in VC++.i want to get the index value for the tree item of a tree control.i have used the class CTreeCtrl class but i couldn't find any method which returns the index value.
so quickly help me with a solution
sathish
|
|
|
|
|
See CTreeCtrl::GetSelectedItem
|
|
|
|
|
I think there is no functions are avaliable for that.
You should iterate your tree items with GetNextItem() method.
Just try...
|
|
|
|
|
A tree control item doesn't have an index, since the tree doesn't represent a simple linear list. Each item in the tree has a handle. Using that handle, there are methods provided by the CTreeCtrl that you can use to change the item itself, get the child items, and so on.
Software Zen: delete this;
|
|
|
|
|
GetChildItem and related SiblingsApi
"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
|
|
|
|
|
Is there any rotatable tracker to use?
My current app needs it.
thx for any link and clue.
|
|
|
|
|
I don't know what you mean by "rotatable tracker"... could this imply that I am unable to help you?
|
|
|
|
|
This is not really a problem, just wondering if anybody else has encountered the same problem and how they deal with it. I use VC6 to code multilingual programs (English and Chinese simplified). I usually use the built in resource editor to create the dialogs/menus along with their text.
Here is where I usually encouter problems. The editor allows for the input of Chinese characters, though after compilation the exe incorrectly displays them. My way of rectifying the problem is to open the *.rc file in a text editor (UltraEdit) convert to unicode and save (though now VC6 reports it as being damaged), build clean, and no problem.
Is there a simpler way of doing this? Maybe I should also point out that I create a MBCS build and that the final build must be win98 compatible.
|
|
|
|
|
Open the .rc file as text, and in all your dialog resources, do this:
Change DIALOG to DIALOGEX
Change the FONT to "MS Shell Dlg"
Add the DS_SHELLFONT style
The VC6 resource editor predates these features, so you will have to re-do them after editing a dialog in the editor. Usually only the DIALOGEX part will be undone, so a simple search and replace of "DIALOG " with "DIALOGEX " (note trailing spaces) will fix it right up.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thanks for that tip, works like a charm.
|
|
|
|
|
waldermort wrote: the final build must be win98 compatible.
Have you tried running it? W98 doesn't support Unicode programs so you need to use the MSLU.
RC files can be (IIRC) in UTF-8.
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.3 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Thanks for the info. As stated in the origional post, this is not a Unicode build. Reencoding the resource file to UTF8 didn't solve the problem. The editor was able to open it, but the characters were still distorted.
|
|
|
|
|
Hi,
I have made a Project derived from CRichEditView and I want to paint the Client-Area.
The painting works perfectly there, is no flickering at all but there is a problem with the caret and the displayed signs. The caret appears completely strange and the displayed signs are not visible.
Here is all I added to my project:
BOOL CRichEdit2View::OnEraseBkgnd(CDC* pDC)<br />
{<br />
<br />
COLORREF crFgcol = 0, crBgcol = RGB(209,255,176);<br />
CRect rect;<br />
GetClientRect(&rect);<br />
<br />
CDC dc;<br />
dc.CreateCompatibleDC(pDC);<br />
<br />
<br />
CBitmap bmp;<br />
CPen pen;<br />
bmp.CreateCompatibleBitmap( pDC, rect.Width(), rect.Height() );<br />
pen.CreatePen( PS_SOLID, 1, crFgcol );<br />
CBitmap *pOldBitmap = dc.SelectObject( &bmp );<br />
CPen *pOldPen = dc.SelectObject( &pen );<br />
<br />
<br />
<br />
dc.FillSolidRect( &rect, RGB(255,255,255) );
CRect rcBar(rect);<br />
rcBar.top = 100;<br />
rcBar.bottom = 120;<br />
<br />
dc.FillSolidRect( &rcBar, crBgcol );
dc.MoveTo( rect.right - 1, 0 );<br />
<br />
pDC->BitBlt( 0, 0, rect. right, rect.bottom, &dc, 0, 0, SRCCOPY );<br />
dc.SelectObject( pOldBitmap );<br />
<br />
dc.SelectObject( pOldPen );<br />
return TRUE;<br />
}<br />
<br />
HBRUSH CRichEdit2View::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)<br />
{<br />
pDC->SetBkMode(TRANSPARENT);<br />
return NULL;<br />
}<br />
<br />
void CRichEdit2View::OnPaint()<br />
{<br />
CPaintDC dc(this);
}<br />
I would be really happy if someone has an answer for me
|
|
|
|