   VB and OpenGL - Memory Leak Program
  Hey Everyone,I've been programming in VB for about 4 years, doing OpenGL about 4/5 months. I've been working on this section of code for a long time now, and haven't been able to get it too work :(. However, I'm sure a load of people have had similar problems, or at least I hope.The source code for the project is found at:www.essersoft.com/OpenGL.zipIf anyone could take a look at it, it would be much appreciated. It seems to crash and have a memory leak but for the life of me I can't find it.Thanks in advance everyone.Andy   
  1) Your website doesn't seem to have a start page (I see the directory listing).2) Do not store full paths in VBP file - it's annoying to have to edit them in oeder to open your project.3) INCLUDE ALL FILES! frmMain.frm and vbogl.tlb aren't there. As well as some textures that I guess will be necessary to run it.4) If you have trouble with code, better post the relevant part and not put the whole of it for download.   ;  Sorry about that, thought everything was in, and sorry about the paths, that was done accidentally by VB. I believe the problems lies within the Texture loading routine (don't worry about the textures for the time being, it's not creating any model so doesn't need them).Here's the routine:Public Function LoadGLTextures() As BooleanDim sFile As StringDim bmFile As BITMAPFILEHEADERDim bmInfo As BITMAPINFOHEADERDim iFile As IntegerDim lImageSize As LongDim iPixelSize As IntegerDim I As IntegerDim lnData As StringDim upperErase gaTexturesErase texPathReDim texPath(5)texPath(0) = "Data\spacer.bmp"texPath(1) = "Data\lcars2.bmp"texPath(2) = "Data\turbolift.bmp"texPath(3) = "Data\viewer.bmp"texPath(4) = "Data\lights.bmp"texPath(5) = "Data\floor.bmp"On Error GoTo ERR_Hupper = UBound(texPath)ReDim gaTextures(upper)For I = 0 To upper    Dim baImageData() As Byte    Dim bmRGB() As RGBQUAD   sFile = App.Path & "\" & texPath(I)    iFile = FreeFile    Open sFile For Binary As iFile   Get #iFile, , bmFile   Get #iFile, , bmInfo   If (bmInfo.biBitCount < 24) Then  ReDim bmRGB(bmInfo.biClrUsed)  Get #iFile, , bmRGB   End If   iPixelSize = bmInfo.biBitCount / 8   lImageSize = bmInfo.biWidth * bmInfo.biHeight * iPixelSize   ReDim baImageData(lImageSize)   Get #iFile, , baImageData    Close #iFile    glGenTextures upper, gaTextures(I)    glBindTexture glTexture2D, gaTextures(I)    glTexParameteri glTexture2D, tpnTextureMagFilter, GL_NEAREST    glTexParameteri glTexture2D, tpnTextureMinFilter, GL_NEAREST    glTexImage2D glTexture2D, 0, 3, bmInfo.biWidth, bmInfo.biHeight, 0, tiBGRExt, GL_UNSIGNED_BYTE, baImageData(0)   Erase baImageData    Erase bmRGBNext I    LoadGLTextures = TrueEXIT_H:    Exit Function  ERR_H:    MsgBox Err.Description    LoadGLTextures = False    Resume EXIT_H    End FunctionSorry about that, but I'm not certain this is where the problem lies, but it's where i'm guessing it is.   