DonJames

Hi,

I am trying to get a managed C++ Windows Form to come up in IE.

This works fine when I build a C# Windows Form Control Library (with the regular htm syntax ID=dll name.namespace.class etc)

However when I try the same experiment with Managed C++ it does not show up in IE.

i.e. If I create a DLL that is a managed C++ Windows Control Form Library and put it in the Virtual directory and then reference it in my web page it does not show up. The exact same thing works with C#.

I thought maybe it's because the IE would need the CRT. I made sure the client machine has the CRT and its path variable is set accordingly. But that does not work either.

Finally, I wanted to get your opinion on whether this is a wise thing to try. There are not many artciles about managed C++ windows forms in IE (actually none that I could find). Ideally I would like to put the CRT dll's in my virtual directory and then expect them to be deployed together with the winform dll. But is this really possible

Someone mentioned this might not be possible as the manifest that contains the location for the CRT is not downloaded.

Anyway to summarize:

1. Is it possible to get a managed C++ WinForm to show up in IE If so any ideas on any potential gottchas All I have is a basic button in my win form, and that is not working...

2. Is it possible to automatically deploy the CRT for IE (e.g. by placing them in the virtual directory etc)

Thanks in advance

Don



Re: Internet Explorer Web Development Managed C++ Windows Form not showing up in IE

DonJames

I turned on IE Debugging and it indicates a secuirty/permission issue for the Managed C++/WinForm (see below).

The assemby has the following:

....

[assembly:AssemblyVersionAttribute("1.0.*")];

[assembly:ComVisible(false)];

[assembly:CLSCompliantAttribute(true)];

[assemblyTongue TiedecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

Is there something else that needs to be set for the security

Microsoft.IE.SecureFactory: Trying to create instance of type http://localhost:1144/WebSite1/ManagedCPPControlLib.dll#ManagedCPPControlLib.ManagedCPPControlLibControl

Microsoft.IE.SecureFactory: System.IO.FileLoadException: Could not load file or assembly 'ManagedCPPControlLib, Version=1.0.2706.23966, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)

File name: 'ManagedCPPControlLib, Version=1.0.2706.23966, Culture=neutral, PublicKeyToken=null' ---> System.Security.Policy.PolicyException: Required permissions cannot be acquired.

at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)

at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)

at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)

at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)

at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)

at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)

at System.Activator.CreateComInstanceFrom(String assemblyName, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)

at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)

at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)

at Microsoft.IE.SecureFactory.CreateInstanceWithSecurity(Int32 dwFlag, Int32 dwZone, String pURL, String uniqueIdString, String link,