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.
Printable View
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.
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.
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.
Long time no see Yonaton!!
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
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? :D
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
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. :rolleyes:
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. :o
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! :D
That sounds like something from the movie Spaceballs, doesn't it? ;)
LOLQuote:
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.
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.... :o
:)
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
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
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: :rolleyes: Not this crap again?
For some reason the class of VB buttons is not "Button".
Button is the standard Windows (C++) ClassName for a Button. In VB, the classname is ThunderCommandbutton.
I am no expert at this, but wouldnt you have to subclass so you could add a click event etc to it?
Yes, here's an example. Put he following in a Module
Put this in a FormCode: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
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
I've not actually programmed this one myself, but I have run acrossa source using a varaible called:
L_nobntrazndrknkrdbepbkn
Hehehehe...
Code:Const THAT_NUMBER_THAT_GETS_USED_ALL_THE_TIME_IN_MATHEMATICS_AND_PHYSICS_BUT_I_CANT_REMEMBER_ITS_NAME = 3.1415927
I cant tell if your kidding or not, but its called Pi
Code:Const THE_PERSON_WHO_SEES_SOMEONE_POST_A_JOKE_WHICH_WAS_REALLY_FUNNY_BY_THE_WAY_YOU_CAN_TELL_BECAUSE_IM_COPYING_IT_SLIGHTLY_AND_MAKING_MY_OWN_JOKE_OUT_OF_IT_YOU_CANT_PUT_PUNCTUATION_IN_VARIABLE_NAMES_ANYWAY_THIS_CONSTANT_IS_THE_NAME_OF_THE_PERSON_WHO_SEES_SOMEONE_POST_A_JOKE_AND_DOESNT_REALISE_THAT_ITS_A_JOKE_SO_POSTS_THE_ANSWER_TO_THE_QUESTION_THAT_WAS_IMPLIED_IN_THE_JOKE_BUT_DIDNT_NEED_AN_ANSWER_MY_SHIF_HOLDING_DOWN_FINGER_IS_TIRED_NOW_SO_ILL_JUST_GIVE_YOU_THE_PERSONS_NAME_AND_STOP_TYPING As String = "denniswrenn"
:D:D:D
Sam Finch: Your code doesn't work.
I got a compiler error, "Identifier too long." (What a surprise!) :rolleyes:
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"
This must be officially the widest thread ever!
BTW: I don't use Declares.....I use a Type Library.
denniswrenn
parksieCode: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"
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.
FOUR?!?!?!?!?!?!
Who writes that much code on ONE LINE?????
(okay, so I do...but that's not the point :D)
okay guys, this is really getting lame now :mad:.
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"
perhaps this should have gone in the chit-chat forum?
And you guys expect to get guru like this?????? ya right!
[Edited by Zej on 08-18-2000 at 04:59 PM]
Wow!
This thread is waaaay out of context :D
ah, were's the submit reply button now?!?!Code:Text1 = "Const = " & UCase(replace(Text1, " ", "_")) & " = " & Val(text2)
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 _
you are right, we all have the maturity of 4 year olds, and we are proud of it... well I am :D
damnit Where is the submit button?
it took me a while to find the text area box too.. hehe
This is OUTTA CONTROL :D!!
Now...who's going to take it to 5 backgrounds long...
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. :D
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.
:D
Maybe Sam should'nt be Guru after all...how about "Humour Guru"? ...it's definitely unique...
What's unique is that the sum of the IQs of all of us equals Pi. :D
Code:Dim strThisIsTheLargestVariableThatIHaveEverDeclared As String
Oh no! I've turned into one of you ;)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
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