|
|
prithaa wrote: How should I use DLGTEMPLATE and DLGITEMTEMPLATE structure for the derived class?
That depends on where the dialog template is going to come from. Will you be loading it as a
resource from a module? Will you be creating a template in memory?
The DLGTEMPLATE[^] documentation explains how these structs need to be layed out in memory.
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Problem solved. Thanks.
I need to use this function in c++ console app, and the documentation says:
errno_t <code>_get_pgmptr</code>( char **pValue );
pValue
A pointer to a string to be filled with ...
So I did this:
char *path = new char[MAX_PATH+1];
memset(path, NULL, MAX_PATH + 1);
<code>_get_pgmptr</code>(&path);
...
delete[] path;
But the call to the function, changes the address of the pointer(path) and calling the delete will fail.
I thought first that perhaps, I don't need to allocate any memory and the function (oddly) allocates it automatically and sends me the address but this is not the case either. Can anyone tell me what's wrong with this?
-- modified at 8:18 Tuesday 26th June, 2007
|
|
|
|
|
Hi,
It gets the current value of the _pgmptr, a global variable which contains the file path. You need not allocate the buffer.
What happen if you pass without allocating?
|
|
|
|
|
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
|
|
|
|