By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,526 Members | 1,618 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,526 IT Pros & Developers. It's quick & easy.

How to pass a runtime license key to CreateControl()

P: n/a

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

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

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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.