Menu

COM Interface using C++ code. How load OpenDSSEngine.DSS?

Help
2024-08-09
2024-08-09
  • Ricardo Henriques

    Hi.

    I'm trying to load the OpenDSSEngine.dll lib through the COM interface. Despite having read the tips on the forum about it, I couldn't load the lib. It seems that there is a header called "OpenDSSengine_TLB.h" that contains the IDSS type but I couldn't find it. The code snippet I made to load the library is below. Could someone help me please? Thanks in advance.

    //cpp code

        HRESULT result = CoInitialize(NULL);
    
        CLSID clsid;
        IDispatch *DSSObj; // What type/interface to DSSObj??? IDSS type (forum) is in "OpenDSSengine_TLB.h" file???
        //IID riid;        // Who is IID_IDSS???
        HRESULT hr1 = CLSIDFromProgID(L"OpenDSSEngine.DSS", &clsid);
        HRESULT hr2 = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IDispatch, (void**)&DSSObj);
    
     
    • Davis Montenegro

       
      • Ricardo Henriques

        Hi Davis. Thanks for the quick response.

        I checked the discussion you mentioned in addition to this one:

        https://sourceforge.net/p/electricdss/discussion/beginners/thread/70274502/

        It seems that a header "OpenDSSengine_TLB.h" is needed. This header defines the IDSS interface. But I couldn't find this header file. Or maybe there is another way to load OpenDSSEngine. DSS with a c++ code.

        Best regards.

         

Log in to post a comment.