Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Random function Pin
cmk5-Dec-05 20:18
cmk5-Dec-05 20:18 
QuestionHow do I put a Check box column into a data grid Pin
wdaliu5-Dec-05 13:14
wdaliu5-Dec-05 13:14 
QuestionError with templates Pin
ssn0015-Dec-05 13:00
ssn0015-Dec-05 13:00 
QuestionGet selected text from IE and Word Pin
Franc Morales5-Dec-05 11:45
Franc Morales5-Dec-05 11:45 
AnswerRe: Get selected text from IE and Word Pin
Sheng Jiang 蒋晟5-Dec-05 18:32
Sheng Jiang 蒋晟5-Dec-05 18:32 
GeneralRe: Get selected text from IE and Word Pin
Franc Morales5-Dec-05 19:00
Franc Morales5-Dec-05 19:00 
QuestionCtrl + Tab => next Page Pin
WernerP5-Dec-05 10:15
WernerP5-Dec-05 10:15 
QuestionProperty Page Tab titles Pin
code dope5-Dec-05 9:22
code dope5-Dec-05 9:22 
I'm having real problems getting titles onto the tabs of a multi page Property Sheet.

I'm creating several pages dynamically in the Prop Sheet's constructor which are the names of all the ini files in a folder, as below:

However, the titles do not appear on the tabs and the only way I can get them on is to hard code them, instead of the line which assigns the title e.g pPage->m_psp.pszTitle = "Page Title";

Iv'e tried casting the strFound variable to (LPCTSTR) but stil no joy although this shouldn't be necessary.

Kind of defeats the idea of doing stuff dynamically!

Any help would be really appreciated - I've been round and round in circles on this!

Many thanks.


[I]if( GetCurrentDirectory( 256, (LPSTR) szCurrentDir ) != 0)
{
strFile.Format("%s%s", szCurrentDir, "\\system\\*.ini");
CFileFind finder;
BOOL bResult = finder.FindFile( strFile, 0 );

// get any ini file names...
while( bResult )
{
bResult = finder.FindNextFile();
// we don't want folders...
if( finder.IsDots( ) )
continue;

// get the file name...
CString strFound(finder.GetFileName());
// remove the extension...
strFound.Delete( strFound.GetLength()-4, 4);
// create a new property page...
CDiaryPage* pPage = new CDiaryPage( strFound );
// set its attributes...
pPage->m_psp.dwFlags = PSP_USECALLBACK | PSP_USETITLE | PSP_HASHELP;
// and give it its title...
[U]pPage->m_psp.pszTitle = strFound;[/U]

// then add it to the sheet...
AddPage( pPage );
}
finder.Close();
}[/I]

code dope.

Life's like a sh*t sandwich - the more bread you got, the less sh*t you gotta eat!
QuestionRe: Property Page Tab titles Pin
David Crow5-Dec-05 9:47
David Crow5-Dec-05 9:47 
AnswerRe: Property Page Tab titles Pin
PJ Arends5-Dec-05 14:54
professionalPJ Arends5-Dec-05 14:54 
Questionerror C2228: left of '.ShowWindow' must have class/struct/union type Pin
newbie53455-Dec-05 9:14
newbie53455-Dec-05 9:14 
AnswerRe: error C2228: left of '.ShowWindow' must have class/struct/union type Pin
Maximilien5-Dec-05 9:39
Maximilien5-Dec-05 9:39 
GeneralRe: error C2228: left of '.ShowWindow' must have class/struct/union type Pin
newbie53455-Dec-05 10:01
newbie53455-Dec-05 10:01 
GeneralRe: error C2228: left of '.ShowWindow' must have class/struct/union type Pin
Maximilien5-Dec-05 10:19
Maximilien5-Dec-05 10:19 
GeneralRe: error C2228: left of '.ShowWindow' must have class/struct/union type Pin
newbie53455-Dec-05 11:03
newbie53455-Dec-05 11:03 
GeneralRe: error C2228: left of '.ShowWindow' must have class/struct/union type Pin
toxcct5-Dec-05 22:38
toxcct5-Dec-05 22:38 
QuestionRe: error C2228: left of '.ShowWindow' must have class/struct/union type Pin
David Crow5-Dec-05 9:40
David Crow5-Dec-05 9:40 
AnswerRe: error C2228: left of '.ShowWindow' must have class/struct/union type Pin
newbie53455-Dec-05 10:02
newbie53455-Dec-05 10:02 
GeneralRe: error C2228: left of '.ShowWindow' must have class/struct/union type Pin
David Crow5-Dec-05 10:39
David Crow5-Dec-05 10:39 
GeneralRe: error C2228: left of '.ShowWindow' must have class/struct/union type Pin
newbie53455-Dec-05 11:02
newbie53455-Dec-05 11:02 
Questionnmake launches Visual Studio 2003 Pin
Ian Bowler5-Dec-05 8:35
Ian Bowler5-Dec-05 8:35 
QuestionLooking to learn Pin
geniusintraining5-Dec-05 8:16
geniusintraining5-Dec-05 8:16 
AnswerRe: Looking to learn Pin
Bob Stanneveld5-Dec-05 9:37
Bob Stanneveld5-Dec-05 9:37 
QuestionControl Messges to Parent?? Pin
SublimeRide5-Dec-05 7:26
SublimeRide5-Dec-05 7:26 
QuestionRe: Control Messges to Parent?? Pin
David Crow5-Dec-05 7:51
David Crow5-Dec-05 7:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.