473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to pass a runtime license key to CreateControl()

Hi

I have a problem with passing a runtime license key for an ActiveX
control to the method CreateControl() of the class
pywin.mfc.activex.Control.

Can anybody give me a hint in which form the license key string must be
passed to this method?

I got the license key for the ActiveX control using the "License Key
Requester" from Microsoft and I used the string given as comment above
the WCHAR array (since I don't know how to convert the WCHAR array for
Python).

But when creating the control with this string, the control is created
in "evaluation mode" and not, as expected, as a licensed control.

I looked up the code for the CreateControl() method and found out, that
it passes the license key string directly to the CreateControl() of the
PyCWnd class (the Python wrapper for the CWnd class of MFC). Than I
looked at the Python extension, where the PyCWnd::CreateControl() is
implemented, and found, that the macro T2OLE is used to convert the
given Python string for the license key to an OLE string, before
passing it to the original MFC method.

ok = pWnd->CreateControl(clsid, szWndName, style, rect, pWndParent, id,
NULL, bStorage, T2OLE(szLicKey));

I'm not sure, but when I understand this right, the MFC method
CreateControl() wants a BSTR here and I read somewhere that T2OLE does
not return a BSTR. Can this be the problem here?

Has anybody ever used the license key string parameter of the
CreateControl() method in Python and can tell my how to pass the
license key string correctly?

Thanks in advance.

Wolfgang Schneider

Jul 18 '05 #1
0 1145

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: wschneider | last post by:
Hi I have a problem with passing a runtime license key for an ActiveX control to the method CreateControl() of the class pywin.mfc.activex.Control. Can anybody give me a hint in which form...
1
by: Mark Ramey | last post by:
I have an assembly that I want to license to developers. I don't want to license the runtimes that they deliver to their customers. There are no real design-time controls, only some classes that...
1
by: Casper | last post by:
I am issuing the following commands in a form's detail on click event. Private Sub Detail_Click() Dim Nline As Line Set Nline = New Line I get :"ActiveX component can't create object" ...
6
by: Stu | last post by:
with the following code snippet Dim ConOra As OracleConnection = New OracleConnection() ConOra.ConnectionString = "User Id=USER;Password=PASSWORD;Data Source=orcl9i;" Dim Sql As String =...
0
by: Nonee | last post by:
Hello- I have a form with the mediaplayer referenced to play mp3's and avi's and I believe that is what is causing the problem. I am not sure, but I am hoping. Anyway, I "published" the vb.net...
9
by: Tim | last post by:
Hi, I hope this is an easy question for you guys... I have an application that I need to be able to switch from sqlserver to access at runtime. I can change from one sqlserver installation to...
0
by: JBoeker | last post by:
I'm new to C# and I want to programmatically put some ActiveX controls on my form. I've already put some via the forms editor successfully. Currently the control does not show on the form and I...
9
by: Paul H | last post by:
As I understand it, to distribute a runtime version of Access 2003 with my app I need to spend £600 on "Visual Studio Tools for Office System package" which contains the RT plus a load of stuff I...
2
by: sriregu | last post by:
Hi, i am trying the exe file in .net environment and am getting the following error.Any idea how i can resolve it? System.Runtime.InteropServices.COMException (0x80040154): Class not registered ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.