Comment: VB's lack of objects 
Author Message
 Comment: VB's lack of objects

There are two things with VB that have always irritated me. Actually, they
are the same thing: A lack of plain and simple objects. VB (at least 3.0)
is based on the philosophy that "Code is UI". You can not code in VB unless
you code with a UI in mind.

Rubbish.

The best tool a programmer has is reusable code, and VB does a poor job of
encouraging reusable code. Why? Let me give you an example:

You want to create a generic picture resize routine, with a combined
transparent background copy and some goodies. In VB 3.0, that's all
possible using the API, only there is one problem: You can only make use of
such actions if you're using a picture control. You can pass an hDC to a
generic routine to make it perform actions on it, and in doing that keeping
the routine generic, but you can't store the image in memory, perform other
actions on it, and in the end place it in a picture control. It has to be
in the picture control all along.

Another example: You want to create a program, with no UI, that does some
DDE somewhere. Tough luck - VB only supports DDE through stupid text
control, labels or forms. The best implementation I've seen is Excel VBA,
with its DDE* methods. Much better, cleaner and useful than VB's stupid
text control DDE. So why did MS do it that way? 'Cause coding in VB has to
be towards a UI.

That last issue is what bothers me more. Why aren't we allowed to do DDE
without having some stupid form loaded? I've been planning to change that,
but I've met one problem: I believe DDE requires callback functions or
message handling. What a pity VB doesn't support callback functions or
message handling. A DLL will be better, but still, pure VB code would be
best.

Will someone write me a DDE DLL?

What does this all boil down too? I hope VB 5.0 has some support for
callback functions and message handling. And I hope it has more objects (I
could list: DDE object, File object, and Memory object). But most of all, I
hope it will be for 16 bit development as well.

--
VB Info: http://www.*-*-*.com/ ~balchen/vb/visual.htm
FAQ: http://www.*-*-*.com/ ~balchen/vb/faq.htm
Knowledge Base: http://www.*-*-*.com/ ~balchen/vb/kb.htm



Sat, 06 Feb 1999 03:00:00 GMT  
 Comment: VB's lack of objects



<<  Stuff Deleted >>

Quote:

> The best tool a programmer has is reusable code, and VB does a poor job of
> encouraging reusable code. Why? Let me give you an example:

Well the VB4 class module is a start for code reusability however limited to
the extreme.  I hope that V5 removes many of the limitations of Global declaration
currently in the class module: Fixed length Strings, User Defined Data Types, etc.
I also hope it provides some method of sub-classing (I know dream on..).

<<  More Stuff Deleted >>

Quote:
> Another example: You want to create a program, with no UI, that does some
> DDE somewhere. Tough luck - VB only supports DDE through stupid text
> control, labels or forms. The best implementation I've seen is Excel VBA,
> with its DDE* methods. Much better, cleaner and useful than VB's stupid
> text control DDE. So why did MS do it that way? 'Cause coding in VB has to
> be towards a UI.

> That last issue is what bothers me more. Why aren't we allowed to do DDE
> without having some stupid form loaded? I've been planning to change that,
> but I've met one problem: I believe DDE requires callback functions or
> message handling. What a pity VB doesn't support callback functions or
> message handling. A DLL will be better, but still, pure VB code would be
> best.

This one really annoys me as I do a lot of DDE work with Excel.  I have to expect
that it really slows down the performance of the app having to go through the
entire GDI layer (probably twice..) but I have no proof as there is no other way
to do it.

Quote:

> Will someone write me a DDE DLL?

If someone responds please post!!  Any possibility of doing this with MSGBLASTER
in straight VB code??

Quote:

> What does this all boil down too? I hope VB 5.0 has some support for
> callback functions and message handling. And I hope it has more objects (I
> could list: DDE object, File object, and Memory object). But most of all, I
> hope it will be for 16 bit development as well.

