C ++ in vs2005CodeWhen calling the COM component (the DLL file has been added through "Project-> reference"), the following error occurs:
An unhandled "system. runtime. interopservices. comexception" exception occurs in comlayout.exe.
Other information: failed to retrieve components whose CLSID is {0ec8ccc8-ebed-495e-9a9f-313da4ec0dfa} in the com class factory because of the following error: 80040154. "
The Code is as follows:
# Include <iostream> <br/> # include <stdlib. h> <br/> # include "typeinfo. H "<br/> # include" stdio. H "<br/> using namespace vqqspeeddllib; // com to be called </P> <p> using namespace STD; </P> <p> int main (INT argc, _ tchar * argv []) <br/>{< br/> vqqspeeddllib: vqqdownloadclass VDC; <br/> // vqqspeeddllib: ivqqdownload ^ IVD = gcnew vqqspeeddllib :: vqqdownload (); <br/> // int Param = 1; <br/> // int * P; <br/> // P = running m; <br/> // IVD-> Init (p); </P> <p> return 0; <br/>}
Solution:
In vs2005 Solution Explorer, right-click the project and choose reference> Configuration Properties> C/C ++. In general, click Add "E: /workspaces/C ++/cominterface "(this is the directory of the DLL file to be called). Click OK.