|
-
Aug 17th, 2000, 07:11 PM
#1
What is the longest variable name you ever used?
And what's the largest amount of APIs you ever used in a project?
My largest API count is about 20.
I used strSubjectOfNewUserMessage as a var.
-
Aug 17th, 2000, 07:21 PM
#2
I try to keep my variables short and descriptive, however believe I went as far as 15-20 in some Apps.
Regarding API's, I've developed Apps using pure API but I can't really remember how much. I will try to find the project and get back to you soon.
-
Aug 17th, 2000, 08:08 PM
#3
Guru
I don't count the number of characters in my variables 
Largest name of API function ever used: GetWindowThreadProcessID
Largest API count: Who knows. Too much to count!
(Was a hell of a program, too! Moral: Use API excessively, quickly and rapidly)
Must have been about 300 declares, about 20 types and many many constants.
-
Aug 17th, 2000, 08:13 PM
#4
Lively Member
Long time no see Yonaton!!
-
Aug 17th, 2000, 08:30 PM
#5
I have used about 60 API declares in one program.
and I had about 30 constants,
and about 5 types...
it was on my HDD before I reformatted, it was used to manipulate windows and stuff....
Yonaton, what kind of program did you make that had that many declares and stuff
-
Aug 18th, 2000, 12:13 AM
#6
Guru
It was something that had an RTF box and two ListViews.
All three were created by pure API (CreateWindowEx).
Also, all the menus were API-created and owner drawn.
No OCX controls were included.
Nuff said?
-
Aug 18th, 2000, 12:35 AM
#7
not really 
I know that takes alot of code, but 300 declares? for 3 controls??
BTW if you could send me the project, or any documentation you have on creating controls from scratch, I would appreciate that...
because I am learning C++ and if you dont want to use MFC you kinda have to use API...
thanks!
Dennis
-
Aug 18th, 2000, 01:41 AM
#8
Guru
No, you can't have the source, I lost the source code in a recent nuclear war. 
Actually I don't have the source code anymore for a different reason: I sold it and its copyrights for Microsoft for $2 million. Umm, actually it didn't have any copyrights, but I did sell it to Microsoft for $2 million. Well, I didn't sell it per se, but they really begged me to sell it to them for $2 million. Hmm, they didn't really want to give me money, but they really begged me for the program. Come to think of it, they didn't beg in actuality, they just asked for it several times. Oh, now I that remember more clearly, they sent only one E-Mail. Well, basically, they didn't send it, but they put it in their "Send Later" list and forgot. Actually, they didn't write it, but they put my E-Mail in their address book and decided to think about it. Well, perhaps you wouldn't count it, because it was not a computerized address book, it was a "real" address book with pages and all. Umm, actually it wasn't even an address book, it was just a note on Bill Gates' desk. Actually it wasn't on Bill Gates' desk per se, it was on one of his assistants' desk. Hmm, the assistant didn't intend to E-Mail me in actuality, he just had my address because he is my mother's second-cousin's husband. 
OK actually you can't have the code because I don't have it anymore. It was because my friend was doing a project, so he sent me and asked me to help him make the ListViews, RTF box and menus API-created and also to make the menus owner-drawn. I sent him the tweaked version (tweaked from 30-40 APIs straight to about 300) and then I didn't need it anymore so I just sort of deleted it. 
If you've never done that sort of thing and actually want to, look out. It's highly explosive (crashes) while the code-building is in progress. (Ever tried subclassing a form and clicking the End button on the IDE? Not fun.)
P.S.
Yes, my mom's second-cousin's husband's boss is Bill Gates.
Wow, I'm special, NOT! 
That sounds like something from the movie Spaceballs, doesn't it?
-
Aug 18th, 2000, 02:00 AM
#9
Actually I don't have the source code anymore for a different reason: I sold it and its copyrights for Microsoft for $2 million. Umm, actually it didn't have any copyrights, but I did sell it to Microsoft for $2 million. Well, I didn't sell it per se, but they really begged me to sell it to them for $2 million. Hmm, they didn't really want to give me money, but they really begged me for the program. Come to think of it, they didn't beg in actuality, they just asked for it several times. Oh, now I that remember more clearly, they sent only one E-Mail. Well, basically, they didn't send it, but they put it in their "Send Later" list and forgot. Actually, they didn't write it, but they put my E-Mail in their address book and decided to think about it. Well, perhaps you wouldn't count it, because it was not a computerized address book, it was a "real" address book with pages and all. Umm, actually it wasn't even an address book, it was just a note on Bill Gates' desk. Actually it wasn't on Bill Gates' desk per se, it was on one of his assistants' desk. Hmm, the assistant didn't intend to E-Mail me in actuality, he just had my address because he is my mother's second-cousin's husband.
LOL
beleive me I know about crashes when you are subclassing,
I still suck at it, but when I was just starting out, it took me about 3 crashes before I figured out I had to hit the X in the top right corner of the form.... 

