Re: Visual Basic for Autorun?

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


Date: Wed, 9 Jun 2004 11:13:07 +1000


"J French" <erewhon@nowhere.com> wrote in message news:40c56fdb.90196350@news.btclick.com...
> Realistically the point is preventing other coders mucking things up
> - it is a valid point
> - but there is nothing to stop them mucking up the OCX
> - assuming they can get into version control

Knowledge of the concequences is what stops them. If they know the change will affect 5 apps they won't do it or will be much more
careful.

> I generally make another (local) copy of a UserControl and work on
> that while enhancing a 'library' UC
>
> It only goes into the 'library area' when I am sure of it

This is ok but it requires a bit of effort to keep everything in sync between the apps.

> True - I tend to prefer a simple MsgBox

Raising an error is the standard method used in visual basic. I wouldn't like to have an in-house combo box and have code that
should raise an error show a messagebox.

> - that goes back to writing library code well before Windows

It has long been superseeded.

> You mean at run time

Runtime or design time for the main project. If your usercontrol is running complied it will always fire the terminate event. If you
load it into the IDE it won't.

> Circumstances ?

Dim X as MyUserControl
Set X = Me.MyUserControl1
X.Left = 100 '<---- error

The only properties available in this case are the ones added yourself. This makes you very restricted in passing instance of a
control arround.

> It would not necessarily be the code from 11 projects

If you don't use ocxs or dll then all of the code has to be loaded all of the time. I guess this is not the case if you use Delphi
for your dlls.

> Yes, you need the declare statements, often I wrap them in a
> mini-Class - you get the Intellisense Ok
> True one has to have the Declares, but with AX you need the Type Libs

That's a fair bit of hassle, especially if you have a big dll.

> Personally I like Delphi as a second language, it is a bit like VB on
> steroids.

I haven't used it enough to know but you are probably right there :-) If I knew both I'd probably just use Delphi.

> When writing Delphi DLLs I know that I am going into 'Tiger Country'
> - and am extra careful, as I am aware that any stupidity on my part
> will be hard to trace from the main App

Any stupidity on my parts results in a nice little call stack with line numbers being sent back to me from the user. Because almost
everything was written in VB it all works uniformly and I can track down the exact line of code that caused the error. This does not
apply to the C stuff which puts me in the same boat as your delphi dlls.

> How do you stop them just checking out the OCX's source
> - years ago in another environment we came up with a solution
> - each library module had an 'owner' (author) and a 'co-owner'
> - so only two people were permitted to make mods
> (everyone could see and play with the code, but if they altered the
> library version then they were dead)

They just know. I've never told anyone that they have to talk to me before modifying any of my libraries but they do. It varies
depending on the library, some are free for everyone to modify while others are not.

> Even with things that may become 'generics' I'm developing them in
> conjunction with the App, so having them as part of the Project is
> very convenient.

You can move libraries in and out of the IDE just by simply adding and removing them, you get the best of both worlds. You can do it
on the fly with vb.

> One can quickly add properties and functionality and tracing is much
> easier.

You get all of this if you add the project to the project group.

> Heck - I'm sure MS could have done a better job
> - the Registry is such a fragile construct

It can be a pain at times and we have lost some time with problems before (I remember spending most of a day trying to fix a real
mess) but I think it was worth it. The biggest thing we learnt was to never compile a library to a users local machine, always use a
shared copy.

--
Michael Culley


Relevant Pages

  • Re: Nasty Problem
    ... There is no dll main as it is not needed. ... The apps generally do not run at the same time. ... I have removed all MessageBox calls in my other app but it still ... what libraries would MessageBox require (implicitly ...
    (microsoft.public.dotnet.languages.vc)
  • Re: /MT and /MD
    ... for Multi Threaded Apps) and MSVCRT (MS Visual C++ Run Time DLL). ... To link libs with debug info just add another 'd' at the end of the option: ... Any other libraries are your ...
    (microsoft.public.vc.language)
  • Re: Nasty Problem
    ... There is no dll main as it is not needed. ... The apps generally do not run at the same time. ... I have removed all MessageBox calls in my other app but it still crash ... what libraries would MessageBox require (implicitly ...
    (microsoft.public.dotnet.languages.vc)
  • Re: /MT and /MD
    ... and MSVCRT (MS Visual C++ Run Time DLL). ... between apps - makes your apps smaller!)... ... To link libs with debug info just add another 'd' at the end of the ... Any other libraries are your ...
    (microsoft.public.vc.language)
  • Re: How to get imagebase after a DLL gets loaded
    ... The main difference between DLL and static library in this context is ... so that it is not meant to be integrated with the client code ... SPEAKING ABOUT STATIC LIBRARIES HERE, AND I *EXPLICITLY* SAID IT THIS ...
    (microsoft.public.win32.programmer.kernel)