Click to See Complete Forum and Search --> : How write Addin for CorelDraw 12 in C#?
Aleksan
April 21st, 2004, 04:14 AM
Can any body help me write addin for Corel in C#?
Ho catch Execute event ?
OnConnection function look lile this
public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
{
CorelApplication =(CorelDRAW.Application)application;
CorelApplication.AddIns.Attach(VGCore.cdrAddinFilter.cdrAddinFilterNone,"Execute");
//then.....?????
}
Have anybody experience in this field?
Mr. Tomaszek
April 21st, 2004, 07:51 AM
Have you got some documentation from Corel Corp. ? Samples are always best way to start with new stuff.
Aleksan
April 21st, 2004, 07:53 AM
All samples in VisualBasic....
Mr. Tomaszek
April 21st, 2004, 08:19 AM
Yup! Thats common problem. Some time ago I were developing addin for MS Project and guess what? All samples in VB :(
Fortunatelly I has found some samples in C++ on Web
As I know you have to have OnServerLoad function and couple others to get add-in loaded right.
You have to analyze VB samples -- sorry I can't help at this point.
Aleksan
April 21st, 2004, 08:43 AM
In Basic its look like this
Dim Draw As CorelDRAW.Application
Dim WithEvents MyAddin As CorelDRAW.AddinHook
Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)
Set Draw = Application
Set MyAddin = Draw.AddIns.Attach(cdrAddinFilterNone, "Get Shape Length")
End Sub
Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
Set GetLengthAddin = Nothing
Set Draw = Nothing
End Sub
Private Sub GetLengthAddin_Execute()
End Sub
How do transformation to C#?
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.