Search code examples
c++uuiddeclspec

how to pass dynamic value in __declspec(uuid(" ComObjectGUID ") )


In my code this works absolutely fine :

class __declspec(uuid("842E12D3-1F2C-435D-8426-BE42150AF4DB")) guid;

but instead of passing a staitc value I want to pass something like this, but it gives compilation error :

string result("64ca9bdb-08d2-45f7-c526-8fcaa8d5abd1");
class __declspec(uuid(result)) guid; 

//"result" will have dynamic value and that's why want to pass it a variable rather than hard coding the value

Can someone please suggest me how to achieve this.

Thanks, Sanam


Solution

  • This looks like something that is used at compile time. So there is no way to pass a dynamic value.