![]() |
|
Can't load_bitmap after GetOpenFileName |
Wilson Saunders
Member #5,872
May 2005
![]() |
I am using winalleg.h's GetOpenFileName() to retrieve the path to a file. I have it working such that I get a path form GetOpenFileName(). However the next time I call load_bitmap() I get NULL returned instead of the bitmap pointer. All my previous calls to load_bitmap() return the a bitmap pointer. Also the load_bitmap call that fails is hardcoded with the file name. The load_bitmap call works if GetOpenFileName() was not called previously. Oddly it also works if GetOpenFileName() was called but was canceled instead of successfully retrieving a file name. My best guess is that something in the GetOpenFileName() is setting some sort of windows flag that forbids allegro's load_bitmap() from functioning properly. Has this happened to any of you? How can I fix this? ________________________________________________ |
23yrold3yrold
Member #1,134
March 2001
![]() |
Quote: My best guess is that something in the GetOpenFileName() is setting some sort of windows flag that forbids allegro's load_bitmap() from functioning properly.
Or setting a flag that messes with the retrival of the filename data itself. The OPENFILENAME structure is .... not small. Quote: Has this happened to any of you? Only when using Win32 straight up. Sadly, I forget the solutions I came up with, and I don't know how they might work with Allegro .... -- |
Wilson Saunders
Member #5,872
May 2005
![]() |
Here is the problem code, in case any of you can spot what I am doing wrong. I have added the load_bitmap right after the GetOpenFileName to remove the chance something else is messing up the load_bitmap call. Normally the load_bitmap call happens else where.
________________________________________________ |
|