Not long ago I decided it would be wise to extend my programming horizon and get to know C++ better. I kind of feel like a newb all over – again. Anyway, it seems that successes come in at a faster pace as they used to appear when learning other languages – which kind of makes learning C++ (even) more fun, despite the occasional and unavoidable mental blockade. Now that I have a bit more time, I apparently also decided to finally continue to work on my blog. Both things combined, and the need to compile tolua++ for a new project of mine, lead to this post. Note, that the instructions here are derived from the lua-users.org wiki article Compiling Toluapp Without Scons. The original author did already explain on how to compile it on VS2003 and VS2005, but left a small pitfall when compiling the actual executable. I tried to make this a version for dummies – if I succeeded, do not feel offended: it is also supposed to be a reference for myself :)
Adding a ContextMenuStrip to a single ListView is quite simple – just drag’n'drop stuff in the Forms Designer it seems. Not everything that seems simple actually is that simple though. When trying to perform some action on a specified ListViewItem things can quickly become more complicated. Even more so when working with several ListViews but only one ContextMenuStrip that is supposed to do all the work. In the following example I will show how to deal with the small problems one will come across when trying to implement those features.
While implementing the MaskedTextBox class is pretty straight forward when working with existing types, such as DateTime, and its use is very well documented, I found it slightly more difficult to implement it using a custom type. Since most of the information I was able to find on the web was either discussing the former or problems implementing the latter, I decided to give it a go and share my findings.
Building our own import library
Now this time we will just build our own import libraries. This will obviously make for more optimized code, as it will not have to call LoadLibraryA and GetProcAddress every time we want to call a FMOD function. It also saves us the hassle of having an extra asm file to include into our project (i.e. if we were to put the prototypes and function definitions in their own asm file and link it).
Prototyping the functions
For this little project the way used above might be good enough. When dealing with larger projects it would be nice to be able to use MASMs inherent function wrapper which makes for a lot cleaner code. To be able to do that we need to first prototype the function:
FMOD (available at http://www.fmod.org) is an API which allows easy code implementation of playing back different formats of sound files. I stumbled upon it after a sudden flash of nostalgia send me searching for some simple routines to playback some of my old module files (no need to reinvent the wheel, now is there?) The main problem with using APIs with MASM is that oftentimes there are no libraries available for those APIs. Even though apparently the FMOD devs used to supply MASM header and libraries with their distro, they stopped doing so. But fear not, not all is lost – there are still ways to make FMOD, and every other API for that matter, work from within MASM code.
Years ago I bought a CD full with password protected PKSFX archives. It came with 4 passwords, leaving the option to purchase the other passwords if desired. I was young and poor, so buying those passwords was out of question. I also was brought up in the communistic GDR and some part deep inside of me just thought that this buisiness model was just wrong. I had purchased the CD believing all contents was free for me to use. Obviously being poor and believing something is not right is a poor excuse for trying to steal. I did mention though that I was young – and not very wise yet. Another point contributing to my defense is the fact that I never managed to actually break any of those passwords.
Diese Antworten (auf die FAQs) beschreiben Brainwave Entrainment oder Brainwave Synchronisation.