Thursday, March 22, 2012

windows form control +Active X in IE

Other help
If i activate IEHost log, i get the following log file:

URL: http://localhost/testEmbed/controls/userControlLib.dll
Zone: 2
Assembly Name:userControlLib.dll
Type Name:userControlLib.UserControl1

-- Thrown Exception --

System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --> System.Security.SecurityException: Request
failed.
at userControlLib.UserControl1.InitializeComponent()
at userControlLib.UserControl1..ctor()
-- End of inner exception stack trace --

Server stack trace:
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
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.Runtime.Remoting.Messaging.StackBuilderSink .PrivateProcessMessage(Met
hodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessa
ge msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type)
at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String
typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32 dwFlag,
Int32 dwZone, String pURL, String uniqueIdString, String link, String
licenses)

"msnews.microsoft.com" <hugo.batista@dotnet.itags.org.aranhix_com_nospam> wrote in message
news:eh3MGzTMEHA.1392@dotnet.itags.org.TK2MSFTNGP09.phx.gbl...
> Hi
> Sorry to crosspost, but i'm not knowing what should be the correct
newsgroup
> for this...
> I have a web application which i want to show a windows forms user control
> in my web form. (lets call this control userControl1)
> I have no problem to do this, but when i use a COM / ActiveX control in
> userControl1, and try to show it in IE, it fails, without any error. Any
> clue ?
> I'm showing userControl1 like this:
> <OBJECT id="rtfcontrol"
classid="http://localhost/testEmbed/controls/userControlLib.dll#userControlL
> ib.UserControl1"
> VIEWASTEXT>
> </OBJECT>
> Thanks in advance
> hugo1. The active x control may need to be installed and registered on the
client.
2. The .NET control will not work unless it has the privilege to do so. The
steps are as follows.
a. Add the site the control is coming from to you Trusted Zones in IE (.
b. Go into the .NEt Framework Configuration snapin (usually found in
Administrative Tools in the Control Panel)
c. Navigate the tree to the following location
My Computer/Runtime Security Policy/Machine/Code
Groups/All_Code/Trusted_Zone
d. Right mouse click 'Trusted_Zone' and go to Properties
e. On the 'Permission Set' tab, choose the permission set that gives the
control the permissions it requires

I hope this helps

Mark Travis

"hugo batista" <hugo.batista@.aranhix_com_nospam> wrote in message
news:efuztKUMEHA.3596@.tk2msftngp13.phx.gbl...
> Other help
> If i activate IEHost log, i get the following log file:
> URL: http://localhost/testEmbed/controls/userControlLib.dll
> Zone: 2
> Assembly Name: userControlLib.dll
> Type Name: userControlLib.UserControl1
>
> -- Thrown Exception --
>
> System.Reflection.TargetInvocationException: Exception has been thrown by
> the target of an invocation. --> System.Security.SecurityException:
Request
> failed.
> at userControlLib.UserControl1.InitializeComponent()
> at userControlLib.UserControl1..ctor()
> -- End of inner exception stack trace --
> Server stack trace:
> at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
> at System.Activator.CreateInstance(Type type, Boolean nonPublic)
> at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
Binder
> binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
> at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
> Binder binder, Object[] args, CultureInfo culture, Object[]
> activationAttributes)
> 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.Runtime.Remoting.Messaging.StackBuilderSink .PrivateProcessMessage(Met
> hodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean
> fExecuteInContext, Object[]& outArgs)
> at
System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessa
> ge msg, Int32 methodPtr, Boolean fExecuteInContext)
> Exception rethrown at [0]:
> at
System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
> reqMsg, IMessage retMsg)
> at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
> msgData, Int32 type)
> at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String
> typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
> at Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32 dwFlag,
> Int32 dwZone, String pURL, String uniqueIdString, String link, String
> licenses)
>
> "msnews.microsoft.com" <hugo.batista@.aranhix_com_nospam> wrote in message
> news:eh3MGzTMEHA.1392@.TK2MSFTNGP09.phx.gbl...
> > Hi
> > Sorry to crosspost, but i'm not knowing what should be the correct
> newsgroup
> > for this...
> > I have a web application which i want to show a windows forms user
control
> > in my web form. (lets call this control userControl1)
> > I have no problem to do this, but when i use a COM / ActiveX control in
> > userControl1, and try to show it in IE, it fails, without any error. Any
> > clue ?
> > I'm showing userControl1 like this:
> > <OBJECT id="rtfcontrol"
classid="http://localhost/testEmbed/controls/userControlLib.dll#userControlL
> > ib.UserControl1"
> > VIEWASTEXT>
> > </OBJECT>
> > Thanks in advance
> > hugo
it worked. thanks!

