954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help - Exception

The exception is:

Unhandled exception at 0x6474f269 in Loliboll.exe: 0xC0000005: Access violation reading location 0x0000000c.

I think it's a memory leak.

I tried to solve it obviously, but to no prevail.

This is the code:

#include "stdafx.h"

using namespace std;


int main()
{
//	FreeConsole();

	int a;

//	INTRO = 1;
//	MENU = 2;
//	INGAME = 3;

	elf_handle gui = elfCreateTextureFromFile("startup.png");
	elfSetGui(gui);
    elfInitWithConfig("config.txt");

  elf_handle scn = elfLoadScene("level1.pak");
	elf_handle cam = elfGetCameraByName(scn, "Camera");

	elf_handle tex = elfCreateTextureFromFile("startup.jpg");
	elf_handle pic = elfCreatePicture("MyPicture");
	elfHideMouse(true);

	
	//Sets the default state to be the intro state.

	a = 1;

	elf_handle timer = elfCreateTimer();
	elfStartTimer(timer);
	elfSetPictureTexture(pic, tex);
	elfAddGuiObject(gui, pic);

    while(elfRun())
    {a
		
		if (a == 1)
		{
			if(elfGetElapsedTime(timer) > 5.0)
				elfSetGuiObjectVisible(pic, false);
				a = 2;
		}
		
		if (a == 2)
		{
		}

		if (a == 3)
		{
		}
		
    }

    elfDeinit();

    return 0;

}


By the way, there are no errors or warnings, i solved those.

axeves
Newbie Poster
4 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

elf_handle is probably defined wrong.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

It would be good practice to always check your return codes. If you do so, you will most likely find your error.

template<>
Junior Poster
165 posts since Feb 2011
Reputation Points: 84
Solved Threads: 26
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: