Click here to Skip to main content
15,890,845 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to use mfc in win32 dll? Pin
gohappy_19996-Jul-05 18:05
gohappy_19996-Jul-05 18:05 
AnswerRe: how to use mfc in win32 dll? Pin
ThatsAlok6-Jul-05 20:23
ThatsAlok6-Jul-05 20:23 
GeneralVARIANT/COM Hell Pin
Christian Graus6-Jul-05 17:03
protectorChristian Graus6-Jul-05 17:03 
GeneralRe: VARIANT/COM Hell Pin
Jose Lamas Rios7-Jul-05 7:46
Jose Lamas Rios7-Jul-05 7:46 
GeneralRe: VARIANT/COM Hell Pin
Christian Graus7-Jul-05 13:15
protectorChristian Graus7-Jul-05 13:15 
GeneralRe: VARIANT/COM Hell Pin
Jose Lamas Rios7-Jul-05 15:49
Jose Lamas Rios7-Jul-05 15:49 
GeneralHowe to insert a number into a table in the Oracle by ADO Pin
zwzcode6-Jul-05 15:22
zwzcode6-Jul-05 15:22 
GeneralHELP problem with CComboBox AddString recovery Pin
cgb1436-Jul-05 14:06
cgb1436-Jul-05 14:06 
I am trying to maintain someone elses code and do not fully understand it's nuances. However I am trying to recover a string stored in a CComboBox list.

I posted this at little earlier at 19:50 but some of the code was missing/corrupted

//---------------------------------
void Control::DoDataExchange(CDataExchange* pDX)
{
Sheet* pSheet = ((C_App*)AfxGetApp())->getSheet();

MyPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Control)
DDX_Control(pDX, IDC_OTHER_COMBO, m_otherCombo); // IDC_OTHER_COMBO is the CComboBox ID:
//}}AFX_DATA_MAP
}
//---------------------------------

//Sheet::PopulateOtherCombo()
{
int i;
int entry=0;
int index=0;
CString name;
for (i=0;i<maxcount;i++)
{


="" some="" code="" that="" constructs="" the="" string="" 'name'
=""

="" write="" 'name'="" to="" ccombobox
index="getControl()-">m_otherCombo.AddString(name);
if (index != CB_ERR)
{
getControl()->m_otherCombo.SetItemData(index, entry++);
}
}
}

//---------------------------------------------------------------------------
//So far I have built a list of strings stored sequentially by 'index' but how do I recover a string ??
// When I click on the CComboBox, the list opens and I can select any of the entries.


int index = getControl()->m_otherCombo.GetCurSel();

// Gets the index # of the currently selected CComboBox entry.
// Now I want to copy the text of the currently selected entry somewhere else.
// I have the index but there is no GetString(index) function

// HELP!



Thanks for any help you can offer




Charles
GeneralRe: HELP problem with CComboBox AddString recovery Pin
Christian Graus6-Jul-05 14:44
protectorChristian Graus6-Jul-05 14:44 
GeneralRe: HELP problem with CComboBox AddString recovery Pin
cgb1436-Jul-05 15:13
cgb1436-Jul-05 15:13 
GeneralRe: HELP problem with CComboBox AddString recovery Pin
Brad Bruce6-Jul-05 14:59
Brad Bruce6-Jul-05 14:59 
GeneralRe: HELP problem with CComboBox AddString recovery Pin
cgb1437-Jul-05 5:28
cgb1437-Jul-05 5:28 
GeneralRe: HELP problem with CComboBox AddString recovery Pin
David Crow6-Jul-05 15:44
David Crow6-Jul-05 15:44 
GeneralRe: HELP CComboBox AddString and recovery Pin
Anonymous6-Jul-05 13:54
Anonymous6-Jul-05 13:54 
Generalconvert number to char Pin
Ista6-Jul-05 12:42
Ista6-Jul-05 12:42 
GeneralRe: convert number to char Pin
markkuk6-Jul-05 13:06
markkuk6-Jul-05 13:06 
GeneralRe: convert number to char Pin
toxcct6-Jul-05 20:25
toxcct6-Jul-05 20:25 
GeneralRe: convert number to char Pin
Bob Stanneveld6-Jul-05 20:58
Bob Stanneveld6-Jul-05 20:58 
GeneralRe: convert number to char Pin
toxcct7-Jul-05 0:25
toxcct7-Jul-05 0:25 
GeneralRe: convert number to char Pin
Bob Stanneveld7-Jul-05 1:24
Bob Stanneveld7-Jul-05 1:24 
GeneralRe: convert number to char Pin
dSolariuM6-Jul-05 21:11
dSolariuM6-Jul-05 21:11 
GeneralMessage Box Position Pin
tas28266-Jul-05 11:21
tas28266-Jul-05 11:21 
Generaleasy translation for c# . Pin
Ista6-Jul-05 11:07
Ista6-Jul-05 11:07 
GeneralRe: easy translation for c# . Pin
Christian Graus6-Jul-05 11:17
protectorChristian Graus6-Jul-05 11:17 
GeneralRe: easy translation for c# . Pin
Ista6-Jul-05 11:50
Ista6-Jul-05 11:50 

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.