|
How can I change the title of the PropertyPage in a propertysheet. I mean the name of the tab. I tried with SetWindowText() but it doesn't work.
Thanks
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Get the tabcontrol of the propertysheet and set the text of the corresponding item whose text you want to change.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
A property sheet, when ran, consists of a property sheet object (the parent), a collection of property page objects (individual dialogs) and a tab control used to switch between the pages. During the first creation stage, the tab texts are taken from the dialog template titles. Changing these pre-build will alter the tab texts.
During run-time, you can change the title by first getting the property sheet object, then asking for the tab control via GetTabCtrl . A CTabCtrl class has a method called SetItem that takes the index of the page and a TCITEM structure.
Assuming in the following example, that m_wndPropertySheet was a pointer to CPropertyPage class, this code fragment will alter the text of the first tab
CTabCtrl* m_ptrTab = m_wndPropertySheet->GetTabCtrl();<DIV>
TCITEM ti;
ti.mask = TCIF_TEXT;
ti.pszText = "New tab text";<DIV>
m_ptrTab->SetItem( 0, &ti ); Hope this will help you out. Naturally, if you are unsure where the correct page is, you can use GetItem ínstead of SetItem to get the item's text and determining the index from there...
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hello everyone:
I have some big size text files, How to insert/delete some content of text file fastly?
Thank you
-Freehawk
|
|
|
|
|
I don't believe that there is some faster way how to insert/delete some data in the middle of the file, than moving data at the end of the file by blocks
(If you need to insert/delete blocks which size is exactly as big as size of allocation unit, you could do this by manipulating FAT/NTFS tables, but this is little but difficult
|
|
|
|
|
Thank you for the fast reply.
Is it really that there is no way to do faster?
Oh.
-Freehawk
|
|
|
|
|
You did not say how big the file is, but it is conceivable to read the file into a CString variable, make the necessary modifications, and write the CString variable back out to the file. Depending on how you want to alter the data, using a LPBYTE type instead of a CString object is also possible.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
how do you convert double to char? i mean to keep it the way it is as double for display.
exp: 3.5 will be 3.5 as char (maybe to CString or array since this is 3 characters)
|
|
|
|
|
CString str;
double dblValue = 2.25;
str.Format("%0.2f",dblValue);
Hope it helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
|
If you use CString to store the value, try the "format" method.
If you use char * , try to use "sprintf".
If the result will put into unicode string, try "swprintf"
Ellis Li
|
|
|
|
|
Hi,
In my application I get the recent opened file from m_pRecentFileList variable. Here is the code
CString the_File=(*m_pRecentFileList)[0];
OpenDocument(the_File);
In OpenDocument I have
pDoc->Load(CComVariant(lpszPathName));
Here it always fails.
But If I give the path directly,
ie CString the_File="c:\\text.abc"
It works fine.
Regards
Neha
|
|
|
|
|
Neha wrote:
pDoc->Load(CComVariant(lpszPathName));
what is the document type of pDoc?
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
pDoc is an XMLDocument object:
Here is the source:
IXMLDOMDocument *pDoc;
CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument, (void**)&pDoc)
|
|
|
|
|
Neha wrote:
OpenDocument(the_File);
Have you put a breakpoint on this statement to see the value of the_File ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi all,
For example &File. If you press Alt + 'F' the file menu opens. ... I would like the underline to always display
Thanks all
|
|
|
|
|
This is a new configurable setting of windows XP. You have to change the OS options under your display settings.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Roger Allen wrote:
This is a new configurable setting of windows XP.
It's also present in Windows 2000.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Is it possible to use C# controls in a MFC Dialog based application. I have a C# control of a fancy button, and want to add this button on the MFC Dialog. Any help in this context will be much appreciated.
Regards
|
|
|
|
|
Hi everybody, please tell me how to check a folder existed or not.
Ex:
BOOL CheckExistedFolder(CString strFolderName);
It returns
TRUE : Existed
FALSE : Not existed
Thank a lot !
nguyen_nd
|
|
|
|
|
Here you go.
bool dirExists
(CString strDirectory)
{
TCHAR* fullPath = _tfullpath (NULL, strDirectory, 0);
if (fullPath == NULL)
return (false);
TCHAR szCurrDir [_MAX_PATH];
_tgetcwd (szCurrDir, _MAX_PATH - 1);
long nStatus = _tchdir (fullPath);
_tchdir (szCurrDir);
free (fullPath);
if (nStatus == 0)
return (true);
return (false);
} /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
You can do a simple check like this
use
GetFileAttributes(..) to get the attributes of the folder, if you receive valid values that means that directory exits, elese its not there.
BOOL CheckExistedFolder(CString strFolderName)
{
if(GetFileAttributes(strFolderName) == INVALID_FILE_ATTRIBUTES)
{
return false;
}
else
{
return true;
}
}
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
You also might want to check the attributes for FILE_ATTRIBUTE_DIRECTORY to make sure it is not a file.
|
|
|
|
|
_access() , GetFileAttributes() , and CFile::GetStatus() are my favorites.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi..
i am using the frame grabber to capture the video..now i want to apply any compression on that video and save it in the remote computer.. how can i do this .. save in remote computer is possible in vc++, please help to slove the problem
Karthi
|
|
|
|