19 Jun '13 - 12:40 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: [RFE] Automatic creation of hidden window  (Read 586 times)
deiruch
Posts: 4


« on: 9 May '12 - 19:03 »
Reply with quoteQuote

Hi Ian

First of all thanks again for BASS. Works fine in 99.999% of the cases for our game (http://gewaltig.net). Sadly, every now and then initialization fails, but less than one in 10'000 starts. The error code returned is always BASS_ERROR_UNKNOWN - this is probably caused because I pass no window handle (see http://www.un4seen.com/forum/?topic=2693.0 for example). I do this because I'm using Java and it's quite difficult to get the handle of the window.

Can't you create a hidden window automatically when no window handle is passed to BASS_Init? That would help tremendously.

Cheers,
Simon
Logged
Ian @ un4seen
Administrator
Posts: 15363


« Reply #1 on: 10 May '12 - 15:25 »
Reply with quoteQuote

It wouldn't necessarily be a matter of simply creating a hidden window. The thread would also need to have a message queue and a processing loop, to process the window's messages. So BASS would probably need to handle that stuff too if it created a hidden window, as it can't be sure that the user's code will. I'll see if something can be arranged.
Logged
deiruch
Posts: 4


« Reply #2 on: 10 May '12 - 16:05 »
Reply with quoteQuote

I understand. Thanks for looking into this.

By the way, according to Alan Ludwig, it's also acceptable to just pass the desktop window. See here:
https://groups.google.com/forum/?fromgroups#!msg/microsoft.public.win32.programmer.directx.audio/a7QhlgNFBpg/w8lTd8_NRSEJ

via http://stackoverflow.com/questions/6714111/how-to-provide-a-hwnd-to-directsound-setcooperativelevel-in-a-console-program
Logged
Ian @ un4seen
Administrator
Posts: 15363


« Reply #3 on: 10 May '12 - 17:05 »
Reply with quoteQuote

Interesting. Here's an update to try, in which BASS_Init will use the desktop window rather than the foreground window when a window handle isn't provided...

   www.un4seen.com/stuff/bass.dll

It seems to be fine, but let me know if you find different Smiley
Logged
deiruch
Posts: 4


« Reply #4 on: 11 May '12 - 14:25 »
Reply with quoteQuote

I'll distribute the next version with this change and will keep you updated on whether this works as intended. Note that it'll take some weeks. Thanks again!
Logged
deiruch
Posts: 4


« Reply #5 on: 18 Jun '12 - 11:09 »
Reply with quoteQuote

I'm pretty sure that did the trick. Haven't got a single crash report so far with the new version.

Thanks a bunch.
Logged
Ian @ un4seen
Administrator
Posts: 15363


« Reply #6 on: 18 Jun '12 - 14:47 »
Reply with quoteQuote

That's good to hear. If it continues to look fine, the modification will be left in for the next BASS release.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines