I am an engineer and just began to learn MFC using Visual C++ ver6. Now I try to obtain random numbers from CryptoAPI to use scientific calculations (Monte Carlo).
I got some instructions from Intel HP, including icsp4ms.h
files and tried to install the software.

Although I used the code written in the document files as:

// Get 4-bytes random number
if (CryptGenRandom(hProv, randomLength, (BYTE*)&randomNumber) != TRUE)

I could not obtain random numbers (The flag is FALSE).
I am using Windows XP in Dell precision 530. I am worried that the Intel instructions do not show the case of XP.

Could anyone tell me the method to get random number in the case of Windows XP or correct HP site to treat this
matter? I

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

File "icsp4ms.h" is not from Intel C++ compiler. We don't have the API CryptGenRandom() also. You need to contact the originator of the product for more information.

One tip for you, some times it's the parameters you passed that aren't right. Make sure the passing by value or name parameters contain the correct value for the API.


Leave a Comment

Please sign in to add a comment. Not a member? Join today