Click here to Skip to main content
15,885,940 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with combo Box-values get repeating Pin
SnaKeBeD31-Oct-07 3:28
SnaKeBeD31-Oct-07 3:28 
GeneralRe: Problem with combo Box-values get repeating Pin
David Crow31-Oct-07 3:36
David Crow31-Oct-07 3:36 
GeneralRe: Problem with combo Box-values get repeating Pin
SnaKeBeD31-Oct-07 3:48
SnaKeBeD31-Oct-07 3:48 
QuestionTrying to create a guid in C++ from my code Pin
LCI31-Oct-07 2:22
LCI31-Oct-07 2:22 
QuestionRe: Trying to create a guid in C++ from my code Pin
David Crow31-Oct-07 2:26
David Crow31-Oct-07 2:26 
AnswerRe: Trying to create a guid in C++ from my code Pin
George L. Jackson31-Oct-07 2:41
George L. Jackson31-Oct-07 2:41 
AnswerRe: Trying to create a guid in C++ from my code Pin
jhwurmbach31-Oct-07 2:30
jhwurmbach31-Oct-07 2:30 
AnswerRe: Trying to create a guid in C++ from my code [modified] Pin
KenThompson31-Oct-07 2:43
KenThompson31-Oct-07 2:43 
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
#endif

#include <stdio.h>
#include <assert.h>
#if defined(_WIN32) || defined(__CYGWIN__)
#include <objbase.h>
#elif defined MACOSX
#include <string.h>
#include <uuid/uuid.h>
#elif defined __FreeBSD__
# if __FreeBSD_version >= 500000
# include <uuid.h>
# else
# error FreeBSD versions prior to 500000 does not support uuid(3)
# endif
#else
#include <uuid/uuid.h>
#endif

///Above are my includes, below is the calls abstracted

#if defined(_WIN32) || defined(__CYGWIN__)
GUID randomGuid;
// create random GUID
randomGuid = GUID_NULL;
::CoCreateGuid(&randomGuid);
if (randomGuid == GUID_NULL)
{
fprintf(stderr,"Couldn't create a random GUID\n");
return;
}
memcpy(m_bufuid, &randomGuid, 16);
#elif defined __FreeBSD__
uuid_t uid; // uuid_t is a struct
uuid_create(&uid, NULL);
memcpy(m_bufuid, &uid, 16);
#else
uuid_t uid; // uuid_t is defined as unsigned char[16]
uuid_generate(uid);
memcpy(m_bufuid, uid, 16);
#endif

std::string tmp;
char cuid[100]; // Uid::GetUid temporary

sprintf(cuid,"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
m_bufuid[0],m_bufuid[1],m_bufuid[2],m_bufuid[3],
m_bufuid[4],m_bufuid[5],m_bufuid[6],m_bufuid[7],
m_bufuid[8],m_bufuid[9],m_bufuid[10],m_bufuid[11],
m_bufuid[12],m_bufuid[13],m_bufuid[14],m_bufuid[15]);
tmp = cuid;


Done.


-- modified at 8:48 Wednesday 31st October, 2007
GeneralRe: Trying to create a guid in C++ from my code Pin
jhwurmbach31-Oct-07 3:17
jhwurmbach31-Oct-07 3:17 
GeneralRe: Trying to create a guid in C++ from my code Pin
KenThompson1-Nov-07 2:47
KenThompson1-Nov-07 2:47 
QuestionLoad AVI streams with MCIWnd.OpenInterface Pin
sdancer7531-Oct-07 2:04
sdancer7531-Oct-07 2:04 
Questionmaximal number of dialogs Pin
baerten31-Oct-07 1:56
baerten31-Oct-07 1:56 
AnswerRe: maximal number of dialogs Pin
Paresh Chitte31-Oct-07 2:08
Paresh Chitte31-Oct-07 2:08 
GeneralRe: maximal number of dialogs Pin
baerten31-Oct-07 2:16
baerten31-Oct-07 2:16 
AnswerRe: maximal number of dialogs Pin
Shivarudrayya H31-Oct-07 2:17
Shivarudrayya H31-Oct-07 2:17 
AnswerRe: maximal number of dialogs Pin
David Crow31-Oct-07 2:28
David Crow31-Oct-07 2:28 
JokeThanks to you all Pin
baerten31-Oct-07 4:19
baerten31-Oct-07 4:19 
AnswerRe: maximal number of dialogs Pin
Randor 31-Oct-07 4:34
professional Randor 31-Oct-07 4:34 
Questionhow to change the color of message box Pin
rajneshmalik31-Oct-07 1:21
rajneshmalik31-Oct-07 1:21 
AnswerRe: how to change the color of message box Pin
David Crow31-Oct-07 2:29
David Crow31-Oct-07 2:29 
QuestionCursor help: [modified] Pin
Hakan Bulut31-Oct-07 0:41
Hakan Bulut31-Oct-07 0:41 
AnswerRe: Cursor help: Pin
Karismatic31-Oct-07 0:55
Karismatic31-Oct-07 0:55 
GeneralRe: Cursor help: Pin
Hakan Bulut31-Oct-07 1:04
Hakan Bulut31-Oct-07 1:04 
GeneralRe: Cursor help: Pin
Roger Broomfield31-Oct-07 1:39
Roger Broomfield31-Oct-07 1:39 
GeneralRe: Cursor help: Pin
Mark Salsbery31-Oct-07 5:30
Mark Salsbery31-Oct-07 5:30 

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.