PDA

Click to See Complete Forum and Search --> : ActiveX control... possibly a stupid question


NJCam
Apr 15th, 2003, 05:38 PM
Hi all,

I'm going to be working on an application soon that will require using a control. My question is pretty basic, is it better to compile the control separately and add it to the project as a component, or just put the CTL file along with all of the others and compile one EXE?

What are the advantages and disadvantages of using one method over the other?

Thanks,
- Sam

crptcblade
Apr 16th, 2003, 06:33 AM
Well, the key advantage to making the control into its own OCX, is that you can use it in other applications as well. Sure you could just add the .ctl into the other app, but you risk altering the control to suit the individual program, and end up with two or more varying code bases.

The advantage to compiling the .ctl directly into the app is that you don't need to worry about binary compatibility. This means that you can change method signatures at will, and not hindering the operation of the application (provided the app will compile, of course ;)).

So really you must consider whether or not you want to be able to reuse the control across several different applications or not. If its for a specific purpose in a single exe, then you are probably better off just including it in the app. This will also save you an extra distributable.