"Mark Travis" <mtravis@.sysdel.skmconsulting.com> wrote in message
news:%23IqGC0nMEHA.2644@.TK2MSFTNGP11.phx.gbl...
> 1. The active x control may need to be installed and registered on the
> client.
> 2. The .NET control will not work unless it has the privilege to do so.
The
> steps are as follows.
> a. Add the site the control is coming from to you Trusted Zones in IE
(.
> b. Go into the .NEt Framework Configuration snapin (usually found in
> Administrative Tools in the Control Panel)
> c. Navigate the tree to the following location
> My Computer/Runtime Security Policy/Machine/Code
> Groups/All_Code/Trusted_Zone
> d. Right mouse click 'Trusted_Zone' and go to Properties
> e. On the 'Permission Set' tab, choose the permission set that gives
the
> control the permissions it requires
> I hope this helps
> Mark Travis
> "hugo batista" <hugo.batista@.aranhix_com_nospam> wrote in message
> news:efuztKUMEHA.3596@.tk2msftngp13.phx.gbl...
> > Other help
> > If i activate IEHost log, i get the following log file:
> > URL: http://localhost/testEmbed/controls/userControlLib.dll
> > Zone: 2
> > Assembly Name: userControlLib.dll
> > Type Name: userControlLib.UserControl1
> > -- Thrown Exception --
> > System.Reflection.TargetInvocationException: Exception has been thrown
by
> > the target of an invocation. --> System.Security.SecurityException:
> Request
> > failed.
> > at userControlLib.UserControl1.InitializeComponent()
> > at userControlLib.UserControl1..ctor()
> > -- End of inner exception stack trace --
> > Server stack trace:
> > at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
> > at System.Activator.CreateInstance(Type type, Boolean nonPublic)
> > at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
> Binder
> > binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
> > at System.Activator.CreateInstance(Type type, BindingFlags
bindingAttr,
> > Binder binder, Object[] args, CultureInfo culture, Object[]
> > activationAttributes)
> > 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.Runtime.Remoting.Messaging.StackBuilderSink .PrivateProcessMessage(Met
> > hodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean
> > fExecuteInContext, Object[]& outArgs)
> > at
System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessa
> > ge msg, Int32 methodPtr, Boolean fExecuteInContext)
> > Exception rethrown at [0]:
> > at
> System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
> > reqMsg, IMessage retMsg)
> > at
System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
> > msgData, Int32 type)
> > at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String
> > typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
> > at Microsoft.IE.SecureFactory.CreateInstanceWithSecur ity(Int32
dwFlag,
> > Int32 dwZone, String pURL, String uniqueIdString, String link, String
> > licenses)
> > "msnews.microsoft.com" <hugo.batista@.aranhix_com_nospam> wrote in
message
> > news:eh3MGzTMEHA.1392@.TK2MSFTNGP09.phx.gbl...
> > > Hi
> > > > Sorry to crosspost, but i'm not knowing what should be the correct
> > newsgroup
> > > for this...
> > > > I have a web application which i want to show a windows forms user
> control
> > > in my web form. (lets call this control userControl1)
> > > > I have no problem to do this, but when i use a COM / ActiveX control
in
> > > userControl1, and try to show it in IE, it fails, without any error.
Any
> > > clue ?
> > > > I'm showing userControl1 like this:
> > > <OBJECT id="rtfcontrol"
> classid="http://localhost/testEmbed/controls/userControlLib.dll#userControlL
> > > ib.UserControl1"
> > > VIEWASTEXT>
> > > </OBJECT>
> > > > Thanks in advance
> > > hugo
> >

0 comments:

Post a Comment