Click here to Skip to main content
15,902,635 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: calling the function specified by a string Pin
John M. Drescher7-Aug-03 23:30
John M. Drescher7-Aug-03 23:30 
GeneralRe: calling the function specified by a string Pin
Vitali Halershtein7-Aug-03 23:36
Vitali Halershtein7-Aug-03 23:36 
GeneralRe: calling the function specified by a string Pin
jhwurmbach8-Aug-03 3:03
jhwurmbach8-Aug-03 3:03 
GeneralRe: calling the function specified by a string Pin
Jerome Conus8-Aug-03 3:23
Jerome Conus8-Aug-03 3:23 
GeneralRe: calling the function specified by a string Pin
jhwurmbach8-Aug-03 4:30
jhwurmbach8-Aug-03 4:30 
GeneralRe: calling the function specified by a string Pin
Jerome Conus8-Aug-03 4:39
Jerome Conus8-Aug-03 4:39 
GeneralRe: calling the function specified by a string Pin
Anthony_Yio11-Aug-03 2:06
Anthony_Yio11-Aug-03 2:06 
GeneralStock Color Property Page Pin
marcvoor1237-Aug-03 22:37
marcvoor1237-Aug-03 22:37 
GeneralProblems with sockets (win32) Pin
justin2237-Aug-03 21:55
justin2237-Aug-03 21:55 
GeneralRe: Problems with sockets (win32) Pin
John M. Drescher7-Aug-03 23:25
John M. Drescher7-Aug-03 23:25 
GeneralRe: Problems with sockets (win32) Pin
justin2237-Aug-03 23:27
justin2237-Aug-03 23:27 
GeneralCursor in DirectX Pin
Skirmish7-Aug-03 21:23
Skirmish7-Aug-03 21:23 
GeneralResizing limit Pin
SLiDeR7-Aug-03 20:08
SLiDeR7-Aug-03 20:08 
GeneralRe: Resizing limit Pin
Larry Antram7-Aug-03 20:17
Larry Antram7-Aug-03 20:17 
QuestionHow to fire an event from the program? Pin
ben27-Aug-03 20:02
ben27-Aug-03 20:02 
AnswerRe: How to fire an event from the program? Pin
Anthony_Yio7-Aug-03 23:37
Anthony_Yio7-Aug-03 23:37 
GeneralInternet Explorer custom menu Pin
Mohsen Saad7-Aug-03 19:18
Mohsen Saad7-Aug-03 19:18 
QuestionIn OLE,how to know that the server has finished one operation? Pin
vcseeker7-Aug-03 18:20
vcseeker7-Aug-03 18:20 
GeneralHelp! Pin
DaveE9th7-Aug-03 16:43
DaveE9th7-Aug-03 16:43 
GeneralRe: Help! Pin
Dave Bryant7-Aug-03 17:32
Dave Bryant7-Aug-03 17:32 
// Seed the random number generator
srand( time(0) );

// This is the highest number we want
const int nMaxNum = 1234;

// Generate it
int nNum = rand() % nMaxNum + 1;

rand() gives us a number between 0 and RAND_MAX (which if i recall correctly is ~32768 on VC6), so to convert it to the range we want, we divide it by the max number and take the remainder.

random_shuffle() randomises the order of components in a random access container such as a vector - you should not be using this function to generate a random number, but instead you could insert the records for all the songs into a vector, and then call random_shuffle on the vector to randomise it.

e.g.

struct Record
{
  string sName;
  // Data for the song itself
};

vector<record> vSongs;

// Add some songs
vSongs.push_back( record1 );
vSongs.push_back( record2 ); // etc...

// Randomise them
random_shuffle( vSongs.begin(), vSongs.end() );

Dave
http://www.cloudsofheaven.org
GeneralRe: Help! Pin
DaveE9th7-Aug-03 17:35
DaveE9th7-Aug-03 17:35 
GeneralRe: Help! Pin
Dave Bryant7-Aug-03 17:43
Dave Bryant7-Aug-03 17:43 
GeneralRe: Help! Pin
DaveE9th7-Aug-03 19:35
DaveE9th7-Aug-03 19:35 
QuestionHow can I create a window? Pin
ribbs7-Aug-03 15:23
ribbs7-Aug-03 15:23 
GeneralScrolling a tree view Pin
Marissa1827-Aug-03 14:26
Marissa1827-Aug-03 14:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.