Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Equivalent of C "size of" in VB6?

Author
Message
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 28th Apr 2004 16:22
I'd as in a vb forum, but they aren't too active over there. Anyway, I'm trying to make a window entirely through Windows API calls in VB6 (Yeah, I'm stupid ), but I'm a VB newbie, and I need to use "size of" to fill in the WNDCLASSEX struct. Anyone know the VB equivalent?

Oh, and I know that API calls are kinda advanced stuff for a vb noob, but it's just a freak experiment I plan to cook up before going to bed. Haha, wala lang.


ROFLMAOOL!
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 28th Apr 2004 16:28
Can't answer the question, but trying to use the Windows API like this in VB is just making life difficult for yourself. Not only do you have to copy all the various constant declarations from the WinAPI tool, but you have to convert the datatypes over as well.

BlueGUI:Windows UI Plugin - All the power of the windows interface in your DBPro games. - Plus URL download, win dialogs.
Over 140 new commands
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 28th Apr 2004 16:39
Yeah I know. I'm just bored and decided to play with VB. I kinda got over excited when I learned in a different forum that the API can be accessed just as if using C++. The API text viewer is kinda nifty though. Maybe I'll use it next time for simpler stuff. Thanks for holding my tail and keeping me from jumping off a cliff though.


ROFLMAOOL!
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 28th Apr 2004 16:50
Len()


"Computers are useless they can only give you answers."
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 28th Apr 2004 17:08
Cool, I never knew it worked on types. Stupid book only mentioned strings.

BTW, any idea on how to fill in WNDCLASSEX.lpfnWndProc in VB?


ROFLMAOOL!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 28th Apr 2004 17:57
maybe this will help

http://www.mangovision.com/vbapi/ref/w/wndclassex.html


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 29th Apr 2004 06:59
Thanks for the link CattleRustler. But I also found

http://www.mentalis.org/


ROFLMAOOL!
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 29th Apr 2004 16:52
Quote: "Cool, I never knew it worked on types. Stupid book only mentioned strings."


I think that is a design fault in Visual BASIC. I think that there should be a seperate sizeof() operator as comparing a string length is not the same as finding the byte-size of an integer for example. len("DBPro") would return 5 for example, whilst I would expect sizeof("DBPro") to return the size of VB's internal string type. Its different to other languages and confusing as you have just found out.

BlueGUI:Windows UI Plugin - All the power of the windows interface in your DBPro games. - Plus URL download, win dialogs.
Over 140 new commands
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 29th Apr 2004 17:17
Quote: " think that is a design fault in Visual BASIC. I think that there should be a seperate sizeof() operator as comparing a string length is not the same as finding the byte-size of an integer for example."


That's what you use lenb() for. It returns the length in bytes of an expression. I believe this is the command you are looking for. Len("DBPro") returns 5, of course, while Lenb("DBPro") returns 10. I never knew this command existed until a few months ago while looking at some example source code in a VB book I have.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 29th Apr 2004 17:50
yeah there is a whole slew of these "+b" commands in VB6


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!

Login to post a reply

Server time is: 2024-09-21 20:48:51
Your offset time is: 2024-09-21 20:48:51