1

在我的代码中,这绝对可以正常工作:

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

但是我不想传递一个 staitc 值,而是想传递这样的东西,但它给出了编译错误:

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

有人可以建议我如何实现这一目标。

谢谢,萨南

4

1 回答 1

2

这看起来像是在编译时使用的东西。所以没有办法传递动态值。

于 2012-10-02T11:49:16.513 回答