views:

233

answers:

1

I need to host and run managed controls inside of a purely unmanaged C++ app. How to do this?

To run unlicensed controls is typically simple:

if (SUCCEEDED(ClrCreateManagedInstance(type, iid, &obj)))
{
    // do something with obj
}

When using a licensed control however, we need to somehow embed a .licx file into the project (ref application licensing). In an unmanaged C++ app, the requisite glue does not seem to work. The lc.exe tool is supposed to be able to embed the license as an assembly resource but either we were not waving the correct invocation, or it failed silently. Any help would be appreciated.

+1  A: 

The answer depends on the particular component you're using. Contact your component help desk OR read up the documentation on what it takes to deploy their component.
Basically component developers are free to implement licensing as they deem fit. With the .licx file the component needs to be able to do whatever the developer wished via GetKey and IsValidKey (explained in the link you posted). So if GetKey checks for a .licx file in the component directory - you just need to make sure its there.
AFAIK the client assembly doesn't need to do anything except instantiate the control.

Also if you post the name of the component and the lc.exe command you're using, people could take a look..

Gishu