

InterviewSolution
1. |
Solve : For a newbie, C++ or Java or what?? |
Answer» meh. I'm in no position to judge it anymore; heck I discarded my first project. My second project, I still have. a Spaceship game called "blackspace"... except it's mostly programmed in VB2 and a few things won't load properly... I seem to get a "Statement too complex" error when trying to load almost all of my old projects. (64 projects in my VBPROJ directory- and 165 within a "OLDSTUFF" folder beneath that. my "gravgame", a few projects I made for printing passwords on labels for the start of a school year... which fell through because the goofs higher up in the school district didn't send the excel spreadsheet on time. This is all very interesting. And it could illustrate why a Microsoft language is not a good place for a newbie to start out. you can still use ASM with VB6- in fact I use it to subclass windows without crashing. The trick is in the API call- you are "supposed" to pass in a pointer to a procedure that windows will call- but if you instead point it to a string VARIABLE with assembled ASM then it will actually execute the machine code that is present in the string variable. But why the slimy hack? VB has an "AddressOf" operator, after all. The idea is to make it possible for CLASS instances to subclass window MESSAGES, rather then require a Module to contain the WindowProc() and route the message to the proper Class instance based on the hwnd or something. Additionally it prevents the VB6 IDE from crashing during testing, since the ASM code remains in memory and is thus a valid JMP location throughout; before this "hack" the addressOf method was unstable during debugging, since pushing the stop button would mean that the module containing the windowproc is unloaded- but windows still calls it for messages on the window, such as the WM_CLOSE message; it calls nonexistent code and crashes. HARD... As far as "outperforming" the standard routines- this is generally quite easy via API routines. For example, instead of using DIR$, one can use the FindFirstFile(),FindNextFile() and FindClose() functions. This has the benefit of allowing recursive calls which aren't directly possible with DIR$() without cacheing folder names and recursing on them at the end of the procedure. After dabbling with ASM for the subclassing code... well I THINK any future ASM work will avoid the windows platform...Visual basic just seems to have added alot more that it's ancestor and smaller dialects of it. |
|