12345678910111213141516171819202122232425262728293031323334353637 |
- #include "cdrapp.h"
- corel *cdr = NULL;
- int main() {
- HRESULT hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
- if (SUCCEEDED(hr)) {
- try {
- Call_CorelDRAW();
- } catch (_com_error &e) {
- MessageBox(NULL, e.Description(), "Error", MB_ICONSTOP);
- }
- CoUninitialize();
- }
- return 0;
- }
- void Call_CorelDRAW() {
- IVGApplicationPtr app(L"CorelDRAW.Application.24"); // 我的电脑 X6 正常 ; 毛子版 CorelDRAW 2020 绑定不上,没法使用
- app->Visible = VARIANT_TRUE;
- auto doc = app->ActiveDocument;
- if (!doc)
- doc = app->CreateDocument();
- cdr = app;
- // // 调用CDR功能, 计算多边形重心点
- // polygon_gravity_dot(cdr);
- // // 绘制 RGB 三原色,测试相交建立物件
- // test_IntersectsWith(cdr);
- test_IsOnShape(cdr);
- }
|