|
wait for some time may be 30 minutes,
i shall have my dinner, refer my backups and reply exactly.
meanwhile try it ur self.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
s196675m wrote: I think DoDataExchange called before calling OnInitDialog
It's called BY CDialog::OnInitDialog().
You need to do your creation before calling the base class
OnInitDialog(), and also check for a valid pointer in your
DoDataExchange() override...
void CTestdynDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST, m_list);
<font color="Red">if (m_dynalist)</font>
<font color="Red">{
</font> <font color="Red">
<font color="Red">}</font>
DDX_Control(pDX, IDC_EDIT, m_edit);
DDX_Text(pDX, IDC_EDIT, m_editstr);
}
BOOL CTestdynDlg::OnInitDialog()
{
<font color="Red">
<font color="Red">
CDialog::OnInitDialog();
}
Last modified: 55mins after originally posted --
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
if mark's suggestion, worked for you, then its fine.
byt in my application, i have not taken a pointer *m_dynalist, instead, i took normal variable(in my case, array).it worked quite comfortably for me.
s196675m wrote: DDX_Control(pDX, IDC_LISTTEST, *m_dynalist);//dynamic listbox
s196675m wrote: ON_LBN_SELCHANGE(IDC_LIST, OnSelchangeDynaList)// dynamic listbox
in both the above cases, instead of IDC_LISTTEST, i have used some unique number like, for example, 10001
and i have used the same number while creation in the initdialog.
what i observe in your case is, you are declaring it as pointer and you are not creating memory for it using new.
if iam right, try creaitng the memory and see or use normal variable instead of pointer.
any more clarifications required?
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Hi
I tried mark's suggession but still no luck.
Yes I have create memeory using new and I also used unique number defined for IDC_LISTTEST. I am scratching my head for last two days even can not make it work. I will be glad if you can help me to make it work
I need to understand this concept, otherwise I can not go forward.
Here is updated code:
<br />
void CTestdynDlg::DoDataExchange(CDataExchange* pDX)<br />
{<br />
CDialog::DoDataExchange(pDX);<br />
DDX_Control(pDX, IDC_LIST, m_list);<br />
if (m_dynalist){<br />
DDX_Control(pDX, IDC_LISTTEST, *m_dynalist);<br />
}<br />
DDX_Control(pDX, IDC_EDIT, m_edit);<br />
DDX_Text(pDX, IDC_EDIT, m_editstr);<br />
<br />
}<br />
<br />
BEGIN_MESSAGE_MAP(CTestdynDlg, CDialog)<br />
ON_WM_PAINT()<br />
ON_WM_QUERYDRAGICON()<br />
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)<br />
ON_LBN_SELCHANGE(IDC_LIST, OnSelchangeList)<br />
ON_LBN_SELCHANGE(IDC_LISTTEST, OnSelchangeDynaList)<br />
<br />
<br />
END_MESSAGE_MAP()<br />
<br />
BOOL CTestdynDlg::OnInitDialog()<br />
{<br />
<br />
m_dynalist = new CListBox;<br />
<br />
m_dynalist->CreateEx( WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_TOOLWINDOW,<br />
_T("LISTBOX"),<br />
NULL,<br />
WS_CHILD | WS_BORDER,<br />
CRect(0, 0, 100, 70),<br />
this,<br />
IDC_LISTTEST,<br />
NULL);<br />
CDialog::OnInitDialog();<br />
<br />
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
<br />
m_dynalist->MoveWindow(130,200, 110, 100);<br />
<br />
m_dynalist->AddString("oone");<br />
m_dynalist->AddString("TTwo");<br />
<br />
m_dynalist->UpdateData(FALSE);
m_dynalist->ShowWindow(SW_SHOW);<br />
<br />
m_list.InsertString(0,"one");<br />
m_list.InsertString(1,"two");<br />
m_list.InsertString(2,"three");<br />
<br />
<br />
return TRUE;
}<br />
void CTestdynDlg::OnSelchangeDynaList() <br />
{<br />
CString str;<br />
<br />
int isel = m_dynalist->GetCurSel();<br />
m_dynalist->GetText(isel,str);<br />
m_editstr = str;<br />
m_edit.SetWindowText(str);<br />
<br />
}<br />
<br />
<br />
msc
|
|
|
|
|
What's not working?
Check out my previous post....I changed a line...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
do as mark said, or otherwise, if your application is light weighted, means, no dependencies like database etc,
and if it is in visual c++ 6.0, then mail me i shall see it.
chandu004@yahoo.com.
after mailing please indicate it here.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
I have sent my project files to you. Please have a look. I am using VC++6.0
I really appreciate you help.
|
|
|
|
|
received your source code.
but it is still downloading.
you would have deleted teh debug folder and zipped it.
any way,
i will go through it and come back.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
s196675m wrote: m_dynalist->UpdateData(FALSE);// false true both same effect here
It may be true that it has the same effect in this case but that's not true in general.
First, you should be passing FALSE when calling UpdateData() from OnInitDialog.
Second, CDialog::OnInitDialog() Calls UpdateData(FALSE) for you....it's redundant to call
it again unless you've actually made a modification that effects DDE - you haven't here.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark
If you want I can send you the source file.
Thank you and appreciate your help
|
|
|
|
|
Sure. Without the object code (delete the debug folder)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Fixed.
I sent back one file - search for "//MARK" to see the changes I made.
One change was the one I modified in my first reply - the DDX_Control() call isn't
necessary since the control is already subclassed.
Second change: LBS_NOTIFY style added to the listbox control so you
get your selchange notifications.
Third change: m_dynalist->UpdateData() call removed. That's useless,
and does nothing
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi mark
Thank you for your big help.
Your three line comment is more than my two days of work.
I appreciate your help.
Thank you again.
-- modified at 17:14 Saturday 13th October, 2007
|
|
|
|
|
s196675m wrote: Thank you
You're welcome
I sent another email in reply to the other topic...
Cheers,
MArk
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
you are very dynamic sir.
by the time i downloaded it, copied it onto other system, and unzipped it, you fired the answer.
hats off.
|
|
|
|
|
Heh. Well (s)he sent me a project that built fist try (after conversion to
VS2005 format) so that made it easy.
Plus there wasn't thousands of lines of code to weed through.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I had developed one file manipulation tool using Visual C++ 6.0.. But the customer wishes, that the same exe, if runs under Linux and Sun Solaris, it could be better. Is there any ways to do this?
Thanks in advance,
With Regards,
Sangeetha.
|
|
|
|
|
There is no way for the same .exe to be loaded and executed by Linux or Solaris.
|
|
|
|
|
Hi mike,
Is there any option to develop the application using VC 6.0 to run in Windows, linux as well as in Solaris?
With Regards,
Sangeetha.
|
|
|
|
|
|
thank u mike. i will search and get back to u
With Regards,
Sangeetha.
|
|
|
|
|
Yes, but you need to compile a separate executable file for each platform. You need compilers for Solaris and Linux (for example GCC[^]), VC6.0 on Windows isn't enough.
|
|
|
|
|
Hi all,
Through my code i want to check that internet conection is there on a machine or not. If anybody knows the api or method to do this please tell me. It would be very helpful.
Thanks in advance
|
|
|
|
|
Does InternetGetConnectedState helpful?
|
|
|
|
|
i am using InternetGetConnectedState like this..
<br />
DWORD dwType;<br />
if (!InternetGetConnectedState(&dwType, 0))<br />
{<br />
AfxMessageBox("cable unplugged");<br />
}<br />
else<br />
AfxMessageBox("connection is there");<br />
if i disable my connection then also it gives connection is there.
|
|
|
|