|
How many processors does your server have?
500 threads is a huge waste of resources on a machine with say, 4 processors.
See Tip #2 here: INFO: Design Issues When Using IOCP in a Winsock Server[^]
You should be able to handle thousands of connections with at most, a couple threads
per CPU.
Regardless, IOCPs don't have multiple thread pools. The thread pool size is
determined by how many threads you have waiting on GetQueuedCompletionStatus().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Can anyone help me regarding adding menu dynamically in MFC project ...
|
|
|
|
|
You must load your menu with LoadMenu and then use of SetMenu.
|
|
|
|
|
Hi,
I m try to develop an editor that can open file from a web folder. For example a microsoft word file is placed on local host. How can i open it in a windows appllication. Please let me know if there is any article or solution about that. It would be so nice of you.
Arslan Ilyas
Pakistan Interactive
|
|
|
|
|
hai..,
in ur local host if u want to run or open any file..U can use ShellExecute API. u wnat like this only ..or...any other method...
Born to win...!
|
|
|
|
|
i gonna check it out. Any ways thanks alot
|
|
|
|
|
I write a program to count the number of objects. But when I compile it, I met with link errors. How can I resolve it?
Head files:
template <class beingcounted="">
class Counted
{
public:
class TooManyObjects{};
static int getObjectNum()
{
return m_ObjectNum;
};
protected:
Counted();
Counted(const Counted& count);
~Counted() { --m_ObjectNum; };
private:
static int m_ObjectNum;
static const size_t m_MaxObjectNum;
void init();
};
int Counted<class beingcounted="">::m_ObjectNum = 0;
const size_t Counted<class beingcounted="">::m_MaxObjectNum = 5;
class Printer: private Counted<printer>
{
public:
static Printer* makePrinter();
static Printer* makePrinter(const Printer& rhs);
~Printer();
void reset();
void performSelfTest();
using Counted<printer>::getObjectNum;
using Counted<printer>::TooManyObjects;
private:
Printer();
Printer(const Printer& rhs);
};
in definition file:
template <class beingcounted=""> Counted<beingcounted>::Counted()
{
init();
}
template <class beingcounted=""> Counted<beingcounted>::Counted(const Counted& count)
{
init();
}
template <class beingcounted=""> Counted<beingcounted>::init()
{
if(m_ObjectNum > m_MaxObjectNum)
{
throw TooManyObjects();
}
++m_ObjectNum;
}
Printer::Printer(){}
Printer::Printer(const Printer &rhs) {}
Printer::~Printer() {}
Printer* Printer::makePrinter()
{
return new Printer();
}
Printer* Printer::makePrinter(const Printer& rhs)
{
return new Printer(rhs);
}
error LNK2001 private static int Counted<class printer="">::m_ObjectNum"XXX" is unresloved
error LNK2019 protected: _thiscall Counted<class printer="">::Counted<class printer="">(void)
"private _thiscall Printer::Printer(void)"
why? Does the static memeber of a class can only be initialized by its base class. How about its derived class?
Many thanks
|
|
|
|
|
error LNK2001 private static int Counted::m_ObjectNum"XXX" is unresloved
In the definition file, you need to declare it also. ( One time in the .h and one time in the .cpp)
I hope it resolves this error
|
|
|
|
|
baerten wrote: One time in the .h
You don't need it.
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.
|
|
|
|
|
your code seems bad formatted, use <pre> tags as follows
<pre>
//code here...
</pre>
to repost edit your post.
-- modified at 5:30 Monday 19th November, 2007
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.
|
|
|
|
|
CPallini wrote: to repost
to repost ? no ! to edit !
|
|
|
|
|
toxcct wrote: to edit !
Sure!
Hence I've to edit my post too.
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.
|
|
|
|
|
There is an API RegDeleteKeyValue, I am using that in my program, but I am getting the error "Error 1 error C3861: 'RegDeleteKeyValue': identifier not found", though I have included the required header files.
Documentation of that API: http://msdn2.microsoft.com/en-us/library/ms724848.aspx[^]
Does anyone know about that problem?
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
Hai..
i had an experience with registry API's...please chk the libraries and header fles u included....
surely it will work..
Regards,
Mani,
India
Born to win...!
|
|
|
|
|
can u be more clear about , how u included the lib file??
||SnAkeBed||
|
|
|
|
|
Actually i missed some info as it works only in Vista and windows server 2008. Thanks for the reply.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
Did you notice in the link you provided it says
"Requires Windows Vista"?
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I missed that, thanks for the info.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
Did you insert include files?
|
|
|
|
|
I want to change the selection mark in List Control when I press the button
I use this code
<br />
int sel = m_clist1.GetSelectionMark();<br />
sel++;<br />
m_clist1.SetSelectionMark(sel);<br />
after this code the selection Mark have change (I use GetSelectionMark functionn for check) but no highlight in List Control
How can I set the highlight to List Control
|
|
|
|
|
SetItemState(/*parameters*/);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I also try this it's still don't work
int sel = m_clist1.GetSelectionMark();<br />
sel++;<br />
m_clist1.SetSelectionMark(sel);<br />
m_clist1.SetItemState(sel, LVIS_SELECTED, LVIS_SELECTED);<br />
m_clist1.SetItemState(sel, LVIS_FOCUSED, LVIS_FOCUSED);
|
|
|
|
|
not sure exactly, but have you also set focus onto this control?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
Thank a lot
It work!!
m_clist1.SetFocus();<br />
int sel = m_clist1.GetSelectionMark();<br />
sel++;<br />
m_clist1.SetSelectionMark(sel);<br />
m_clist1.SetItemState(sel, LVIS_SELECTED, LVIS_SELECTED);<br />
m_clist1.SetItemState(sel, LVIS_FOCUSED, LVIS_FOCUSED);<br />
|
|
|
|