Enclosed is the source code to an original dll which has random functions. This dll has to be rewritten in .net because the original component was COM and is not always compatible with .net applications when deploying them. This new dll needs to be a .net assembly and cannot reference any COM objects or require the COM object to be installed for it to work.
More Info is found below.
## Deliverables
The original dll was written in C++ but the new version can be in any language as long as the final results is a .net assembly. This will not be used from 6.0 but will be used with .net only.
The name of the new dll will be [login to view URL]
The 2 classes will be Generator and RandomList
There are three functions for the Generator
They are GenerateRandomList, GenerateRandomListEx, GetRandomNumber
The RandomList should be a collection (which will hold the list of random numbers).
For the GenerateRandomList, there are the following parameters
1. MaxNumber (which is the maximum number chosen)
2. NumberInList (which is how big the list will be)
3. PreviousList as collection (if a number is on the list, then cannot pick it) this is optional
4. SetToContinue (will be either appended to this list or this list will go after the new list) this is optional
5. PutBefore (if this is true, then the numbers chosen will be put before the set to continue. otherwise will be put after) optional
This function will return a list of nonrepeating numbers
The next function is GenerateRandomListEx which is similar but this one reshuffles the list sent in
The parameters for this one are these:
1. ListToRandomize (The numbers will be reshuffled)
2. SetToContinue (This is another list that if sent in, will be part of the new list in the order given either before or after) optional
3. PutBefore (if false, then the new list will be appended to the old list). Otherwise, the new list will be before the previous list optional
4. HowMany (if given, then will only randomize a certain number of them). default is -1 which means the entire list optional
The final function is GetRandomNumber
The parameters for this one are these:
1. MaxNumber (which will be the max number chosen)
2. StartingNumber (default will be one which will be the starting point for the function) optional
3. PreviousList (if the list is given, then it cannot choose any of the numbers on the list) optional
If it cannot pick a random number because the range is too narrow, then it needs to raise an error
Let me know if you have any questions.
The compiled dll and the source code to the code completed. This must be completed with Visual Studio 2005 and cannot have any references to any COM objects or require any to be installed. Can be done with any .net languages but needs to be callable from Visual [login to view URL] 2005.
## Platform
Windows XP Home Edition, Visual Studio 2005