|
You are probably better off using the standardized std::vector class:
std::vector< CMyClass > m_myArray;
... now you can fill the vector e.g. using push_back()...
And now you can use
CMyClass c = GetDocument()->m_myArray[0];
to access the first data item in the associated document.
Hope this helps
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I have something similar in one of my projects.
class CMyDoc : public CDocument
{
public:
void GetAddressList( CDWordArray *pAddresses );
private:
CDWordArray m_arrAddresses;
};
void CMyDoc::GetAddressList( CDWordArray *pAddresses )
{
pAddresses->RemoveAll();
pAddresses->Append(m_arrAddresses);
}
void CMyView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CMyDoc *pDoc;
CDWordArray arrAddresses;
pDoc = GetDocument();
pDoc->GetAddressList(&arrAddresses);
}
Hope this helps, or at least gives you an idea.
|
|
|
|
|
Hi,
I have a bitmap displayed in a window. When some other window is moved over this window. This bitmap gets refreshed,i don't want that to happen. I don't want to create bitmap with WS_CLIPSIBLINGS style. Any idea how can i avoid the bitmap to get refreshed?
Regards
|
|
|
|
|
Why? why did you say (write) that you don't want it to get refreshed? (just curious!)
ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33
|
|
|
|
|
Could anyone who are good in image processing give me some advises for my question:
1. How to do an 'edge detection' on a bitmap?
2. How to change the contrast of a bitmap?
thanks you.
|
|
|
|
|
1. apply a convolution filter (see "Laplacian")
2. to raise contrast, lower the low pixel values, raise the high pixel values. to lower contrast, do the opposite.
-c
|
|
|
|
|
dear all,
how can i get the handles of controls present in my dialog.
thanx
|
|
|
|
|
hello,
I don't know exactly what you want but:
1. if you are programming MFC and you need a CWnd pointer to an edit box(his resource id is for example IDC_EDIT1) or any other control in your dialog (dialog1) :
dialog1.GetDlgItem(IDC_EDIT1);
2. in old windows programming style
GetDlgItem(dialog1, IDC_EDIT1);
where dialog1 is a handle to your dialog and IDC_EDIT1 is the resource id of the control
for both functions the return value is what you want....
|
|
|
|
|
thanx a lot _crs_
thats exactly what i was asking for,
but how do i get the handle of dialog box (dialog1 in ur example)
|
|
|
|
|
Use CWnd::GetSafeHwnd() for any window.
|
|
|
|
|
... if you are in DialogProc - it looks like this
LRESULT CALLBACK DialogPROC(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
handle to the dialog is "hDlg" your first parameter
when you create a dialog ...
DialogBox(hInst, (LPCTSTR)IDD_DIALOG1, hWnd, (DLGPROC)DialogPROC);
where "hInst" is the application instance,
"hWnd" is a handle to parent dialog window in your case will be main window
"IDD_DIALOG1" is the dialog resource id and
"DialogPROC" is the dialog callback procedure (like WndProc for your main window)
if you use MFC look at the other answer ....
|
|
|
|
|
How to edit vertical center?
I have searched over the ISDN, but no answer.
Please help me!!
|
|
|
|
|
|
I have downloaded the demo project "Review of the network adapters parameters"
by Serge Baza
from site: www.codeproject.com
And the guideline tell that
"You need to include in the program the following header files besides the standard: Iphlpapi.h, IPIfCons.h, Winsock2.h. And it is also necessary to include in the project such libraries as: Iphlpapi.lib and Ws2_32.lib."
but i could not find any attach file as show above.
so I really can not build and run this project.
Please help me !!
Thank you verry much.
|
|
|
|
|
This program works for me in VC7 but not
in VC6 so I guess that is what you have.
What exactly do you need? Only your IP?
jhaga
|
|
|
|
|
Have you installed MS Platform SDK-November 2001?
i know for sure there are going to be installed on system when installing the newest SDK update.
greetings
jens
|
|
|
|
|
dear all,
1) i've created checkbox controls at runtime (number of controls can vary).
now how can i access the controls after they r created. how can i verify whether the controls r checked or not.
2) i also have 2 buttons on the dialog. how can i specify their positions and size from my code.
thanx
|
|
|
|
|
the 2 buttons are created during design time
|
|
|
|
|
1) for (int i=0;i< nButtonCount;i++)
IsDlgButtonChecked(IDC_MYCHECK_BASE + i)
2) m_button1.SetWindowPos(...)
|
|
|
|
|
thanx can u plz. tell me how do i get m_button1
|
|
|
|
|
It's a control variable, most likely created by ClassWizard.
|
|
|
|
|
Create an array of pointers to buttons:
CButton* m_btns[10];
m_btns[0] = new CButton;
.
.
.
.
delete m_btns[0];
Elaine
The tigress is here
|
|
|
|
|
I need to add RealAudio playback support to my MFC app. Can anyone point me to some sourcecode or article which will get me started ?
|
|
|
|
|
Use the RealPlayer G2 control. (available from the installed component box as soon as RealPlayer is installed).
|
|
|
|
|
hi all,
I want to open IE window as we do in Javascript..window.opener..type..as a popup..can anyone suggest me any anything..please..any help and pointers are thouroughly appreciated..thanks in advance..
Himanshu
|
|
|
|