mfc - GUID default value in c++ -


i want use guid in class.

1) want give default value in default constructor (something 0, null, etc). how can it?

2) in constructor, want give default value in case call constructor don't have it. example:

the constructor: my_class(int a, int b, int c = 0, guid g = ???) call: my_class m = new my_class(5,3); 

how can it?

thanks

1, default value of guid: guid_null, or iid_null (it alias of guid_null)

2, think should use refguid rather guid directly. in header files can use define_guid(guid_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) define static guid guid_name. in class define refguid member , assign guid_name it.

// {4cad5fed-86ca-453a-b813-0876daa992df} define_guid(_guid_a,    0x4cad5fed, 0x86ca, 0x453a, 0xb8, 0x13, 0x8, 0x76, 0xda, 0xa9, 0x92, 0xdf);  class myclass { private:   refguid rguid;  public:   myclass() : rguid(&guid_null)   { }    myclass(int a) : rguid(&_guid_a)    { } }; 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -