From: kalpesh on
On May 1, 9:05 am, David <Da...(a)polest.com> wrote:
> kalpesh wrote:
> > I have one DLL which having more then one class. In each class i use
> > some socket function so here i need to call WSAStartup function in
> > every class initialize. I want to avoid to call WSAStartup every time
> > in each class.
> > So is there any technique from which call WSAStartup only once in DLL
> > and used in all the class.
>
> why don't you call WSAStartup () on DLL Loading ?

Thanks for reply, lets i will try to call WSAStrtup on DLL Loading.
From: Scott Seligman on
David <David(a)polest.com> wrote:
>kalpesh wrote:
>> I have one DLL which having more then one class. In each class i use
>> some socket function so here i need to call WSAStartup function in
>> every class initialize. I want to avoid to call WSAStartup every time
>> in each class.
>> So is there any technique from which call WSAStartup only once in DLL
>> and used in all the class.
>
>why don't you call WSAStartup () on DLL Loading ?

That's a great way to produce a deadlock.

--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
The most difficult thing in the world is to know how to do a thing
and to watch someone else do it wrong without comment.
-- Theodore H. White
From: Alain on
> David <David(a)polest.com> wrote:
>> kalpesh wrote:
>>> I have one DLL which having more then one class. In each class i use
>>> some socket function so here i need to call WSAStartup function in
>>> every class initialize. I want to avoid to call WSAStartup every time
>>> in each class.
>>> So is there any technique from which call WSAStartup only once in DLL
>>> and used in all the class.
>>
>> why don't you call WSAStartup () on DLL Loading ?
>
> That's a great way to produce a deadlock.

All initialization must be done on DLL_PROCESS_ATTACH