Solved

Who can my commtrol of ActiveX work?

Posted on 1998-12-22
4
496 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

734 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