|
See the sample from MSDN[^]
if we fail to bind to a specified port of listen to a specified port fails, which means that, the port is in use or invalid.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
|
Hello i hav a Dialog class say ABC. In this dialog i have a listbox & button control.
i have another class say XYZ in the same file say it has a Display() Fucntion in which i have add some string into the list box.
what i want when a user click on button dispaly function should be called.
for calling a listbox control variable i have made a object of dialog class within the display function and with the help of this object i call the listbox control variable and add the string into the list box.
and on button click i hav made aobject of xyz class.and call the display function but its giving me assertion error.
what should i do to avoif this error.
thanx
|
|
|
|
|
aavesh wrote: or calling a listbox control variable i have made a object of dialog class within the display function and with the help of this object i call the listbox control variable and add the string into the list box.
I think wha you were doing is wrong.
Seems you need something like this.
this is code can't be applied directly... Just a logic "how to do"
class CXYZ
{
public:
SetListBoxHandle(CListBox* pListBox);
Display();
};
class CMyDialog
{
private:
CXYZ m_xyz;
CListBox m_ListBox;
BOOL OnInitDialog()
{
m_xyz.SetListBoxHandle(&m_pListBox);
}
void OnBtnClick()
{
m_xyz.Display();
}
};
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
hi thanx for replying me.i hav got the answer where i was making mistake but one thing is also which is i'm not getting that how can i call the list control variable in display function.
thanx
|
|
|
|
|
Plz saarth reply me..
i'm waiting for ur reply.
|
|
|
|
|
sorry I left office yesterday...
for that purpose, there's in Set handler function.
keep that in a member varible (pointer type of CListBox) and call when it is required.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
hello
thanx for replying..
sorry i tried to do it but i'm not getting in display function when i call the sethandler function what should i pass into the sethandler function.
i'm doing like this
CTestList::Display()
{ List control variable here
CListBox *l1 = sethandlerlist("what i have to pass here");
l1->AddString("Abc");
}
tell me where i making mistake
thanx
|
|
|
|
|
actually set handler function should be call from the owner of list. i.e in this case, the dailog class. he also contains the XYZ Class too.
so he is becoming as mediator for communication.
set set handler should be called from OnInitDialog or from the constructor.
in the class, you pls add CListBox* m_pList;
in the set handler function
m_pList = pListBox;
inside display function, you can use m_pList, if you properly set the handle.
it's actually not big deal.
I dont have time to write code, that is why im explaining through these steps.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
hello sir,
thanx for replying..
i implement it as u said but its giving me error
"Unhandled exception at 0x7c291bfa (mfc71d.dll) in Kletsmajoor.exe: 0xC0000005: Access violation reading location 0xccccccec."
i try to debug the error and found that NULL in the m_hwnd variable.
what should i do.
thanx
|
|
|
|
|
you are calling an invalid pointer.
i.e ListBox pointer is invalid
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
thanx dude
u r gr8
thank you very much
bye
|
|
|
|
|
did you solve it?
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
yes i did.
actually i was calling the display function with a wrong object.
i'm facing one another problem is that i have to add image & string simultaneously in the list i'm using listctrl for it.
but not getting the appropriate solution.
thanx
|
|
|
|
|
either derive a class from CListBox and handle it inside or use a listctrl instead. Anyway it's easy to handle it using Image lists or GDI drawing.
Check MSDN for more information. all controls have been illustrated in sample application called CTRLTEST. or search CP for more information.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
Plz sarath reply me..
i'm waiting for ur reply.
|
|
|
|
|
Hi all
i am working with mfc (VC++ 6).
In ny project i have a situation to identify the right click on a button.
Please help me
Thanks
-- modified at 6:20 Saturday 8th July, 2006
|
|
|
|
|
Dinu John wrote: the right on a button.
I didnt get you ....
right on means "accurate"
or you are trying to get mouse move? right click or what?
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
Thank u ,
I mean ,right click on button,please reply
|
|
|
|
|
Hi Dinu,
there's is no message map, that can map right button click
so derive a class from CButton.
Add WM_RBUTTONDOWN message handler and the needful there. Subclass or add control variable for your button.
now you are done.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
WM_RBUTTONDOWN / WM_RBUTTONUP?
|
|
|
|
|
->Thanks ,
but my requirement is ,i need a pop up menu when right click on the button which is on form view,ie (pop up will come over the button)
|
|
|
|
|
Why won't WM_RBUTTONDOWN / WM_RBUTTONUP suit your needs? What about WM_CONTEXTMENU?
|
|
|
|
|
Hi guys
I need to save the time with resolution of 1 milli second in one of my project.
Please give me some information in this regard.
Thanks in advance
Mahdi
|
|
|
|
|
Hi guys
I need to save the time with resolution of 1 milli second in one of my project.
I fine that CTime class has not enough resolution for this.
Please give me some information in this regard
Thanks in advance
Mahdi
|
|
|
|