943,923 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 756
  • C++ RSS
Nov 7th, 2008
0

How can I register COM Compnent in VC++

Expand Post »
Hi,

I working on COM Components in VC++.NET 2005,


C++ Syntax (Toggle Plain Text)
  1. HRESULT hr = spCrypt.CoCreateInstance(__uuidof(Cryptographer::TMMPlayerHelper), 0);
  2. if( FAILED(hr) )
  3. spCrypt = 0;

I am facing an error here.

I debug the code and found that "CoCreateInstance()" is returning a message

"Class is not registered"

an my program gets crash.

How can I resolve this problem? Please reply me soon.

--
Regards,
Asif
Reputation Points: 10
Solved Threads: 0
Light Poster
asifjavaid is offline Offline
40 posts
since Oct 2006
Nov 7th, 2008
0

Re: How can I register COM Compnent in VC++

Whose class is Cryptographer ? Is it registered ?
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Nov 7th, 2008
0

Re: How can I register COM Compnent in VC++

Whose class is Cryptographer ? Is it registered ?

Hi,

Cryptographer is a namespace. and it has different structs and classes. TMMPlayerHelper is declared as struct in this namespace.

I did not perform any registration step because i did not know how to register it?


--
Regards,
Asif
Reputation Points: 10
Solved Threads: 0
Light Poster
asifjavaid is offline Offline
40 posts
since Oct 2006
Nov 7th, 2008
0

Re: How can I register COM Compnent in VC++

COM only works with ActiveX components or Windows Services programs, all of which must be registered before they can be used. Here is how to register them. If that registration fails then its not written as a COM component and therefore can not be used the way your attempting to use it.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Nov 10th, 2008
0

Re: How can I register COM Compnent in VC++

COM only works with ActiveX components or Windows Services programs, all of which must be registered before they can be used. Here is how to register them. If that registration fails then its not written as a COM component and therefore can not be used the way your attempting to use it.

Thanks a lot.
Ancient Dragon. you have solved my problem. I have register the required dll and now its working perfectly.

--
Regards,
Asif
Reputation Points: 10
Solved Threads: 0
Light Poster
asifjavaid is offline Offline
40 posts
since Oct 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: socket programming file transfer
Next Thread in C++ Forum Timeline: Algorithm in C++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC