flat assembler
Message board for the users of flat assembler.

flat assembler > Windows > Can't GetModuleHandleA OPENGL32.DLL [solved, thanks]

Author
Thread Post new topic Reply to topic
vivik



Joined: 29 Oct 2016
Posts: 425
Hello. I have this weird problem, KERNEL32.DLL and USER32.DLL are loading properly, but with OPENGL32.DLL I'm getting ERROR_MOD_NOT_FOUND (0000007E).

Opengl works from normal executables, but not if I try to GetModuleHandle it. It doesn't load opengl32.dll, opengl.dll, OPENGL.DLL either.

Here is a little program to check if it works from your computer. (compiled version in attachment). Please check it.

Code:
include 'win32ax.inc'

.code

start:
    invoke GetModuleHandleA, "OPENGL32.DLL"
    test eax,eax
    jz fail
success111:
    invoke MessageBox,0,"SUCCESS!!! IT WORKS!!","YES!",0
    jmp exit
fail:
    invoke MessageBox,0,"nope, returned zero","error",0
exit:
    invoke ExitProcess,0

.end start
    


Description:
Download
Filename: hello-opengl.zip
Filesize: 558 Bytes
Downloaded: 100 Time(s)



Last edited by vivik on 17 Dec 2016, 11:39; edited 1 time in total
Post 17 Dec 2016, 10:43
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15984
Location: Qo'noS
GetModuleHandle only "works" if the DLL has already been linked to you executable. Sometimes other DLLs will link to OPENGL32, even if you don't, and it will be linked because those other modules request it. Otherwise you will get an error. If you want to load it then use LoadLibrary.
Post 17 Dec 2016, 11:08
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2018, Tomasz Grysztar.

Powered by rwasa.