VB Modularity 
Author Message
 VB Modularity

Hi there,

Does anyone know the best way of splitting VB progams up into modules,
without creating registered ActiveX components. The reason I ask is:

- I don't want all my modules to be registered, since this seems to add
unnecessary complication. For example, if I want to re-deploy a DLL then I
have to unregsiter original, re-register etc

- I've think I've seen a VB program that someone wrote, which asks the user
to specify which DLL to use depending on what language version you want to
load (French, English etc). All the user had to do was select the correct
DLL in a file browser, and then the program used this DLL for it's
language-specific functionlaity.

If this isn't clear, then please feel free to le tme know! Any help
appreciated, thanks.

Tobin



Tue, 26 Oct 2004 17:15:54 GMT  
 VB Modularity

Quote:
> Does anyone know the best way of splitting VB progams up into modules,
> without creating registered ActiveX components.

There is no practical way to do this without ActiveX components as long as
the various modules have to interact. DDE and/or Windows API messaging can
be used to a limited extent, but they're no where nearly as robust or
powerful as ActiveX.

Quote:
> - I don't want all my modules to be registered, since this seems to add
> unnecessary complication. For example, if I want to re-deploy a DLL then I
> have to unregsiter original, re-register etc

That's what a good distribution program is for.

Quote:
> - I've think I've seen a VB program that someone wrote, which asks the
user
> to specify which DLL to use depending on what language version you want to
> load (French, English etc). All the user had to do was select the correct
> DLL in a file browser, and then the program used this DLL for it's
> language-specific functionlaity.

I've done an app like this...but it used ActiveX components for the language
specific stuff. The program did the register/unregister of the language
components.

--
Frank Carr

http://www15.brinkster.com/vbnotebook



Wed, 27 Oct 2004 12:11:16 GMT  
 VB Modularity
Thanks for the resoponse.

I see, so the application registers/unregisters the ActiveX DLL
according to which one the user specifies. That makes sense. After that,
how do you handle project references? I take it that during development,
you wouldn't reference any language DLL in your VB project, since this
would create a dependency on that ActiveX. So, do you use CreateObject
or something? Also, do you still have use of intellisense?

Thanks for the help,

Tobin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Wed, 27 Oct 2004 16:43:33 GMT  
 VB Modularity

Quote:
> After that,
> how do you handle project references? I take it that during development,
> you wouldn't reference any language DLL in your VB project, since this
> would create a dependency on that ActiveX. So, do you use CreateObject
> or something? Also, do you still have use of intellisense?

