|
Nothing is in front of #include
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Your code print 20 with address of i whats the problem?
|
|
|
|
|
xbiju wrote: How can I access the address of the local and global constant 'i's?
Address of local is &i
Address of global is &::i
In the words of WhiteSky, what's the problem?
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
I am creating some control over a form at run time.
How to set the tab order for these controls.
Regards
Anil
|
|
|
|
|
Sorry, I first did not notice it's on runtime.
I'm not sure if it is possible to change tab order at runtime, because as far as I know, controls orders depends on the order they have been created.
I mostly use these 2 function:
GetNextDlgTabItem to get the next control in the focus order
SetFocus to set the focus to a particular control when user presses a key (e.g. Enter = OnOk).
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
|
Your right. It changes z order and place it after the first handle.
I already used this API several times, but never for this purpose.
Thanks, I learned something
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
|
Thanks
This is exactly what I was looking for.
Regards
Anil
|
|
|
|
|
Hello all,
I have made a SDI window and divided it into two parts using splitter control. Now my problem is i have made 2 classes that are derived from CFormView. In that i have made a List control. Now what i want is when i resize the window or splitter control my list control should adjust itself accordingly. How to do it. Can anybody help me in this?
Thanks in advance
|
|
|
|
|
As u have told the listcontol is in a fromview.
On the OnSize of the form view resize the ListControl.
LookFor OnSize, MoveWindow, ScreenToClient
Regards
Anil
|
|
|
|
|
Please can you tell me the code. i am doing it but its not working correctly.
|
|
|
|
|
Hi,
I remember I suggested solution for the same problem just before 2 or 3 days. Could you please post what you have done to resize.
Best regards
Raj
|
|
|
|
|
void CYourFormView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
// Size the tree control according to size of bar
if( m_LstCtrl.GetSafeHwnd() != NULL ){
// Get the current control position
CRect rcListSize;
m_LstCtrl.GetWindowRect( rcListSize );
// Change to screen cordinate
ScreenToClient( rcListSize );
// Change the size of the tree control
m_LstCtrl.MoveWindow( rcListSize.left, rcListSize.top, cx - rcListSize.left, cy - rcListSize.top);
}
}
if u r not able to do then as Rajkumar said I also like to know which way u r trying. so post some code too.
Regards
Anil
|
|
|
|
|
Hello every one..
my question is how i can split my dialog window ..
help me..
vikram.
|
|
|
|
|
How do you mean split a dialog window? As in slice a window in half to create two windows with a splitter bar in the middle?
--PerspX
|
|
|
|
|
|
Hi
Can anyone plz tell me how to declare a string array in heap? I also dont want to specify its size at the time of declaration.
Thanks
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
std::vector<std::string> string_array;
At least that is how it is done in C++.
Of course that is not really a heap only version, because for that you would have to know the size of the array and the maximum length of any string placed in the array. But for your question it is close enough to qualify as a resonable answer.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Of course it depends on what you choose as a suitable string. For instance C-like strings are simply (NULL-terminated) character arrays, hence you can do something like:
char ** myStringArray;
myStringArray = new char * [3];
myStringArray[0] = "hello world";
myStringArray[1] = new char[10];
memset(myStringArray[1], '*',9);
myStringArray[1][9]='\0';
myStringArray[2] = strdup("Hi");
delete [] myStringArray[1];
free (myStringArray[2]);
delete [] myStringArray;
On the other hand, MFC CString or std::string are objects controlling themselves the inner character buffer, therefore you can do, for instance:
CString * myStringArray;
myStringArray = new CString[2];
myStringArray[0]="Hello World";
myStringArray[0] += "!";
myStringArray[1]=CString('*',9);
delete [] myStringArray;
Hope that helps
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Working with this for a couple days, I wish I were smarter about this stuff. Please help:
double x;
TCHAR TcharTestString[50];
GetDlgItemText(hDlg,IDC_STATIC_A, &TcharTestString, 8 );
x = wcstod(&TcharTestString, &stopstring);
printf("strtod = %f\n", x ); //everything okay so far
swprintf(&TcharTestString, "%f", x); // just won't work
Thanks
|
|
|
|
|
An array of TCHAR is already a string, don't use & when passing that variable to a function.
|
|
|
|
|
frqftgbdafr wrote: double x;
TCHAR TcharTestString[50];
GetDlgItemText(hDlg,IDC_STATIC_A, &TcharTestString, 8 );
x = wcstod(&TcharTestString, &stopstring);
printf("strtod = %f\n", x ); //everything okay so far
swprintf(&TcharTestString, "%f", x); // just won't work
Just a suggestion.
When using TCHAR always use functions defined for TCHAR's .
For eg: _tcstod for wcstod , _stprintf for swprintf , _tprintf for printf etc.
Or if you are sure that you want a wide char type then instead of TCHAR directly use wchar_t .
Once again, use TCHAR with functions defined for TCHAR's .
|
|
|
|
|
Each list view is associated with a list control which we can access by calling GetListCtrl().
How to set this list control to use LVS_OWNERDATA style ?
I've tried to put these in OnCreate or OnInitialUpdate but it didn't work. The list is still not of OWNERDATA style.
CListCtrl &ctlTmp = this->GetListCtrl();
ctlTmp.ModifyStyle(NULL, LVS_REPORT | LVS_OWNERDATA);
how could I do this ?
|
|
|
|
|
You can't dynamically set this style - it has to be set when the control is created.
You can pass it with the dwStyle parameter to Create()/CreateEx() or set it in the resource editor
properties if it's a control on a dialog resource.
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|