|
This may be totally unrelated, but if you are using listen(), what happens if you use a
larger backlog value? SOMAXCONN is typically 5 which may cause alot of refused connections
if they come in fast enough.
|
|
|
|
|
Hi Guys
What's the way to get the Item & subItem when I double clic in a CListCtrl
That's what I have, but, how to get Item & SubItem from that?
void CDlgDebug::OnDoubleClickList(NMHDR* pNMHDR, LRESULT* pResult)
{
}
|
|
|
|
|
Look up the NMLISTVIEW structure - you will be casting the NMHDR pointer to a NMLISTVIEW pointer and getting the information from it.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Thanks, I'll take a look.
|
|
|
|
|
HI,
Iam Doing An application Using Tree Control.
My problem is If I double Click on Any Root Item on the Tree That Should be display in one Edit Box.
But Iam not Getting .
plz check this code
void CTreeItem::OnDblclkTree1(NMHDR* pNMHDR, LRESULT* pResult)
{
// m_Tree is Tree Control Variable
HTREEITEM hItem = m_Tree.GetRootItem();
if ((hItem != NULL) && m_Tree.ItemHasChildren(hItem))
{
m_Tree.Expand(hItem, TVE_EXPAND);
m_Tree.EnsureVisible(hItem);
}
CString str=m_Tree.GetItemText( hItem );
UpdateData(FALSE);
CDUXmlRuleDlgDlg duxml;
// m_strNodeName is My Edit Box Control Variable.
duxml.m_strNodeName = str;
UpdateData(FALSE);
*pResult = 0;
}
plz check this
|
|
|
|
|
If I've understood your intent, I think you want to have the edit box filled with the item text from the node you double clicked. The HTREEITEM returned by GetRootItem is instead going to point to the root of the entire tree control. Try using GetSelectedItem.
|
|
|
|
|
Krishnatv wrote: My problem is If I double Click on Any Root Item on the Tree That Should be display in one Edit Box.
That edit box is on CDUXmlRuleDlgDlg , but in your code, I cant see , you have invoked it.
Krishnatv wrote: CDUXmlRuleDlgDlg duxml;
// m_strNodeName is My Edit Box Control Variable.
duxml.m_strNodeName = str;
UpdateData(FALSE);
UpdateData should be called here on you dialog object, after displaying it.
|
|
|
|
|
Dear All,
I have a MFC application and also i am having a COM interface with that application. Both are running at the same address space.
Now that MFC application is up, when I call that COM interface from different program, everything goes correct. well.
After the COM fn execution is done, the MFC application goes out of memory (application stoped).
What is the reason for this?
I need to have MFC application to be in memory still even COM fn is done.
To do this, what should i do ? How can i do this ?
Kindly help me.
Thanks.
|
|
|
|
|
I believe that this is the default behavior for COM Servers.
You can check the command line to see if you are being launched normally (no /Embedding or /Automation parameters), and manually bump your internal COM reference/instance count once. That will prevent unloading when a COM client connects (bumping the instance count) and disconnects (decrementing the instance count), because your instance count will still be above zero. You can use the CCommandLineInfo object used in your app's initialization and checks its members.
Be sure to also manually decrement the count when the user manually shuts your app down so that it unloads correctly, or your app will hide but keep running in the background.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I have an OpenMutex() api call which I have fished out of a decompiled dll. The access rights member in the call is 0x00100000 . I have looking through the winnt.h header file trying to figure out which definition this would equate to, but I just cannot see it in there. Does anybody know what it is?
|
|
|
|
|
some times they might have made a custom security descriptor..
nave
|
|
|
|
|
SYNCHRONIZE (0x00100000L)
The right to use the object for synchronization. This enables a thread to wait until the object is in the signaled state.
Link[^]
Last modified: 2mins after originally posted -- link added
I don't believe in failure. It is not failure if you enjoyed the process.
|
|
|
|
|
Ahh thanks for that. I did see that macro, but MSDN was throwing me off a little.
|
|
|
|
|
I want to have a class in two namespace . If you know how its possible , please share with me .
In other word :
<br />
namespace A<br />
{<br />
class cls1<br />
{<br />
public:<br />
cls1()<br />
{<br />
};<br />
}<br />
}<br />
<br />
namespace B<br />
{<br />
????????
}<br />
<br />
main()<br />
{<br />
A::cls1 var1;<br />
B::cls1 var2;<br />
}<br />
<br />
Thanks a lot .
|
|
|
|
|
put the same thing in namespace B what u mentioned in namespace A
never say die
|
|
|
|
|
No in that case , class B::cls1 isn't same A::cls1 . (It is differ with A::cls1 ).
thanks .
|
|
|
|
|
Why do you want to do such a thing ??
It is probably a bad design, unless the two namespaces are nested.
|
|
|
|
|
I have a class that in conceptual model is in two namespace .
|
|
|
|
|
I cannot understand why do you want to do that. Anyway a (poor, I agree...) workaround maybe
namespace B
{
class cls1 : public A::cls1
{
};
};
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
You should be able to put whatever class def you want into namespace B . What exactly are you worried about?
namespace A
{
class cls1
{
public:
cls1()
{
};
void ThisFunc1()
{
};
}
}
namespace B
{
<CODE> class cls1
{
public:
cls1()
{
};
void AnotherFunc42()
{
};
}</CODE>
}
main()
{
A::cls1 var1;
<code> B::cls1 var2;</code>
var1.MyFunc1();
<code> var2.AnotherFunc42();</code>
} Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
me think you cannot share a class between 2 namespace.
|
|
|
|
|
Might depend on what you mean by "share"... I think the following should work:
namespace A
{
class cls1
{
public:
cls1()
{
};
void ThisFunc1()
{
};
}
}
namespace B
{
<CODE> class cls1
{
public:
cls1()
{
};
void AnotherFunc42()
{
m_cls1FromA.ThisFunc1();
};
A::cls1 m_cls1FromA;
}</CODE>
} Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Those will be 2 distinct and different classes in 2 namespaces.
If I understood the original post, the guy wanted to start his class declaration in one namespace and continued it in the second namespace.
|
|
|
|
|
Yes, but one shares the other - but I could misunderstand what the OP is talking about.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
It's not clear from your question, but I think you want to have the class A::cls1 also visible in namespace B . If that's right, do this:
namespace A {
class cls1 { ... };
}
namespace B {
using A::cls1;
}
|
|
|
|