Digital Art Zone

 
     
Total noob question
Posted: 05 September 2012 04:24 PM   [ Ignore ]
New Member
Total Posts:  14
Joined  2004-11-03

This is probably going to sound like a total noob question, but why doesn’t the sprintf command work with the CSDK?

I included the library, so it should work. Is there possibly a setting I forgot to check in VS?

TIA,
Ernie

Profile
 
 
Posted: 05 September 2012 05:25 PM   [ Ignore ]   [ # 1 ]
Member
Avatar
Rank
Total Posts:  29
Joined  2005-09-14

Ernie,

It works, sounds like a VS thing. I use it for debug stuff all the time.

#ifdef _DEBUG 
#include "Windows.h"
#include <stdio.h>
#endif
...
#ifdef _DEBUG
 
char temp[80];
 
sprintf_s(temp80"releasing  0x%x used by 0x%x on thread 0x%x\n\0", &element;.elementusedByGetCurrentThreadId());
 
OutputDebugStringA(temp);
#endif 

Regards,

 Signature 

Eric Winemiller
Digital Carvers Guild
Plug-ins for Carrara and LightWave

Profile
 
 
Posted: 05 September 2012 05:34 PM   [ Ignore ]   [ # 2 ]
Member
Avatar
Rank
Total Posts:  29
Joined  2005-09-14

Oh, just noticed, i’m using sprintf_s.

 Signature 

Eric Winemiller
Digital Carvers Guild
Plug-ins for Carrara and LightWave

Profile
 
 
Posted: 09 September 2012 06:34 PM   [ Ignore ]   [ # 3 ]
New Member
Total Posts:  14
Joined  2004-11-03

Actually I just noticed what’s wrong from the code you posted. I completely forgot to include “windows.h”!

Thanks Eric.

Profile