flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Windows > Can't GetModuleHandleA OPENGL32.DLL [solved, thanks]

Author
Thread Post new topic Reply to topic
vivik



Joined: 29 Oct 2016
Posts: 45
Can't GetModuleHandleA OPENGL32.DLL [solved, thanks]
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: 12 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: 14469
Location: ?                               Posts: 6699
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.