Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - drpitch

Pages: [1]
1
Graphics / Setting application icon
« on: July 08, 2009, 03:23:40 pm »
Hi all,

I'd like to set an image icon for my application. I'm using C++ on Visual Studio 2008.

I've seen that there's a SetIcon method that receive a pointer to the buffer of the image, but I really don't know how to use it since I've got a HICON:
Code: [Select]

sf::RenderWindow m_window;
HICON hIcon = (HICON) LoadImage(instance, MAKEINTRESOURCE(IDI_MYICON), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);

m_window.SetIcon(32, 32, ???);


Does anyone know how this can be done?

Thanks!

2
Audio / Crashing after "Failed to open the audio device".
« on: June 28, 2009, 02:07:09 pm »
Hi all,

Sometimes I'm getting a "Failed to open the audio device" message on the console output when I run my application using SFML. After that message, the application crashes.

Source code lines of my app thatares using audio SFML commands are:
Code: [Select]

m_sound_buffer = new sf::SoundBuffer();
if(!m_sound_buffer->LoadFromFile(GetConfigFile()->GetDataPath() + "mig.ogg"))
{
  return;
}
m__sound = new sf::Sound(*m_sound_buffer, true);


Console output:
Failed to open the audio device
An internal OpenAL call failed in soundbuffer.cpp (46) : AL_INVALID_OPERATION, t
he specified operation is not allowed in the current state
An internal OpenAL call failed in soundbuffer.cpp (300) : AL_INVALID_OPERATION,
the specified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (51) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (53) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (54) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (55) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (56) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (57) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state

Stack frame:
openal32.dll!00b8c5eb()
[Frames below may be incorrect and/or missing, no symbols loaded for openal32.dll]
openal32.dll!00b8ba5c()
kernel32.dll!7c80b729()

Error message:
Unhandled exception at 0x00b8c5eb in app.exe: 0xC0000005: Access violation reading location 0x00000000.

I guess that application crashes because it can't initalize the audio device, but my application doesn't realize of the error and then tries to load the .ogg file. How could I know if my audio device is initalized properly or not??

Thanks!

3
Audio / SFML audio crashing on Vista
« on: June 03, 2009, 12:17:23 am »
Hi,

I'm developing a project using SFML on Windows Xp and it works great. But the same project on Vista has random crashes. I think that audio library has something to do with it, because the application only crashes when in the console ouput there is a "Failed to open the audio device" message.

The weird thing is that just after crashing I run the application again and the application doesn't crash (and it doesn't show the "Failed to open the audio device" message). So, how it's possible that sometimes the library can open the audio device and sometimes it can't?????

Thanks!

Edit: I've fixed the crash. I was mixing static and dynamic linking (I ignored some linking warnings) and that was making my app to crash :roll:

4
Network / Troubles with bi-directional communication.
« on: May 14, 2009, 10:22:20 am »
Hi!

I'm in troubles to make sockets work when server is sending and receiving data. I need some help ;)

There are two server threads(TS1, TS2) and one client thread (TC).

TS1 does:
- Listen
- loop with:
    - Select
    - if it's a new client -> Send message to a dialog window
    - if it's a known client -> Receive (should receive the "POTATOE" string sent by the client [see below]).

TS2 does:
- Receives the message sent to the dialog window (WM_COMMAND) and calls to Send("INIT")

TC does:
- Receive (and it's blocked until TS2 sends the "INIT" string)
- Send("POTATOE")

Well, the thing is that TC receives the INIT string and sends the POTATOE string to the server, but the server doesn't receive "POTATE" but "INIT" string.

I'm launching server and client application on the same host, but this should not be a problem since server and clients are on different ports.

Pages: [1]
anything