开发者

How to dynamically create a rectangle in visio with c++?

I want to create a rectangle dynamically in visio with C++ code. The Visio API has a function drawRectangle which creates a rectangle but does not return a handle to it. Is there an in built function which returns the rectangle object? If not, What should be the code to create this rectan开发者_StackOverflow社区gle?


DrawRectangle returns a HRESULT (it’s a COM API) and sets the last parameter to be the shape created. If you are using the wrapper classes included in the Visio SDK this will be a CVisioShape&. If you are calling the APIs directly or using some other COM wrappers, e.g. you used the #import directive, the type parameter will be IVShape* or some wrapper around it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