Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 24 Nov 2006
Offline Last Active Jul 13 2016 02:56 AM

Posts I've Made

In Topic: why i don't get the HBITMAP from file\resource?

26 May 2016 - 10:45 AM

I don't really get your logic, but for all things Microsoft, you should look it up on MSDN.



In Topic: why i don't get the HBITMAP from file\resource?

25 May 2016 - 02:16 PM

The only thing that can go wrong is the HINSTANCE you pass. In the call to LoadBitmap, you use


By default, that would be the HINSTANCE you passed to WNDCLASS/WNDCLASSEX you registered before you created the HWND via CreateWindow/CreateWindowEx. The association is the class name.


With FindResource, you obtain the HINSTANCE via


which is used to get the HINSTANCE of the exe that started the process.


In the rare case that these two differ (e.g. the code is split between EXE and DLL-s), you should call LoadBitmap with GetModuleHandle(NULL).

In Topic: How do I change screen resolutions at runtime using SDL2?

20 May 2016 - 04:39 AM

I haven't tried it, but my guess would be that you'd have to re-create the window and its renderer.

In Topic: Getting error when receiving with SDLNet

24 February 2016 - 05:39 AM

This is the reason I like using std::vector and it's data() accessor. Priceless when you have to work with Win32.

In Topic: Generic Installer - Cross Platform

11 November 2015 - 01:38 AM

I do not think such a thing is possible.




Operating systems are different and they handle software installation in a different fashion. Next-next installers are a very Windows thing. Other OS-es handle adding software quite differently. Do not belive that there is a magic pill that will help you distribute your software in a uniform way (well, apart from Steam maybe). At the very least, users of different OS-es *expect* that adding software will be done differently.


The details:


On Windows:

  • the classic is to use Windows Installer (a.k.a. .msi)
    • many companies use WIX, an abstraction over WI. It is free, and also open source, if you care about that.
    • some use InstallShield
  • many use the Nullsoft installer (NSIS) - also free and open source
  • you can write your own from scratch, it is relatively easy (if you have even modest Win32 experience). Time consuming if you haven't written an installer before.

On Linux dstributions - there is no such a thing as universal installer :) They all go out of their way to make it difficult to provide binary packages that can survive more than a few releases/years, let alone compatible across distributions. There are alternatives to WI, such as .deb and .rpm, but I would recommend against going that route if you depend on other packages being installed, as packages get split or renamed over the years. Most software that works even after decades is to basically statically link against everything and do not depend on OS filesystem layout besides ~ and your installation directory. Also, limit your use of OS libraries to the bare minimum - prefer building all dependencies on your own and bundle them with your app (as you would on Windows). Plan to include a shell script that will force the loader to use your libraries instead of the system libraries (as they will be built with a different compiler version, etc).


If you want graphical installer for Linux - there used to be the Loki installer, but I'd recommend to try Steam and link to their libraries. It will be easier for both you and your users.


I've never owned a Mac, so I can't say anything about that.