-
Aug 18th, 2000, 02:11 AM
#10
transcendental analytic
I have all declares in the whole Win32API.txt+some others i have in a project, and the only thing it does is nothing, but i guess that's how far you can get with api's
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 18th, 2000, 08:31 AM
#11
Dennis, you can create windows from scratch using CreateWindowEx
Code:
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle _
As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle _
As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight _
As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const WS_CHILD = &H40000000
Private Sub Form_Load()
retval = CreateWindowEx(0&, "Button", "Button1", WS_CHILD, 32, 32, 64, 64, Me.hwnd, 0, App.hInstance, ByVal 0&)
ShowWindow retval, 1
End Sub
-
Aug 18th, 2000, 08:43 AM
#12
Fanatic Member
I've used 34 API Declares, 10 API Types and 39 API Consts in my project which creates its own (Tahoma) toolbar, which (like MS apps) an edge is drawn aroung the caption when the mouse goes over it, and if it is clicked, it shows an owner-drawn menu. It's my most advanced project to date. (Just to tell you how bad I am )
I love owner-drawing 'stuff'. It makes you feel in control.
Members of VB-World: Not this crap again?
-
Aug 18th, 2000, 08:44 AM
#13
For some reason the class of VB buttons is not "Button".
-
Aug 18th, 2000, 08:55 AM
#14
Button is the standard Windows (C++) ClassName for a Button. In VB, the classname is ThunderCommandbutton.
-
Aug 18th, 2000, 10:51 AM
#15
I am no expert at this, but wouldnt you have to subclass so you could add a click event etc to it?
-
Aug 18th, 2000, 11:08 AM
#16
Yes, here's an example. Put he following in a Module
Code:
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong& Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long)
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Const GWL_WNDPROC = (-4)
Const WM_COMMAND = &H111
Public RETVAL As Long
Global WndProcOld As Long
Public Function WindProc(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If wMsg = WM_COMMAND Then
If lParam = RETVAL Then
MsgBox ("You clicked the Button")
End If
End If
WindProc = CallWindowProc(WndProcOld&, hwnd&, wMsg&, wParam&, lParam&)
End Function
Sub SubClassWnd(hwnd As Long)
WndProcOld& = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf WindProc)
End Sub
Sub UnSubclassWnd(hwnd As Long)
SetWindowLong hwnd, GWL_WNDPROC, WndProcOld&
WndProcOld& = 0
End Sub
Put this in a Form
Code:
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle _
As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle _
As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight _
As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const WS_CHILD = &H40000000
Private Sub Form_Load()
RETVAL = CreateWindowEx(0&, "Button", "Button1", WS_CHILD, 32, 32, 64, 64, Me.hwnd, 0, App.hInstance, ByVal 0&)
ShowWindow RETVAL, 1
SubClassWnd Me.hwnd
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnSubclassWnd Me.hwnd
End Sub
-
Aug 18th, 2000, 11:37 AM
#17
New Member
variable
I've not actually programmed this one myself, but I have run acrossa source using a varaible called:
L_nobntrazndrknkrdbepbkn
-
Aug 18th, 2000, 01:04 PM
#18
Hehehehe...
Code:
Const THAT_NUMBER_THAT_GETS_USED_ALL_THE_TIME_IN_MATHEMATICS_AND_PHYSICS_BUT_I_CANT_REMEMBER_ITS_NAME = 3.1415927
-
Aug 18th, 2000, 01:18 PM
#19
I cant tell if your kidding or not, but its called Pi
-
Aug 18th, 2000, 02:12 PM
#20
Frenzied Member
-
Aug 18th, 2000, 02:19 PM
#21
Guru
Sam Finch: Your code doesn't work.
I got a compiler error, "Identifier too long." (What a surprise!)
-
Aug 18th, 2000, 02:34 PM
#22
I was pretty sure it was a joke..... I just didnt know
Code:
Const SAMANTHA_FINCH_SHOULD_NOT_HAVE_USED_HER_SHIFT_KEY_TO_MAKE_A_VARIABLE_NAME_THAT_IS_OBVIOUSLY_ALL_CAPS_SHE_SHOULD_HAVE_USED_CAPS_LOCK_BUT_THATS_OK_BECAUSE_SHE_IS_PROBABLY_TOO_DRUNK_TOO_UNDERSTAND_ME_ANYWAY = "HEHEHEHEHE"
-
Aug 18th, 2000, 02:49 PM
#23
Monday Morning Lunatic
This must be officially the widest thread ever!
BTW: I don't use Declares.....I use a Type Library.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 18th, 2000, 02:58 PM
#24
Frenzied Member
denniswrenn
Code:
Const IM_NOT_EVEN_GOING_TO_DIGNIFY_THAT_WITH_A_PARTICULARALY_LONG_CONSTANT As String = "Because If I used caps lock I would have had to press the shift key for every _ rather than just hold it down"
parksie
I think there's been wider ones from people who comment extensivley on the same line as a long bit of code. If you reply and scroll along there are 2 verticle blue bars that show the page is too wide, I've seen 3, maybe even 4.
-
Aug 18th, 2000, 03:11 PM
#25
Monday Morning Lunatic
FOUR?!?!?!?!?!?!
Who writes that much code on ONE LINE?????
(okay, so I do...but that's not the point )
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 18th, 2000, 03:17 PM
#26
Lively Member
Too much
okay guys, this is really getting lame now .
-
Aug 18th, 2000, 03:36 PM
#27
Code:
Const = JUST_WEDGE_SOMETHING_BETWEEN_THE_CONTROL_KEY_AND_THE_SHIFT_KEY_THEN_YOU_DONT_HAVE_TO_HOLD_ANY_THING_AT_ALL_AND_YOU_DONT_HAVE_TO_KEEP_PRESSING_THE_SHIFT_KEY_HAHAHAHAHAHA = "I have also seen 3,4, maybe even 5 backgrounds long when people write code"
-
Aug 18th, 2000, 03:37 PM
#28
perhaps this should have gone in the chit-chat forum?
-
Aug 18th, 2000, 03:55 PM
#29
Lively Member
huh
And you guys expect to get guru like this?????? ya right!
[Edited by Zej on 08-18-2000 at 04:59 PM]
-
Aug 18th, 2000, 05:29 PM
#30
Wow!
This thread is waaaay out of context
-
Aug 18th, 2000, 08:29 PM
#31
transcendental analytic
Code:
Text1 = "Const = " & UCase(replace(Text1, " ", "_")) & " = " & Val(text2)
ah, were's the submit reply button now?!?!
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 18th, 2000, 09:15 PM
#32
Member
Was Never Funny And Still Not:
CONST WE_HAVE_THE_MATURITY_OF_FOUR_YEAR_OLDS_AND_YET_WE_THINK_WE_ARE_ALL_THAT_BECAUSE_WE_HAVE_LEARNED_TO_U SE_THE_SHIFT_KEY_SO_THAT_WE_CAN_IMPRESS_OUR_FELLOW_VB_PROGRAMMING_COMRADES_ON_A_BILLBOARD_BUT_WHY_DO _WE_HAVE_THE_MATURITY_OF_FOUR_YEAR_OLDS_AND_YET_WE_THINK_WE_ARE_ALL_THAT_BECAUSE_WE_HAVE_LEARNED_TO_ USE_THE_SHIFT_KEY_SO_THAT_WE_CAN_IMPRESS_OUR_FELLOW_VB_PROGRAMMING_COMRADES_ON_A_BILLBOARD_BUT_WHY_D O_WE_HAVE_THE_MATURITY_OF_FOUR_YEAR_OLDS_AND_YET_WE_THINK_WE_ARE_ALL_THAT_BECAUSE_WE_HAVE_LEARNED_TO _USE_THE_SHIFT_KEY_SO_THAT_WE_CAN_IMPRESS_OUR_FELLOW_VB_PROGRAMMING_COMRADES_ON_A_BILLBOARD_BUT_WHY_ DO_WE_HAVE_THE_MATURITY_OF_FOUR_YEAR_OLDS_AND_YET_WE_THINK_WE_ARE_ALL_THAT_BECAUSE_WE_HAVE_LEARNED_T O_USE_THE_SHIFT_KEY_SO_THAT_WE_CAN_IMPRESS_OUR_FELLOW_VB_PROGRAMMING_COMRADES_ON_A_BILLBOARD_HEHEHE_ I_THINK_I_WILL_WHEN_NOW = "We are retards!"
PS should have used capslock and just pasted (CRTL + V) for the underscores _
Visual Basic 6 Professional Edition
Captain Pinko
also:
Turbo Pascal, Turing, QBasic
-
Aug 18th, 2000, 10:12 PM
#33
you are right, we all have the maturity of 4 year olds, and we are proud of it... well I am 
damnit Where is the submit button?
it took me a while to find the text area box too.. hehe
-
Aug 19th, 2000, 05:47 AM
#34
Monday Morning Lunatic
This is OUTTA CONTROL !!
Now...who's going to take it to 5 backgrounds long...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 19th, 2000, 07:29 AM
#35
Captain Pinky, it was funny the first time I did it, and when sam did it, because it poked fun at denniswrenn for being very naive, "Pi" indeed, who in their right mind would call a number "Pi"! I dont think so.
-
Aug 19th, 2000, 08:26 AM
#36
Frenzied Member
3.14159 is in fact called pi.
It's because pi was discovered by the greeks, who found out the significance of this number and needed a name for it, this was thousands of years ago and world records hadn't yet achieved the high standards they have now, and by great coincedence the world pie eating record was exactly 3.14159.
Pies were named after the greek letter P because they were vary diaretic at the time(which is why the world record was so low) the e was removed when performance enhancing drugs were made illegal in world records.
-
Aug 19th, 2000, 08:32 AM
#37
Monday Morning Lunatic
Hehe

Maybe Sam should'nt be Guru after all...how about "Humour Guru"? ...it's definitely unique...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 19th, 2000, 10:54 AM
#38
What's unique is that the sum of the IQs of all of us equals Pi.
-
Aug 19th, 2000, 11:18 AM
#39
Addicted Member
Code:
Dim strThisIsTheLargestVariableThatIHaveEverDeclared As String
-
Aug 19th, 2000, 12:08 PM
#40
Fanatic Member
Code:
Const Repressed_site_of_the_year_award As String = "http://www.vbworld.com"
Const Lamest_Jokes_Ever_Award As String = "http://www.vbworld.com"
Const Have_You_all_Lost_Your_Diginty As Boolean = True
Const When_Was_The_Last_Time_You_Went_Out As Date = 5/9/78
Private Sub Life_Start (Cesarian As Boolean)
Dim Looks As Ineger, Intelligence As Integer, Personality As Integer, Health As Integer
Dim Points As Integer
Points = 100
Randomize Timer
Looks = Points - Int(Rnd * 100)
Points = Looks
Intelligence = Points + Int(Rnd * 20)
Points = Intelligence
Personality = Points + Int(Rnd * 100) - 50
Points = Personality
Health = Points - Int(Rnd * 100)
End Sub
Sub Life_Terminate(Cause As vbDeathConstants, Haunt As vbHauntType)
If Cause = StabbedInBackByBestFriend Then
Haunt.Start = True
Haunt.Person = BestFriend
Haunt.Variety = Poltergeist
End If
End Sub
Oh no! I've turned into one of you 
Members of VB-World: Whose to say we didn't turn into you?
Anybody know the name of a good emotional-psychological-counciller? (I need help bad)
Where the hell is the submit reply butto... Oh, there
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|