Texture not loaded

Do I have to load texture when the program starts (in OnCreate())? My program needs to determine which texture to load after it starts. Texture isn’t loaded if I don’t load it in OnCreate().

It does not matter when you load your texture. The limitation is that you can only do something with OpenGL (like texture loading) after you call wglMakeCurrent, i.e. after initialization. So you can even load your texture from OnDestroy…