Re: Visual Basic for Autorun?

From: Michael Culley (mculley_at_NOSPAMoptushome.com.au)
Date: 06/08/04


Date: Tue, 8 Jun 2004 16:11:44 +1000


"J French" <erewhon@nowhere.com> wrote in message news:40c542bc.78643818@news.btclick.com...
> Why more professional ?

Take as an example a grid I wrote for one project. Time was set aside to write it and it was tested on its own and once it reached a
certain state it was compiled and used in the main app. It reached a point where it was sealed and delivered. Changes still happen
ocassionally but it is much more controlled. Now several apps use the same grid and it is impossible for developers to make sly mods
to suit their application. If changes are required they can't be specific to one app. The alternative would be to copy the code from
project to project and not really be sure of the changes made to each. Obviously this doesn't apply to all usercontrols and should
only be used where appropriate, but even when usercontrols are very specific to a project I create a seperate ocx project that will
only be used by the one exe.

Here's a few other reasons:
If a programmer passes in an invalid parameter to my dll/ocx then I can raise an error and it breaks on their line of code, not
mine.

If their app closes due to an error the control still shuts down correctly. This basically means class_terminate fires so resources
can be tidied up.

Extender properties (top, left etc) are not always available if the control is in the exe.

Version tracking is easier, eg I can tell that my grid was updated on a certain date and that the last 3 versions of my app used the
one version of the grid.

IDE runs quicker which is vital for larger projects. The one I'm working on now has 300 forms and is slow enough as it is. I have 2
projects loaded into the IDE usually, I can't imagine how slow it would be if the code from its 11 projects was all loaded at once.

Friend functions. This on it's own is enough of an arguement :-)

Class scope. You can define a class as private or public not createable. The second means it can only be created from within your
dll, so you can specify a function has to be called to create an instance of your class. This is a bit like contructors in more of
an oop language. Marking a class as private makes it possible for me to use it to support a public class/control without it being
visible to the outside world.

Usercontrols don't get those diagonal stripes on them when you modify the project.

Functions can be marked as hidden.

> I most certainly know /how/ to work with them, I simply do not like
> working with them.

OK, that wasn't really a fair statement of mine. On occasions ActiveX dll/ocxs can cause problems but they are usually fairly easy
to get around. Maybe you didn't persist with them enough to get around the problems.

> Where I need DLLs for complex things used by many different EXEs then
> I use Delphi.

Personally I would think this is not a very good solution. I presume you need to use declare statements and have to know the names
of the functions. With activeX you just add a reference and can see all the functions. Intellisense works and you can raise errors
in the dll to be caught in the exe. Also, everything is in the one language. Generally I only use a second language if there is a
really good reason and that's usually C because the main language couldn't do what C can.

> But that is not very important nowadays.

I agree, that's why we stopped doing it.

> So far I have only heard of one compelling reason for converting
> UserControls into OCXes
> - which was to prevent junior programmers tampering with the code

Not just the junior programmers :-) At least with the juniors you can tell them off, the seniors have a tendancy to tell you to piss
off :-)

> I am intrigued why you think it 'professional' to turn UserControls
> into OCXes - personally I consider it slightly dangerous.

I've done it fairly extensively and it works quite well as long as you keep good control over it. I just like they way that the
control is encapsulated into a neat little project with good control over how developers can use it.

--
Michael Culley


Relevant Pages

  • Re: Visual Basic for Autorun?
    ... If changes are required they can't be specific to one app. ... Obviously this doesn't apply to all usercontrols and should ... everything is in the one language. ... >I've done it fairly extensively and it works quite well as long as you keep good control over it. ...
    (microsoft.public.vb.general.discussion)
  • Trying to add control in vc++ 8.0
    ... Trying to use a grid control ... I am trying to add the flexgrid to a mdi based app. ... instantiate the grid in the view class. ...
    (microsoft.public.vc.mfc)
  • WM5 app..
    ... I'm trying to decide the best way to present thumbail images to the ... I would like to have a grid.. ... I'm a little confused as where to start with regards of what control to ... Every app i've done so far has just been using the standard controls, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Opinion wanted
    ... the details including the nature of my own app (which you mischaraterized ... correct the current control (provided that control is invalid but invalid ... causes you to validate controls that have already been ... largely discreditted for good reason and has very little use these days. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: How to fire an event
    ... I have an Infragistic datagrid control, ... The button click event is being raised upon a post-back to the server. ... manipulating the grid in script would cause a server event to be raised. ... The problem here is that I have no idea whether the grid will raise the ...
    (microsoft.public.dotnet.languages.csharp)

Loading