Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / May 2004

Tip: Looking for answers? Try searching our database.

windows form control +Active X in IE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
msnews.microsoft.com - 03 May 2004 19:30 GMT
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
hugo batista - 03 May 2004 20:13 GMT
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.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
  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, String
licenses)

> Hi
>
[quoted text clipped - 10 lines]
> 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
Mark Travis - 05 May 2004 09:43 GMT
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

> Other help
> If i activate IEHost log, i get the following log file:
[quoted text clipped - 26 lines]
> 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.HandleReturnMessage(IMessage
> reqMsg, IMessage retMsg)
>    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
[quoted text clipped - 20 lines]
> > 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
hugo batista - 19 May 2004 18:36 GMT
it worked. thanks!

> 1. The active x control may need to be installed and registered on the
> client.
[quoted text clipped - 46 lines]
> > 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)
> >
[quoted text clipped - 3 lines]
> > reqMsg, IMessage retMsg)
> >    at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
> > msgData, Int32 type)
> >    at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String
[quoted text clipped - 19 lines]
> > > 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.