I would not hold my breath on the DDE object as OLE rules in VB4 and beyond
and I understand that OLE is built on DDE and provides the same functionality
(with just a minor bit of performance degradation ;) .. ).  Also from what I have
read forget the 16 bit support, it just won't be there in VB5.  I also have not
heard of Borland enhancing the 16 bit version of Delphi either.  Is this a
{*filter*} to kill the 16bit environment (not that I would cry a lot over it..)

D.M. (Mike) Mattix
Monsanto Company
Luling Plant
Luling, LA



Sat, 06 Feb 1999 03:00:00 GMT  
 Comment: VB's lack of objects


Quote:
> > Will someone write me a DDE DLL?
> If someone responds please post!!  Any possibility of doing this with MSGBLASTER
> in straight VB code??

Sure there is, but a VBX requires a form. And I don't want to use a form.

--
VB Info: http://home.sn.no/~balchen/vb/visual.htm
FAQ: http://home.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://home.sn.no/~balchen/vb/kb.htm



Sat, 06 Feb 1999 03:00:00 GMT  
 Comment: VB's lack of objects

Quote:

> You want to create a generic picture resize routine, with a combined
> transparent background copy and some goodies. In VB 3.0, that's all
> possible using the API, only there is one problem: You can only make use of
> such actions if you're using a picture control. You can pass an hDC to a
> generic routine to make it perform actions on it, and in doing that keeping
> the routine generic, but you can't store the image in memory, perform other
> actions on it, and in the end place it in a picture control. It has to be
> in the picture control all along.
> Jens,

While I agree with most of your message, I don't believe the section above is
strictly true.  As a reference, see the transparent bitmap routine in the July 1995
issue of VBPJ, page 123...no Picture controls needed.

-Steve



Mon, 08 Feb 1999 03:00:00 GMT  
 Comment: VB's lack of objects


Quote:
> While I agree with most of your message, I don't believe the section above is
> strictly true.  As a reference, see the transparent bitmap routine in the July 1995
> issue of VBPJ, page 123...no Picture controls needed.

Probably correct, but can you do a Line or a PSet on something else
than a picture control?

--
VB Info: http://home.sn.no/~balchen/vb/visual.htm
FAQ: http://home.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://home.sn.no/~balchen/vb/kb.htm



Fri, 12 Feb 1999 03:00:00 GMT  
 Comment: VB's lack of objects



Quote:
> Probably correct, but can you do a Line or a PSet on something else
> than a picture control?

Jens,

I believe by subclassing and hooking messages in the message que you could
accomplish this. I also believe I have a reference for you.  I will
research this and post/e-mail you.

Regards,

The Doktor



Sat, 13 Feb 1999 03:00:00 GMT  
 Comment: VB's lack of objects


Quote:
> > Probably correct, but can you do a Line or a PSet on something else
> > than a picture control?

> I believe by subclassing and hooking messages in the message que you could
> accomplish this. I also believe I have a reference for you.  I will
> research this and post/e-mail you.

That's fine, but I was referring to VB's lack of a strong picture object...

--
VB Info: http://home.sn.no/~balchen/vb/visual.htm
FAQ: http://home.sn.no/~balchen/vb/faq.htm
Knowledge Base: http://home.sn.no/~balchen/vb/kb.htm



Sat, 13 Feb 1999 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Help -- Trying to get around VB's lack of graphics capabilities

2. 'Next Comment' doesn't work

3. Global objects using VB, MTS - looking for comments

4. Lack of support for explicit interface implementation in VB.Net

5. Open letter to Microsoft Re:VB lack of documentation

6. Lack of mathematical functions in VB

7. API calls to check memory lack (and usage) to use in VB

8. VB and 'namespace' objects

9. Comments besides Commented Text

10. Comment on QB websites/view websites by comments .-=??=-.

11. Comments = StrConv(Comments, vbProperCase)

12. Commenting - How to comment blocks of text

 

 
Powered by phpBB® Forum Software