Click here to Skip to main content
15,929,551 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Disabling or greying out menu items in mfc Pin
V.9-Jun-04 21:20
professionalV.9-Jun-04 21:20 
GeneralRe: Disabling or greying out menu items in mfc Pin
kfaday10-Jun-04 17:06
kfaday10-Jun-04 17:06 
GeneralNeed Urgent Help for a listener catching tooltips Pin
ayca9-Jun-04 15:14
ayca9-Jun-04 15:14 
GeneralRe: Need Urgent Help for a listener catching tooltips Pin
Diddy9-Jun-04 23:21
Diddy9-Jun-04 23:21 
GeneralSelecting the file names in open file dialog Pin
ayca9-Jun-04 13:25
ayca9-Jun-04 13:25 
GeneralRe: Selecting the file names in open file dialog Pin
GermanGeorge10-Jun-04 3:18
GermanGeorge10-Jun-04 3:18 
GeneralCan't get tabs down right side of TabCtrl. Pin
ThePilgrim9-Jun-04 12:29
ThePilgrim9-Jun-04 12:29 
GeneralRe: Can't get tabs down right side of TabCtrl. Pin
Ryan Binns9-Jun-04 18:20
Ryan Binns9-Jun-04 18:20 
ThePilgrim wrote:
However, according to things I've read, I should be able to use TCS_VERTICAL and TCS_RIGHT in a ModifyStyle() call to move the tabs to the right side of the control. It took some finagaling, but finally wrote the following code to do it:

A better way would be to specify the style on creation, but if you want to use ModifyStyle(), call RedrawWindow() afterwards to force the control to redraw itself. As for the text disappearing, sorry, can't help there.


ThePilgrim wrote:
Right after the GetTabControl() call, while running in the debugger, the pTabs variable has a valid pointer in it. However, if I then do this:

TCITEM tci;
pTabs->GetItem( 0, &tci );

The pTabs variable immediately gets a NULL in it.


You have to initialise the TCITEM structure before you call GetItem().
TCITEM tci = {0};
tci.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM  | TCIF_STATE;
tci.pszText = /* Allocate some memory to store the text if you need it */
tci.cchTextMax = /* The number of characters you allocated above */
pTabs->GetItem( 0, &tci );
You have almost definitely found a memory-smashing bug caused by not initialising the structure.

Hope this helps,

Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

GeneralRe: Can't get tabs down right side of TabCtrl. Pin
ThePilgrim9-Jun-04 18:43
ThePilgrim9-Jun-04 18:43 
GeneralRe: Can't get tabs down right side of TabCtrl - Whoo-hoo! Pin
ThePilgrim9-Jun-04 19:29
ThePilgrim9-Jun-04 19:29 
GeneralInterrupt handling Pin
philliad9-Jun-04 10:31
philliad9-Jun-04 10:31 
GeneralUSB Data Acquisition Pin
Jeff Bogan9-Jun-04 9:47
Jeff Bogan9-Jun-04 9:47 
GeneralRe: USB Data Acquisition Pin
Ryan Binns9-Jun-04 18:24
Ryan Binns9-Jun-04 18:24 
GeneralAdding a border to a custom control Pin
kfaday9-Jun-04 9:29
kfaday9-Jun-04 9:29 
GeneralRe: Adding a border to a custom control Pin
Vadim Tabakman9-Jun-04 15:54
Vadim Tabakman9-Jun-04 15:54 
GeneralRe: Adding a border to a custom control Pin
kfaday9-Jun-04 15:52
kfaday9-Jun-04 15:52 
GeneralRe: Adding a border to a custom control Pin
Vadim Tabakman9-Jun-04 16:09
Vadim Tabakman9-Jun-04 16:09 
GeneralParsing Header files Pin
Anonymous9-Jun-04 9:09
Anonymous9-Jun-04 9:09 
GeneralRe: Parsing Header files Pin
Johan Rosengren10-Jun-04 0:28
Johan Rosengren10-Jun-04 0:28 
GeneralConvert a MFC project in Automation Pin
De Nardis Andrea9-Jun-04 8:58
De Nardis Andrea9-Jun-04 8:58 
Questionhow to show *** in a CEdit Pin
kfaday9-Jun-04 8:50
kfaday9-Jun-04 8:50 
AnswerRe: how to show *** in a CEdit Pin
walster9-Jun-04 8:53
walster9-Jun-04 8:53 
AnswerRe: how to show *** in a CEdit Pin
Ravi Bhavnani9-Jun-04 9:00
professionalRavi Bhavnani9-Jun-04 9:00 
GeneralRe: how to show *** in a CEdit Pin
kfaday9-Jun-04 9:11
kfaday9-Jun-04 9:11 
Generalsmpt server Pin
gamitech9-Jun-04 8:47
gamitech9-Jun-04 8:47 

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.