I am in the process of writing a dll that is an object oriented type wrapper for the Win32 API.
As part of this I need to write a class wrapper for just about every structure used in the API, for example NMHDR, CBT_CREATEWND, ICONINFO etc. etc.
However, before I commit even more of my time to this - is there a maximum number of classes in an ActiveX dll or in the VB5 IDE? I'd hate to get this 50% done and then be scuppered.
Thanks in advance,
D.
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Cakkie
May 15th, 2001, 07:57 AM
Visual Basic 5 is limited to aprox 32000 identifiers. These are
forms, controls, modules, variables, constants, procedures, functions, and objects. I hope this will do the jobs for you ;)
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Styler
May 15th, 2001, 08:04 AM
yeah yeah i thinks their is
255 classes, 255 bas modules, 255 forms
and i don't think vb6 is any different
by the way i have a question on how or why u are going to do this?
handling such things as multiply instance, references, cross threads references, secruity model, even in C++ i can imagine this taking me about a year to do, god knows how you are going to do it vb. Is the Win32 API really that hard to use?
hopes this helps
Cakkie
May 15th, 2001, 08:26 AM
Let me guess...you haven't worked with VB a lot. First thing to do is to consult the help files. In VB5 books online, there's an article called 'Visual Basic Specifications, limitations, and File Formats'. There select 'Project limitations'. Not convinced? Create an addin, let it add 300 classes to you project. I can assure you one thing, the limit will more likely be the lack of memory than the number of files. (I got an out of memory error when I reached 945 classes)
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Styler
May 15th, 2001, 08:52 AM
yeah yeah i guess your right on that one...looks like mickysoft softed that one out in version 5/6........i'm still abit confused as why someone would write a wrapper for the win32 api? please prove me wronge again......
Cakkie
May 15th, 2001, 09:05 AM
Well, (i'm not doing this because I want to proove you wrong ;) i can imagine someone doing this. The more you program, the more you will need them, and when you have a wrapper for them, life can be very easy. Let's take the bitblt function, this copies some bits (read as picture) to another one performing some operation (commonly used in games). To like say merge two pictures, you would have to create 3 device context, 3 bitmaps (not the file, but in memory), load the files into the memory, do whatever operations needs to be done and clean up the mess you left behind. If you write this once, and do it all in 1 call in stead of around 20, wouldn't earth be a better place (ignore that last one).
Besides, one reason good enough would be code reuse.
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Clearcode
May 15th, 2001, 09:54 AM
I currently have 40 classes, and I envisage the eventual total being about 300 so it doesn't look like I have a problem.
The reason I want to write a class wrapper is that I would like to write something like
private Declare Function LoadIconApi Lib "user32" Alias "LoadIconA" (byval hInstance as Long, byval lpIconName as Long) as Long
private Declare Function DrawIconApi Lib "user32" Alias "DrawIcon" (byval hdc as Long, byval x as Long, byval y as Long, byval hIcon as Long) as Long
private Declare Function GetDCApi Lib "user32" Alias "GetDC" (byval hwnd as Long) as Long
etc. etc.
The idea is to let the less technically experienced developer have access to the powerful functionality of the Windows API without having to know which parameter of which windows message did what, and so on.
Give it a look if you want - the latest incarnation is at http://www.merrioncomputing.com/Download/index.htm called EventVB.dll
Thanks,
D.
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
dfwade
May 15th, 2001, 01:25 PM
I applaud the effort that you are going through, by the time that you finish this little project VB Net will be out and you will find the MS has already completed this task for you in the Visual Net base system classes.
Obviously your market for these API wrappers would be developers, since users don't care. Obviously MS felt the same need and that is why it is incorporated into VB Net. You might want to look at the .Net framework baseclass documentation. I was stunned by what was included.
Just so you know I have wrappers for about 50 or 60 API calls myself and keep them in a library that I use for every project. I looked through the framework documentation and determined I could get rid of all but 2.
Please don't take my comments as negative, they are not intended that way. I am just as frustrated by the lack of an API class library in VB 5 and 6. I just wish i did not have to wait until VB Net to use MS's.
Clearcode
May 16th, 2001, 04:42 AM
I have the public Beta of .Net and this has added impetus to my project. Seeing how powerful the .NET wrappers for the API are and how easy it is to use the operating system with them only increases the frustration at not being able to use them in VB5/6.
Of course the API is, by its nature, extensible so my project will never have a definite end. What there currently is (in the EventVB.dll downloadable from my site) is probably what will be used 90% of the time...
Thanks for your response,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Cakkie
May 16th, 2001, 05:25 AM
I hate to barge in on this, but .NET aint there yet. Sure, there's a beta, and next month beta2 should be released. There's only 1 question I pose myself concerning VB.NET: where's the VB. By the time VB6 has disappeared, we'll be living on Mars, telling my houserobot to get me a drink, and control the computer by mind in stead of mouse/keyboard. Ok, this meight not be exactly true, but you get the point.
And for the API's concern, the're all in the base class, so the only thing we don't need to do is to declare them, WE still need to use them, and we will still be writing ourself wrappers to combine several API calls.
If we are writing ourself a API wrapper in VB5/6, or .NET, what's the difference? (besides the fact that the .NET IDE takes ages to load and still has some mayor bugs in it, but hey, what would you expect from a beta)
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.