Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Who can my commtrol of ActiveX work?

Posted on 1998-12-22
4
Medium Priority
?
508 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Accepted Solution

by:
murrayc earned 80 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

715 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