hi
how about using a counter (environment variable or file containing it) which is
incremented each time the dll is launched. so every time you launch the dll you
have a new seed value (n+1) (+ adding time seconds).
Alois
> Hello everybody
>
> I am designing a win32 dll in vc++ for execution under mIRC (an irc chat
> client).
> The idea of the app is that when the dll is called within irc, it prints a
> message to the current channel. This is working so far.
>
> I want to use the stdio.h header for rand() and srand() random number
> generator
> and seeder along with time.h for seeding the generator. I only want to
> generate
> about 4 random numbers during the execution of my dll. The problem is, when
> the
> dll is finished, the randomizer is (as expected) reset, so if i execute the
> dll
> within a second later, i get the exact same 'random' numbers. Becuase I am
> seeding the random number generator with a 1 second resolution I guess this
> makes sense but its not suitable for my program.
>
> What could i do to solve the problem?
>
> I know keeping the dll loaded is an option and mIRC provides a means to do
> this
> but I would reeeeeally like an alternative method if anyone can think of
> one!
>
> Can anyone maybe recomend something else I can seed the generator with to
> prevent
> this problem?
>
> Any other suggestions welcome
>
> Mikael
>
- - - - - - - - - - - - - - - - - - - - - - - - - -
Alois Bauer
WORK Microwave GmbH
Raiffeisenstr. 12, D-83607 Holzkirchen, Germany
Tel. {+49} (0)8024-6408-0 / FAX (0)8024-640840
--
Author: Alois Bauer
INET: [EMAIL PROTECTED]
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB CHIPDIR-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).