Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Packaging/registering DLL

Status
Not open for further replies.

MrSethT

Programmer
Jun 11, 2007
4
US
Hey,

I have spent several days trying to find out how to do something, and i don't know if I am blind or what, but I can not find it. I am developing a web app and I need it to run an activex control. I have developed the control and it runs great on my development system (VS2005, C#, IE6, Win2000Pro, output is a DLL) because as far as I can tell, the IDE registers the DLL. The problem is packaging it so it registers itself on any other computer. I have tried publishing the DLL by itself, packaging it in a CAB by itself, packaging it in in a CAB with a INF file. So far, the closest it has come to registering and installing is getting the dll to show up in "Downloaded Program Files" and the CLSID shows up in the registry under "code store database\distribution units". Every time I load the page it adds new entries in the registry and adds a CONFLICT.# folder to the "Downloaded Program Files" but still will not load the control. What is wrong? or how do you register a dll through IE?

It is not a security issue; I have allowed it install unsigned controls. I am at the end of my rope having spent more than a week on this that should have been done in about a day. I can send you any of this stuff to take a look at if that will help. Any help you give will be greatly appreciated, anything.

Thanks again,
-Seth
 
You need to use the OBJECT tag. Here's a code example from msdn, using the common dialog control:

Code:
<OBJECT ID="CommonDialog1" WIDTH=32 HEIGHT=32
    CLASSID="CLSID:F9043C85-F6F2-101A-A3C9-08002B2F49FB"
    CODEBASE="[URL unfurl="true"]http://activex.microsoft.com/controls/vb5/comdlg32.cab[/URL]
    #Version=1,0,0,0">
</OBJECT>

So, here's what happens.  When IE encounters the object tag, it first attempts to load the object by looking in the local registry for the classid in the CLSID parameter.  If it doesn't find it, it downloads from the location given in the CODEBASE parameter.

One more thing.  If you want to be able to update old versions of your control on client machines, then you'll need to make sure that you update the #Version auxiliary parameter of the codebase parameter.  IE will check this parameter against the version registered on the local machine, and only download if the #Version value is higher than the one on the local machine.  So, for example, if you have #Version=1,0,0,0 in your object tag, you'll never download any updates unless you manually unregister your component in the client machine.

HTH

Bob
 
this is the object tag I have been using

<object id="ctlDisplay1" classid="CLSID:AB226553-9C20-3DEF-A52B-D264BB802855" codebase="ActiveX.cab#version=1,0,0,0"
style="width: 879px; height: 525px" type="application/x-oleobject">
<param name="ParamMonitorName" value="608" />
<param name="ParamIgnoreMinutes" value="60" />
<param name="ParamUpdateFreq" value="5" />
<param name="ParamSWRequestInterval" value="60" />
<param name="ParamDBAlarmTime" value="7" />
<b>ActiveX Controls are not supported under the current settings.</b>
</object>

and it already works great on systems where the dll has been registered. your example has a ocx file, vb.net is only creating a dll for me and then I put that into a cab file, but it is still not registering properly. I need to know the steps in packaging the dll or how to do it with out "packaging" the dll.

Thanks again,
-Seth
 
I'm sorry, I got the understanding that you had created a separate ActiveX control. If it isn't an ocx file, it isn't really an ActiveX control. .Net has its own way of handling everything. I know this is confusing, but dlls in .Net have nothing to do with COM dlls, or dlls in the traditional sense.

If you want your .Net DLL to be registered on the client machine and run from there, then you have to have the .Net CLR installed on that machine as far as I know. I wouldn't take that approach personally, unless I were sure that the CLR was native to the opsys in use on the client machine.

I would investigate other approaches that are more typical in the .Net world. To do this, I would repost to the asp.net forum. (Note that this forum is a forum for COM-based ActiveX, and .Net is not COM-based.)

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top