Click here to Skip to main content
15,925,181 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Retrieve FDT(File Directory Table) for specific folders!! !! Pin
Maximilien12-Jan-05 0:41
Maximilien12-Jan-05 0:41 
QuestionHow to seek >2gb files with fseek? Pin
IGx8911-Jan-05 12:07
IGx8911-Jan-05 12:07 
AnswerRe: How to seek >2gb files with fseek? Pin
basementman12-Jan-05 4:09
basementman12-Jan-05 4:09 
GeneralRe: How to seek >2gb files with fseek? Pin
IGx8912-Jan-05 4:54
IGx8912-Jan-05 4:54 
GeneralAccessing IwebBrowser2 outside toolbar class Pin
tnguyen44411-Jan-05 11:17
tnguyen44411-Jan-05 11:17 
GeneralSerial com port communication! Pin
Member 162670711-Jan-05 10:37
Member 162670711-Jan-05 10:37 
GeneralRe: Serial com port communication! Pin
Gary R. Wheeler11-Jan-05 10:48
Gary R. Wheeler11-Jan-05 10:48 
GeneralCTabCtrl and TCIF_PARAM ( brain dead q. of the day) Pin
Maximilien11-Jan-05 10:34
Maximilien11-Jan-05 10:34 
I need to pass a small user data to each tab I create in my tab control.

I do something like :

 ...
typedef struct Dummy
{
 CString s;
} MaxDummy;
...
TCITEM tcItem;
tcItem.mask = TCIF_PARAM| TCIF_TEXT;
tcItem.pszText = _T("Allo");
tcItem.cchTextMax = 255;
tcItem.iImage = 0;
MaxDummy* p = new MaxDummy;
p->s = _T("Salut");
tcItem.lParam = (LPARAM) p;
m_TabCtrl.InsertItem( 0, &tcItem );


the question related to the GetItem ... in MSDN, it says that I need to create a different structure than TCITEM ( see CTabCtrl::GetItem At MSDN[^] )

I don't understand what they mean by that ? is it if I need to pass 2 values to the lParam ?

if I create my own struct and "new" it, and pass the pointer to the lParam, is that sufficient ?

...
 TCITEM tcItem; 
 tcItem.mask = TCIF_PARAM;
 tcItem.cchTextMax = 0;
 tcItem.pszText = NULL;
 tcItem.lParam = NULL;

 (void)GetItem(0, &tcItem);
 MaxDummy* p = (MaxDummy*)tcItem.lParam;
 CString s = p->s;
 ... 


The problem I have is that the struct I pass to the lParam seems to be corrupt at some point ... and I thought I missed something obvious ...

Thanks in advance, maybe I will figure it out just when I step out of my office ...

Max.



Maximilien Lincourt
Your Head A Splode - Strong Bad
GeneralRe: CTabCtrl and TCIF_PARAM ( brain dead q. of the day) Pin
Neville Franks11-Jan-05 13:53
Neville Franks11-Jan-05 13:53 
GeneralList Control Question Pin
Tom Wright11-Jan-05 8:57
Tom Wright11-Jan-05 8:57 
GeneralRe: List Control Question Pin
Blake Miller11-Jan-05 12:11
Blake Miller11-Jan-05 12:11 
Questionwhat does IN mean when declaring variables? Pin
scottwalk11-Jan-05 8:44
scottwalk11-Jan-05 8:44 
AnswerRe: what does IN mean when declaring variables? Pin
Tom Wright11-Jan-05 8:49
Tom Wright11-Jan-05 8:49 
GeneralRe: what does IN mean when declaring variables? Pin
scottwalk11-Jan-05 8:52
scottwalk11-Jan-05 8:52 
GeneralRe: what does IN mean when declaring variables? Pin
Tom Wright11-Jan-05 9:02
Tom Wright11-Jan-05 9:02 
AnswerRe: what does IN mean when declaring variables? Pin
David Crow11-Jan-05 8:57
David Crow11-Jan-05 8:57 
GeneralRe: what does IN mean when declaring variables? Pin
scottwalk11-Jan-05 9:56
scottwalk11-Jan-05 9:56 
GeneralSpecial Character with TextOut Pin
Anonymous11-Jan-05 8:17
Anonymous11-Jan-05 8:17 
GeneralRe: Special Character with TextOut Pin
basementman11-Jan-05 8:56
basementman11-Jan-05 8:56 
GeneralMemory Management across DLLs Pin
Member 155768211-Jan-05 8:10
Member 155768211-Jan-05 8:10 
GeneralRe: Memory Management across DLLs Pin
Blake Miller11-Jan-05 12:16
Blake Miller11-Jan-05 12:16 
GeneralRe: Memory Management across DLLs Pin
12-Jan-05 13:28
suss12-Jan-05 13:28 
GeneralRe: Memory Management across DLLs Pin
Bo Hunter12-Jan-05 13:25
Bo Hunter12-Jan-05 13:25 
GeneralRe: Memory Management across DLLs Pin
digwizfox13-Jan-05 7:39
digwizfox13-Jan-05 7:39 
GeneralCommand Line String Replacer Pin
Joel Holdsworth11-Jan-05 7:40
Joel Holdsworth11-Jan-05 7:40 

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.