|
Is there a way to add new rows to a MS FlexGrid in VC++ 6.0? If there is, then it will be a great help if someone can let me know how to do it.
log live the dEvIL
|
|
|
|
|
void CFlexGridDlg::OnNew()
{
COleVariant vIndex;
vIndex.lVal = 1;
m_ctlFlexGrid.AddItem( "Hallo", vIndex);
}
|
|
|
|
|
Thanx for the prompt reply. This way of doing it helps in adding rows, but with just a single column. I need to add multiple columned rows to the grid, which I am fetching from an Access database. How to do that? Please help.
log live the dEvIL
|
|
|
|
|
To add multiple strings (for multiple columns in the row), use the tab character (char x = 9) to separate each string.
m_ctlFlexGrid.AddItem( "Hallo1\tHello2\tHello3...", vIndex);
|
|
|
|
|
Only one problem left!
Unable to add to fixed rows error. I need to have one row and a column fixed. How to?
long live the dEvIL
|
|
|
|
|
In OnInitDialog() put in :
m_FlexGrid1.SetCols(NUM_COLS);
m_FlexGrid1.SetRows(NUM_ROWS); // open Grid with two empty rows
// need to add new rows (error)
// select number of fixed rows and colons
m_FlexGrid1.SetFixedRows(1);
m_FlexGrid1.SetFixedCols(1);
// example to fill out 1 fixed rows:
m_FlexGrid1.SetRowHeight(0, m_FlexGrid1.GetRowHeight(0) * 2);
m_FlexGrid1.SetTextArray(0, "");
m_FlexGrid1.SetTextArray(1, "Heading Text One");
m_FlexGrid1.SetTextArray(2, "Heading Text Two");
m_FlexGrid1.SetTextArray(3, "Heading Text Three");
// function to add new row
long r = m_FlexGrid1.GetRows()-1;
m_FlexGrid1.AddItem(str, COleVariant(r));
// you have one empty row. delete this empty row after added new row
m_FlexGrid1.RemoveItem(1);
|
|
|
|
|
A CDialog Object is a member of my application class and is displayed via Dlg.DoModal.
I want to handle the event that the dialog is closed. I tried the functions OnClose (wasn't called) ,OnDestroy (wasn't called because the object isn't destroyed).
Now my solution is :
OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CDialog::OnActivate(nState, pWndOther, bMinimized);
if ( nState == WA_INACTIVE && pWndOther)
{
// Dialog is closed
}
}
Is it correct or does anyone know a better solution like the opposite of InitDialog which is called everytime the dialog is displayed via DoModal?
|
|
|
|
|
Override OnOK() and/or OnCancel() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I would like to be able to read the text in the comments of a website. The problem I am having is that the site I want to be able to parse has comments before the HTML tag. Using the IHTMLDocument2, I haven't been able to do this because it seems to strip comments out. Any help would be apprecaiated. Is there any way to just get a string of the source code, and parse that? Thanks!
|
|
|
|
|
Yes, see this[^] article to parse the contents of a url.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks for the link. Unfortunately, that won't work either. The problem is that we output a comment that contains the actual server name that you are on (our farm has over 150 boxes) into the comment. Using your method, the server sees the application as not supporting javascript, so it creates an error page saying that. Any other ideas? Thanks!
|
|
|
|
|
Is it possible to open up dialogboxes as many numbers as an user wishes and specifies at run time? If possible then how?
How can I make a bitmap resource clickable so that a new dialog box appears when it is clicked ,in which there may contain the same bitmap resource along with the upper said clickable criterion???
|
|
|
|
|
joy007 wrote:
Is it possible to open up dialogboxes as many numbers as an user wishes and specifies at run time?
I don't understand this question. If you mean, is it possible to have multiple dialog boxes open at the same time, the answer is yes, if you make them modeless dialogs.
joy007 wrote:
How can I make a bitmap resource clickable so that a new dialog box appears when it is clicked
See this[^] article to create a bitmap button that displays as a static control (i.e. without the button border). Display your dialoig in the button's handler.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
If you mean, is it possible to have multiple dialog boxes open at the same time, the answer is yes, if you make them modeless dialogs.
Whether they are modal or modeless, multiple dialogs can be open simultaneously.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I understood "open" to mean "accept user input".
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It was not an intuitive question no matter how you sliced it.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
yes.
just do something like :
...
CYourDialog* p = new CYourDialog( ID_OF_THE_BITMAP_YOU_JUST_CLICKED_ON );
p->Create( ... );
p->ShowWindow( SW_TRUW );
...
You will need to keep track of the dialogs so you can delete them eventually.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
what ??? it should have been ->ShowWindow(SW_SHOW);
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
joy007 wrote:
Is it possible to open up dialogboxes as many numbers as an user wishes and specifies at run time? If possible then how?
Ravi,I mean to say,that when an user draws an item in a document and next double clicks on the drawn item leading to open up a dialog box or another document which may or may not contain the same item drawn.If same item is found drawn on this new document and double clicked it should open up another dialog box or document and so on.... Actually I want the to make the item as multilevel so that an user can go through easily from its root level to node.
|
|
|
|
|
I require some assistance with a unique problem, and as I am not much in the way of an Win32 API programmer, was hoping someone could help me out.
I am configuring an application for a customer that would like a hotkey setup for a specific program function; however, the application itself does not support the space bar as a hotkey.
I was looking at maybe trapping the space bar for this specific application and remapping the key as a hotkey that it does support (like F12), but leaving the space bar functionality intact for other programs also running. I have no idea how to go about doing this, whether it can be done, or if it is even the best solution for the problem.
I do not have access to the application code for which I am trying to add this additional support to.
Does anyone have any suggestions? Thanks
|
|
|
|
|
Refer PretranslateMessage() is mSDN and u will find the answer for that probably !!!
Cause is my effort;
Effect is God's effort
|
|
|
|
|
Hi!
Using the DrawText function I can specify that the text should be truncated with ellipses if the text does not fit in a specified rectangle by supplying either the flag DT_END_ELLIPSIS (will truncate and add ellipses to the end) or the flag DT_PATH_ELLIPSIS (will truncate and add ellipses to the middle).
aaaaa\bbbbb\ccc...
aaaaa\...\ccccc
But I need to truncate and add ellipses to the beginning. How would I go to about to achieve this?
...\bbbbb\ccccc
|
|
|
|
|
What would happen if you replaced each folder name in the path with ellipses until GetOutputTextExtent() indicated that the text would fit in the control?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
That might work!
Thanks for your suggestion.
|
|
|
|