|
I found the problem was another mistake! You're right and the function gets a pointer to that variable.
I forgot to remove my question here, I guess I posted too soon, before investigating the code completely. Sorry!
Anyway, Thanks a lot for your attention and reply.
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
No need to strike your question, it could be useful for others
|
|
|
|
|
Done.
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Thanks from the community
When they kick at your front door
How you gonna come?
With your hands on your head
Or on the trigger of your gun?
Fold with us! ¤ flickr
|
|
|
|
|
Why does te following C++ code flag error?
# include
const int i=10;
void main()
{
const int i = 20;
cout << i << endl << ::i;
cout << &i;
}
The error flagged is "Illegal structure operation in main"
Compiler use : Borland C++ 4.5
How can I access the address of the local and global constant 'i's?
Please help me.
Thanks,
Biju
|
|
|
|
|
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.
|
|
|
|