Open finich1981 opened 1 year ago
Sorry, this "problem" has been known to me for years, problems in XSLT files cause your addon not to be shown, in the case of docker it would not be available. This problem is most often related to VGCore versioning and modified versions. Note that for the controls present in the dockers to be displayed it is necessary to execute the "InitializeComponent" method in the constructor of your Docker, if this method is not executing we have the blank control, so the error occurs before, probably at the moment that .NET tries loads the unmanaged DLL into memory
`
You can try to resolve the assemblies path at runtime, but this will cause problems with other addons loaded in coreldraw
AppDomain.CurrentDomain.AssemblyResolve += (s, args) =>
{
string name = args.Name;
if (name.Contains("Corel.Interop.VGCore"))
{
string vgCoreDllPath = @"<CorelProgramFolder>\Assemblies\Corel.Interop.VGCore.dll";
Assembly asm = Assembly.LoadFile(vgCoreDllPath);
return asm;
}
return args.RequestingAssembly;
};
InitializeComponent();
Unfortunately, this does not work in my case, since it does not come to the class constructor. Docker does not load if there is a link to the VGCore assembly in the reference. Only the late binding via dynamic helped me. Also a good way could be to use ComImport to import class descriptions and interfaces from the assembly without connecting it, but I did not succeed. The only late binding problem I've encountered is using structures and classes from the top level of the VGCore namespace. An Application object is passed to the constructor of the docker class, and I can't get objects from VGCore. For example, I use the CurveElement structure to create arrays of curve elements and to use them further in CreateCurveFromArray, and with late binding I don't have access to it. I also decompiled different versions of the Vcore assembly and found that some classes and interfaces have different GUIDs from version to version, while others do not change, which is very strange.
Sometimes CorelDRAW does not load UserControl, and the docker window is empty, only the name and icon. On my computer, where the development environment is located, everything works well, some users have this problem, not everyone. Maybe the problem is in XSLT. My project https://sourceforge.net/projects/litholo-docker/files/Lithology%20Docker%203.0.1.0.zip/download