|
Try the PreTranslateMesssage event handler.
[MODIFIED]I guess you have found your solution and it even far more better. Glad it works out that way and I have learned. [/MODIFIED]
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
:|how can i get the text from CComboBox i has input?
|
|
|
|
|
int iIndex = -1;
iIndex = MyCombobox.GetCurSel();
CString strText;
MyCombobox.GetLBText(iIndex, strText);
Er zit een korstje op mijn aars.
|
|
|
|
|
hi,sorry,
MyCombobox's data is empty,the data
i has input is not belone Mycombobox,
GetLBText() will cause a error;
the data i has input is the exe run
|
|
|
|
|
well..'MyCombobox' is just a test name (i made it up), you gotta replace it with a CComboBox instance that represents the combobox you want to read the text from.
Er zit een korstje op mijn aars.
|
|
|
|
|
I know,
my question is :
i can't get the text in CComboBox that i input when the program is run
(CComboBox m_DBName);
int index=-1;
index=m_DBName.GetCurSel();
//if i input "sdfs",the next cause a error
str=m_DBName.GetCurrentText();
|
|
|
|
|
replace "str=m_DBName.GetCurrentText()" with
CString str;
m_DBName.GetLBText(index, str);
"str" should now contains the text in the combobox.
Note: verify that 'index' contains the right index in the combobox.
Er zit een korstje op mijn aars.
|
|
|
|
|
hi,sorry,
MyCombobox's data is empty,the data
i has input is not belone Mycombobox,
GetLBText() will cause a error;
the data i has input is the exe running
|
|
|
|
|
Take a look at GetWindowText. It should do it !
|
|
|
|
|
the function GetWindowText Can't use ,CComboBox modify it
|
|
|
|
|
I need to join to RTF files ( generated by WORD 2000 ) into one.
But when I do that ( clearing "}" on the end if first and "{"
on the start on second.
That works but I lost EastEroupean characters from second file.
Any solution for my problem ?
|
|
|
|
|
Trying using paste instead of doing it thru strings. The problem is that both RTF's have headers. Doing it with strings would mean you'd have to parse the headers and merge the data between the two. Another way would be to create an invisible RTF control and stream both RTF strings into it. The RTF control is pretty smart about such things.
--
Joel Lucsy
|
|
|
|
|
Thanks. I try to use RTF control.
|
|
|
|
|
Hi
I have a simple application and, I have the data in some arrays.
If I want to write these data to an Excel file what should I do.
I can easily write them to a text file....but is it possible to write it to an Excel file without using MFC?
|
|
|
|
|
you can make the output go into a *.csv file, a comma seperated value file, which can easily be imported into excell.
*.*
cin >> knowledge;
|
|
|
|
|
ok thanks I tried to make a .CSV file and it opens in Excel format the only problem is that the file does not look good. All of the output in in One Cell.
if I want to have
something in A1 and the next thing in B1 what should I do.
right not it does not undrestand that Tab means going to the next column!
|
|
|
|
|
One more thing I forgot to ask.
How can I create a Sheet within the .cvs file from inside my c++ code?
|
|
|
|
|
dont worry about my first question. I used *.xls file directly and it works but i am still wondering about generating that extra sheet in the file.
|
|
|
|
|
maryami wrote:
...is it possible to write it to an Excel file without using MFC?
Yes, just use Excel's COM interface.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Can you give me a link that can help me to get to know excel's COM interface? I have not work with that before!.is it a class? library ?
|
|
|
|
|
maryami wrote:
Can you give me a link that can help me to get to know excel's COM interface?
Try this one.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Ok, this is my first time posting so bear with me. I have to write a battleship program; you play against the computer AI. I have everything close to working but when I put in the code for the computer to guess a random spot and color that spot if it was a hit, it says debug assertion failed, wingdi.cpp, line 1120. It seems to have to do with my RePaint function coloring the square. Is there an easy way to fix this?
|
|
|
|
|
If you can run it in a debugger, where you can get a stack trace when the assertion fires, you'll be able to see what bit of your code it doesn't like. Post the relevant snippet here.
Shog9
---
You'd better turn back, before the frost sets in.
These desert nights are for weathered men,
The ones who've already given in...
|
|
|
|
|
When I do that its the stdafx header here(->):
BOOL CGdiObject::Attach(HGDIOBJ hObject)
{
(->) ASSERT(m_hObject == NULL); // only attach once, detach on destroy
if (hObject == NULL)
return FALSE;
CHandleMap* pMap = afxMapHGDIOBJ(TRUE); // create map if not exist
ASSERT(pMap != NULL);
pMap->SetPermanent(m_hObject = hObject, this);
return TRUE;
}
Any ideas?
|
|
|
|
|
Anyone know how to fix it?
|
|
|
|