|
I am currently storing many separate arrays of different variable types.
ie CArray<cstring, cstring=""> id;
CArray<cstring, cstring=""> address;
CArray<uint, uint=""> type;
CArray<cstring, cstring=""> label;
CArray<lpdispatch, lpdispatch=""> shape;
CArray<cstring, cstring=""> mapno;
When I delete an item, I have to delete it from all other arrays.
I would like to store one array of all the items.
How would I define this: as a class or a struct?
Would I then use CArray<class, class=""> to store the collection?
Thank you for any help.
|
|
|
|
|
|
Richard Jones wrote:
Would I then use CArray to store the collection?
You'd do better to use std::vector because it is inherently superior to CArray, which was written only to be a stopgap until vector arrived. Check out my article on vector here on CP.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Hi again,
my CDialog close if i press Enter. I have removed the
standard buttons and the current focus is on a CEdit Control.
If i press enter i want to validate the CEdit Content.
But i can't catch the "close" message.
Can anybody help me ?
Marco
|
|
|
|
|
|
Hi,
i have removed the standard Buttons, so i don't have a OnOK Routine !
Marco
|
|
|
|
|
|
Thanxs,
now it works !
I hate it, if I do not have control of the program sequence.
Marco
Marco
|
|
|
|
|
|
Why?
There's nothing about that!
Marco
Marco
|
|
|
|
|
Koep wrote:
Why?
There's nothing about that!
I would not be that sure. Click
here and enjoy ...
~RaGE();
|
|
|
|
|
Ahh thanxs,
i had pressed the "FAQ" link between "What's New".
Marco
|
|
|
|
|
You know how when you click on the window of some application, any other app obscuring it on the screen gets pushed to the background? And the clicked window covers it up? Well, I made modeless dialog boxes spawned from my main view. But if I click on the view when running, I expect these boxes to get pushed to the background. Instead they sit merrily right on top. How do we get the required behavior?
Thanks very much,
ns
|
|
|
|
|
|
Wow! Thank you so much! Exactly what I needed. Many thanks!
ns
|
|
|
|
|
How do i get the HWND of an opened window?
rechi
|
|
|
|
|
EnumWindow() will give you the HWND for every top-level window running on the computer. If you want the HWND for the window that is currently running, its just CMyWnd->m_hWnd, or this->m_hWnd;
|
|
|
|
|
Anyone know how I can display the Win2000 print dialog rather than the standard one please?
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
Hi
I am displaying some controls like CButton in CFormView
and want to draw some figures( for example a line ) on the
control ( here CButton ).
I dont' want to subclass the controls, neither I wan to
make them OwnerDrawn.
Can someone suggest how it can be done.
Thanks,
Sansky
John 3:16
For God so loved the world,
that he gave his only begotten Son ( Jesus Christ ) ,
that whosoever believeth in him should not perish, but have everlasting life.
|
|
|
|
|
Have you already tried something like
CDC *myDC=m_Button.GetDC();
...Draw...
myDC->MoveTo(0,0);
myDC->LineTo(10,0);
...Draw...
ReleaseDC(myDC);
I´m not sure at all that this brings something, but who knows
~RaGE();
|
|
|
|
|
class Foo
{
Foo();
~Foo();
};
Foo *bar = new Foo;
delete bar;
The destructor is called when I delete bar right?
- Jason
(SonorkID 100.611)
In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G
|
|
|
|
|
as it is in the MSDN :
When delete is used to deallocate memory for a C++ class object, the object's destructor is called before the object's memory is deallocated (if the object has a destructor).
Fred
|
|
|
|
|
Jason Hooper wrote:
The destructor is called when I delete bar right?
yep. If you want to make sure of it, just try to display something in the destructor [ with
~Foo{ cout<<"Here i destruct the object"<<endl; } if you're running a console application].You can even display the pointer address to be really sure it is the bar and not something else.
~RaGE();
|
|
|
|
|
I need to retrieve the value from a cWnd that has the focus, The value I need is m_pTypes, which is an unsigned char* value. I using the following code:
CWnd * pWnd = GetActiveWindow();
pWnd = GetFocus();
In debug mode I see the following values:
- pWnd 0x00aeea50 {CListCtrlEx hWnd=0x00000240}
- [CListCtrlEx] {CListCtrlEx hWnd=0x00000240}
+ CListCtrl {CListCtrl hWnd=0x00000240}
m_nHighlight 2
m_bSort 1 ''
m_nViewType 0
m_overAmount 1162299716
+ m_pTypes 0x00ea12d0 "ýýýýÝÝÝÝÝÝÝÝÝÝÝÝÝA"
m_nNumCols 7
+ m_ctStart {...}
+ m_headerctrl {CNewHeaderCtrl hWnd=0x00000224}
+ m_cImageList {CImageList}
How Can I retrieve that value?
Any help would be greatly appreciated.
Thank-you
Sincerely,
RAH
|
|
|
|
|
You can access your value with pWnd->m_pTypes if it is a member variable. Are you using MFC in this case ?
~RaGE();
|
|
|
|