An unhandled "system. runtime. interopservices. comexception" exception occurs in comlayout.exe. Other information: Search for the CLSID in the com class factory

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.