Solved

Who can my commtrol of ActiveX work?

Posted on 1998-12-22
4
490 Views
Last Modified: 2008-02-26
The following code run on computers which installed VC5.0, it works.
*************************************************
CCommCtrl   m_commctrl;
if (!m_commctrl.Create(NULL,0,CRect(0,0,0,0),this,ID_COMMCTRL))
      {
            AfxMessageBox("Failed to create OLE Communications Control");
            return -1;      // fail to create
      }
*****************************************
But on other computers which not installed VC, it failed. I did the register of activeX of Microsoft Comm Control 5.0 on all the computers. What is the solution? Thank you very much!
0
Comment
Question by:hua120298
  • 2
  • 2
4 Comments
 

Accepted Solution

by:
murrayc earned 20 total points
ID: 1180816
The control needs to be licensed. Use the other form of Create(), using a license string read with the Licreqst sample/utility. See Q151771 in the MS Knowledge Base, which should show you where to get Licreqst.

For instance:

WCHAR pwchLicenseKey[] =
{
0x0001,      0x0001,      0x0001,      0x0001,      0x0001,      0x0001,      
0x0001,      0x0001,      0x0001,      0x0001,      0x0001,      0x0001,      
0x0001,      0x0001,      0x0001,      0x0001,      0x0001,      0x0001,      
0x0001, 0
}; // I have changed it to all 0x0001, rather than publish it on the web, but I think it is the same on all PCs.

CString strLicense(pwchLicenseKey);
BSTR bstrLicense = strLicense.AllocSysString();

bTest = m_MSCommWrapper.Create(_T("MSComm"),WS_CHILD, CRect(0,0,10,10), this, IDC_MSCOMM, NULL, FALSE, bstrLicense);

Note that Visual Basic includes run-time licenses automatically when you put an MSCommCtrl on a form.
0
 

Author Comment

by:hua120298
ID: 1180817
Hi, murrayc,
I still donot know where the "Q151771 in the MS Knowledge Base" is. would you give me the web address?

Thanks.
0
 

Author Comment

by:hua120298
ID: 1180818
I tried the licence, but it still cannot work unless I change the licence string to NULL.

What is the reason?
0
 

Expert Comment

by:murrayc
ID: 1180819
Search for Q151771 at http://search.microsoft.com/default. Search in "Support & the Knowledge Base".

Maybe you already have Licreqst. If so, make sure that you add a terminating null if you use it in the above technique.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question