Using custom DLL with Citect 8.2

I am trying to use a custom DLL developed in VStudio 2022 in Citect 2018 R2 (8.2)
I have followed the document "Creating Custom .NET DLLs in Vijeo Citect 2015.pdf" and created the DLL with constructor, and property and methods etc.
I have the DLL built in C# and working properly with a Test App (also done in C#)
I have created an msi and installed the DLL and test App in the Citect pc.
However, I am having trouble using the DLL in Citect, both DLLOpen and also DllClassCreate not returning valid object handle.
I have also tried adding the DLL installed folder to Path but no success.

Is anyone there had success doing a similar thing? What are the rules for a DLL to be able to be used in Citect?

Parents
  • After spending lot of time googling around finally I have found the issue and fixed!

    In order to make the new dll class exposed, I needed to add the following directive:

    using System.Runtime.InteropServices;

    and then before the (public) class declaration, I had to add the below line: 

    [ComVisible(true)]

    Once those 2 things done, I am able to see the results on Citect with DllClassCreate, DllClassGetProperty, DllClassSetProperty,  DllClassCallMethod, DllClassDispose functions.

    DLLOpen function however is still giving error GetProcAddress, 

    I will test now with the extra's I removed, to see if they are also causing issues

Reply
  • After spending lot of time googling around finally I have found the issue and fixed!

    In order to make the new dll class exposed, I needed to add the following directive:

    using System.Runtime.InteropServices;

    and then before the (public) class declaration, I had to add the below line: 

    [ComVisible(true)]

    Once those 2 things done, I am able to see the results on Citect with DllClassCreate, DllClassGetProperty, DllClassSetProperty,  DllClassCallMethod, DllClassDispose functions.

    DLLOpen function however is still giving error GetProcAddress, 

    I will test now with the extra's I removed, to see if they are also causing issues

Children