The external interface of the language DLLs was the same and they used the
same project file that had binary compatibility set to a .CMP copy of the
DLL (I've got some info on my web site about how this is done). The French
and Spanish DLLs were made by replacing the language specific components in
the project and recompiling the  DLL (making sure not to over-write the
existing English one!). Since the external COM interface was the same, VB
didn't care that some of the underlying code was different. Intellisense
worked fine also.

Another approach that I've heard about is to create language specific
resources and load your strings from a resource file. I haven't tried this
myself, but you might find more info on this approach if you search the
Google newsgroup archives.

--
Frank Carr

http://www15.brinkster.com/vbnotebook



Wed, 27 Oct 2004 21:14:43 GMT  
 VB Modularity
Tobin,
        Sounds like you are trying to avoid the dreaded DLL Hell. If what you
are trying to do is avoid having to recompile all the components in he
application when you change one of the components try late binding.
Instead of adding the comonpents that you are going to use into your
references list, use Set myObject = createobject(Object.Name) to
create the instance of the objects you need. This does have the drawback
of having to read from the registry when you create the object, but by
referring to the component by name instead of by GUID you will save a
lot of time in development and be able to swap out single components
(DLLs).

        If you are looking to change languages by changing DLLs this will work
well also. Use a select case to create the object referring to the DLL
you want to use, then use the object as you normally would in your code.
Just remember to give your different language classes different classes
names.

Hope that helps,
Ronald Eddy
http://www.ronald-eddy.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Thu, 28 Oct 2004 09:11:41 GMT  
 VB Modularity
Check out the MSDN KB article Q188659 "HOWTO: Use a Satellite DLL for
Localization Purposes"

Sanjeev


Quote:
> Hi there,

> Does anyone know the best way of splitting VB progams up into modules,
> without creating registered ActiveX components. The reason I ask is:

> - I don't want all my modules to be registered, since this seems to add
> unnecessary complication. For example, if I want to re-deploy a DLL then I
> have to unregsiter original, re-register etc

> - I've think I've seen a VB program that someone wrote, which asks the
user
> to specify which DLL to use depending on what language version you want to
> load (French, English etc). All the user had to do was select the correct
> DLL in a file browser, and then the program used this DLL for it's
> language-specific functionlaity.

> If this isn't clear, then please feel free to le tme know! Any help
> appreciated, thanks.

> Tobin



Sun, 31 Oct 2004 18:43:30 GMT  
 VB Modularity
Thanks for the help there guys, very useful. The language issues was more of
an example, although something I will need.

I get the impression I'm gonna have to bone up on my COM and ActiveX
knowledge, so that I *really* know whats going on with Binary/Project
compatability etc.

I'm sure I remember reading somewhere that you can put classes within an
EXE, and somehow instruct VB to get the right entry point on the EXE to pull
out an instance of your class.

Tobin


Quote:
> Hi there,

> Does anyone know the best way of splitting VB progams up into modules,
> without creating registered ActiveX components. The reason I ask is:

> - I don't want all my modules to be registered, since this seems to add
> unnecessary complication. For example, if I want to re-deploy a DLL then I
> have to unregsiter original, re-register etc

> - I've think I've seen a VB program that someone wrote, which asks the
user
> to specify which DLL to use depending on what language version you want to
> load (French, English etc). All the user had to do was select the correct
> DLL in a file browser, and then the program used this DLL for it's
> language-specific functionlaity.

> If this isn't clear, then please feel free to le tme know! Any help
> appreciated, thanks.

> Tobin



Mon, 01 Nov 2004 06:26:14 GMT  
 VB Modularity
Matthew Curland describes a technique for using ActiveX Dlls that do not
need registration.  The idea is simple.  Each ActiveX DLL has a normal
function DLLGetClassObject which returns a factory object needed to create
instances of classes defined inside the DLL.
But it is not because the idea is simple that the implementation is.
Luckily for us, Matthew did the hard work already.  (www.powervb.com)

--
Van den Driessche Willy
For a work in progress :
http://users.skynet.be/wvdd2/index.html

Quote:
> Thanks for the help there guys, very useful. The language issues was more
of
> an example, although something I will need.

> I get the impression I'm gonna have to bone up on my COM and ActiveX
> knowledge, so that I *really* know whats going on with Binary/Project
> compatability etc.

> I'm sure I remember reading somewhere that you can put classes within an
> EXE, and somehow instruct VB to get the right entry point on the EXE to
pull
> out an instance of your class.

> Tobin



> > Hi there,

> > Does anyone know the best way of splitting VB progams up into modules,
> > without creating registered ActiveX components. The reason I ask is:

> > - I don't want all my modules to be registered, since this seems to add
> > unnecessary complication. For example, if I want to re-deploy a DLL then
I
> > have to unregsiter original, re-register etc

> > - I've think I've seen a VB program that someone wrote, which asks the
> user
> > to specify which DLL to use depending on what language version you want
to
> > load (French, English etc). All the user had to do was select the
correct
> > DLL in a file browser, and then the program used this DLL for it's
> > language-specific functionlaity.

> > If this isn't clear, then please feel free to le tme know! Any help
> > appreciated, thanks.

> > Tobin



Tue, 02 Nov 2004 04:45:50 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. MDI modularity

2. Detecting Mouse Click in Non-VB or VB app (in VB 6)

3. vb MSCOMM Control works in VB 5 and not VB 6

4. Debugging VB Usercontrols in VB without 2nd VB Test project

5. optimizing performance and data transfer vb->excel and vb->vb

6. optimizing performance and data transfer vb->excel and vb->vb

7. convert vb 3.1 to vb 6.0

8. ? Convert Macro to VB using VB

9. How can I convert this Excel VB code to Access VB

10. vb/access ?'s, newbie to vb from c++

11. VB 6.0 and VB 6.3 for applications incompatibility

12. Call another VB program(exe) in VB

 

 
Powered by phpBB® Forum Software