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

Author Topic: very strange gui error with network  (Read 1536 times)

0 Members and 1 Guest are viewing this topic.

etixpp

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
    • FoxFire Development Website
    • Email
very strange gui error with network
« on: October 29, 2013, 02:21:32 am »
Hello,
I got a small big problem. Everytime, i use the sfgui and try to make a webrequest or something, i get a exception, i got no clue what causes this, any ideas`?

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: very strange gui error with network
« Reply #1 on: October 29, 2013, 02:41:38 am »
Can you post a simple test program that causes it and tell us exactly what the exception was and where it happened?  (be sure to run it in the debugger)

etixpp

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
    • FoxFire Development Website
    • Email
Re: very strange gui error with network
« Reply #2 on: October 29, 2013, 03:01:32 am »
i create this stuff:
                sfg::SFGUI sfgui;
                button = sfg::Button::Create( "Hello" );
                button->GetSignal( sfg::Button::OnLeftClick ).Connect( &OnButtonClick );
                sfg::Window::Ptr Deskwin = sfg::Window::Create();
                Deskwin->SetTitle( "Hello World example" );
                Deskwin->Add( button );
                sfg::Desktop desktopx;
                desktopx.Add( Deskwin );

And when i make a thread.start();
which does a few web requests like
                        sf::Http http;
                                http.setHost("http://riedbook.de/");
                                sf::Http::Request request;
                                request.setMethod(sf::Http::Request::Get);
                                request.setUri("images/"+Main);
                                request.setHttpVersion(1, 1); // HTTP 1.1
                                sf::Http::Response response = http.sendRequest(request);
                                std::string body = response.getBody();

                                MainTexture.loadFromMemory(body.data(),body.size());
                                MainSprite.setTexture(MainTexture);
                                mode = 1;
i throws a exception. If i do not define the first stuff everything is fine and if i do not start the thread everything is fine aswell, but if i do both together it crashes, like
Ausnahme (erste Chance) bei 0x69BF8A78 (nvoglv32.dll) in Rpg.exe: 0xC0000005: Zugriffsverletzung beim Schreiben an Position 0x070B6000

Falls ein Handler für diese Ausnahme vorhanden ist, kann das Programm möglicherweise weiterhin sicher ausgeführt werden.

etixpp

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
    • FoxFire Development Website
    • Email
Re: very strange gui error with network
« Reply #3 on: October 29, 2013, 03:24:37 am »
i just fixed the problem.
For some very strange reason declaring sfg::SFGUI sfgui; globaly and not in the main function let´s the problem disappear

 

anything