bonus630 / DockerTemplateX7

CorelDraw Addons Templates for Visual Studio 2005 or Higher. This templates provides easy and fast way to build a custom addin for CorelDRAW, here you can find four diferents templates. A control template, to build a fast and more simple addin, this control will be placed in standard tool bar. A custom tool project, based in official template, but updated to recent versions of visual studio and CorelDRAW. And the big one, docker template, to build a complex addin allocaded in a CorelDRAW docker.
https://marketplace.visualstudio.com/items?itemName=bonus630.CorelDrawDockerTemplate
11 stars 2 forks source link

xlst to call a function defined in a .dll file #9

Closed Marerc closed 2 years ago

Marerc commented 2 years ago

Hi bounus, in this post (https://community.coreldraw.com/sdk/f/coreldraw-and-corel-designer-api/56765/creating-a-custom-menu-with-a-custom-button-in-corel-x8/272326#272326), you had described the .xslt file to create a button and call a macro function. I was wondering whether there is a way to call a function defined in a .dll file, and what if the .dll file is created using c++ or c#.

bonus630 commented 2 years ago

MenuItem template is a good startup to that purpose

Demo https://youtu.be/zu5SDlvKkio

Marerc commented 2 years ago

image Hello, bonus, thanks for your reply, I had looked throught the code, but then I got confused by codes blocks marked above, three key points are

  1. what is the differences with a wrapper and a button? they use different guid.
  2. the onclick envent of a button is bind in the block where it is defined?
  3. what is the parameters for *Bind, is there any material I can refer to?
bonus630 commented 2 years ago

you need pay attention in the item type "button" will transform in a native coreldraw button "wpfhost" will load ours dll to memory, we dont will use onclick event in this case and yes the bind is like you said. No exists documentation about coreldraw bind but works similary to "binding" in wpf. only this https://community.coreldraw.com/sdk/w/articles/218/creating-ruler-tool-for-coreldraw-or-corel-designer

Binds in coreldraw is designed to use wich c++ IDL. If you uses a coreldraw bind in a "onInvoke" attribute this will call a method in modelview likes a command in wpf in anothers case will linked to properties.

image Hello, bonus, thanks for your reply, I had looked throught the code, but then I got confused by codes blocks marked above, three key points are

  1. what is the differences with a wrapper and a button? they use different guid.
  2. the onclick envent of a button is bind in the block where it is defined?
  3. what is the parameters for *Bind, is there any material I can refer to?
Marerc commented 2 years ago

Thanks for your useful knowelege. Now I have got more familiar with this UI stuff. But one more question, when I read this page https://community.coreldraw.com/sdk/w/articles/218/creating-ruler-tool-for-coreldraw-or-corel-designer It says CDR X7 is supported however I am working with CDR X4, and not figure it out yet. Do you know what modification should I made to make this plugin framework works in CDR X4?

bonus630 commented 2 years ago

Sorry, but i dont can help you in this question, i haves start my studies in X7