Home > Back-end >  C registered desert plug-in
C registered desert plug-in

Time:10-02

Using the namespace Dm;
Clsids clsids;//COM object identifiers
Void InitTLDm ()
{
If (CLSIDFromProgID (OLESTR (" dm. Dmsoft "), & amp; Clsids)!=S_OK)
{
WinExec (" C: \ \ Users \ \ Administrator \ \ source \ \ repos \ \ QtConsoleApplication2 \ \ Debug \ \ registered desert plug-in to the system. Bat ", SW_HIDE);//run a registered plug-in command
}
If (SUCCEEDED (CoInitialize (NULL)))
{

Retrieves the hr=CLSIDFromProgID (OLESTR (" dm. Dmsoft "), & amp; Clsids);

Retrieves the Hr=CoCreateInstance (clsids, NULL, CLSCTX_INPROC_SERVER,
__uuidof ( Idmsoft ), (LPVOID *) & amp; Dm);
If (SUCCEEDED (Hr))
{
CoFreeUnusedLibraries ();//uninstall without COM service
}
}
The else
{
AfxMessageBox (" initialize the COM component failure!" );
}
Dm - & gt; Release ();
}

Idmsoft parameter is the desert dm. LL defined within the class object I loaded the dm in my project. H
In dm. H the statement
The namespace Dm {
The class DM_EXPORT Idmsoft : public QAxObject
{
Public:
Explicit Idmsoft (IDispatch * subobject=nullptr, QAxObject * parent=nullptr);
/*
But when I fill in to the CoCreateInstance fourth parameter has been an error
How to modify for guidance
  • Related