Question regarding ActiveX

  • Thread starter Thread starter Adrian Burka
  • Start date Start date
A

Adrian Burka

I have created an ActiveX control in .Net (named ActiveXDotNet.dll) that
uses a Windows Media Player ActiveX component (the project references
AxInterop.WMPLib.dll and wmppia.dll). This project, eventually, will be
using other DLL's as well.

When I embed this control in a regular Windows application, it works just
fine. When I try to embed the control in a web page like so:

<OBJECT
id="myControl1"
name="myControl1"
classid="ActiveXDotNet.dll#ActiveXDotNet.myControl"
width="640"
height="480"</OBJECT>

It doesn't work. If I remove the Windows Media Player component from the
control and recompile, the control loads in a web browser.

The web browser isn't picking up the references (or is refusing them?) to
the other DLL's. Does anyone know how I can get this to work in a web
browser, or have an example of something similar to this?

(And, if this is the wrong newsgroup, can someone point me to the correct
one so I can post there?)

Thanks in advance!

---
Adrian Burka
Pliner Solutions, Inc
Your Internet Technology Partner
http://www.pliner.com
(e-mail address removed)
Tel: 215-658-1601
Fax: 215-658-1602
 
I think this is a common problem with .net dll's: The .net runtime only
looks for .net assemblies in the main executable's directory. In your case,
this is IE's directoy.
I'm not sure if you can include a .config-file with a control; Maybe you can
use AppDomain.AppendPrivatePath to add your control's path. Or you could put
your interop dll in the GAC.

Niki
 
That depends. Are you embedding it into the page to be sent to the client
or are you calling it from within your .NET code?
 
Scott,

That's kind of my question... the ActiveX control I wrote is being embedded
in the web page:

That control references other DLL's. Should I be embedding those other DLL's
in the page, too? (And if so, how?) Otherwise, should I somehow be packaging
these things, or...?

I am confused.

-A

---
 
If you are embedding the object into the web page (as it seems you are),
then the client (browser) must accept the control because it will run on the
client.

Now, first of all ActiveX controls are not .NET objects, they are components
written in a COM interface and usually have file extensions of .ocx.

It seems as if you want a .NET assembly to be "pushed" down to the client.
For any .NET component to work on the client, the client will have to have
the .NET Framework installed on it.

In .NET, you don't do what it is you are attempting. Instead, you simply
make an .aspx page and from the code-behind of that page, you run whatever
server-side code you need to.

In short, you haven't created an ActiveX control in .NET, since .NET doesn't
make ActiveX controls.
 
Back
Top