How to ensure method in ActiveX class gets into DLL (Checking by ITypeLib)

91 Views Asked by At

In Visual Studio 2013, how do we ensure that the methods added in the ActiveX is accessible in Javascript and can be viewed in OlleView's ITypeLib

I have this method that would not show in the ITypeLib in OlleView but there methods are showing:

public:
    STDMETHOD(SendToREST)(BSTR resource, BSTR operation, BSTR data); // not showing
    STDMETHOD(WriteBuf)(/*[in]*/ BSTR a); // showing

I've been doing regsvr32 registration of the DLL but still the method is not showing up.

  • What can I use to trace why method is not showing up?
  • Is it because the method is not really in the DLL or some registry is not updated?
  • Should I manually add it to the Project's IDL file? (because I cannot see it there)
1

There are 1 best solutions below

2
On BEST ANSWER

You need to add the methods in question to interface in the IDL. Then those interfaces should be either in library block there, or referenced by anything from library block. This is necessary for these IDL definitions to get compiled into type library. Then make sure the type library is registered.

C++ code will reference the derivative of the IDL and your classes will override the abstract virtual methods defined in IDL interfaces. This is how C++ code is connected with type library definitions.