Hello,I use VSTA editor from Corel X5Visual studio 2019 installedI Build AddIn3.dll and place in necessary CorelDraw AddIns folder.
In AddIn3.dll i put code for Main.vb
<System.AddIn.AddIn("My Add-in", Version:="1.0", Publisher:="", Description:="")> _Partial Class Main WithEvents app As Application
Private Sub Main_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup app = CType(Me.Host, Application) MsgBox("COREL VSTA CREATED" & Chr(13) & "START" & Chr(13) & "G:\ONEDRIVE\Documents\Corel\VSTA\CorelDRAW\Addins\AddIn3.dll") End Sub
Private Sub Main_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown MsgBox("COREL VSTA CREATED" & Chr(13) & "END" & Chr(13) & "G:\ONEDRIVE\Documents\Corel\VSTA\CorelDRAW\Addins\AddIn3.dll") End Sub
Private Sub app_DocumentNew(ByVal Doc As Corel.Interop.CorelDRAW.Document, ByVal FromTemplate As Boolean, ByVal Template As String, ByVal IncludeGraphics As Boolean) Handles app.DocumentNew MsgBox("COREL VSTA CREATED" & Chr(13) & "DOCUMENT NEW" & Chr(13) & "G:\ONEDRIVE\Documents\Corel\VSTA\CorelDRAW\Addins\AddIn3.dll") End SubEnd Class
All code above worked well for events Startup, Shutdown, DocumentNew
In Module1.vb i put
Public Sub AddIn3Proba2() MsgBox("OK")End Sub
Then in VBE of Globalmacros.gms in module CorelMacros i putPublic Declare Sub AddIn3proba2 Lib "G:\ONEDRIVE\Documents\Corel\VSTA\CorelDRAW\Addins\AddIn3.dll" ()Sub just_created_macro2()AddIn3proba2End SubAnd when start just_created_macro2 Error message appeared:Can't find DLL entry point AddIN3proba2 in G:\ONEDRIVE\Documents\Corel\VSTA\CorelDRAW\Addins\AddIn3.dllMy question is related with above information: How to add Sub or Function to AddIn3.dll, where document events work well, but no Function or Sub. I can not create any worked Sub or Function in this project. I create, but they not work and the above error message appears.Please help!Greetings!