Originally Posted by
disruptor108
7fff
Ok well that confirms your assumption about the value of RAND_MAX, and the print function is the problem. I would try some version of sprintf(). So instead of:
Code:
>_tcscpy(ProductID, _T("{%8X-%4X-%4X-%4X-%12X}", rand(), rand(), rand(), rand(), rand()));
Try:
Code:
_tsprintf(ProductID, _T("{%8X-%4X-%4X-%4X-%12X}", rand(), rand(), rand(), rand(), rand()));
And if that doesn't work or there is no such animal, then try sprintf():
Code:
_sprintf(ProductID, "{%8X-%4X-%4X-%4X-%12X}", rand(), rand(), rand(), rand(), rand()));