473,795 Members | 3,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Violation by fox toolkit in FXObject::MetaC lass::search(FX Selector key)

Well I've been sat here for hours twiddling with this code and it's
time to scream for help.

Hi there I'm a Student at Sheffield University programming the mapping
section of a control system for a flight simulator.
In order to do the graphical part required for the map we have an fox
declared window with an OpenGL canvas in it (loosely based on the
glviewer example which you get with the Fox toolkit download).
Things have been going hunky-dory so far but now im stuck with this
problem: When I inluded my most recent bit of code which loads Bitmaps
into OpenGL and declares them as textures I've been getting a:
0xC0000005: Access Violation from:

// Find function
const void* FXMetaClass::se arch(FXSelector key) const {
register const FXObject::FXMap Entry* lst=(const
FXObject::FXMap Entry*)assoc;
register FXuint n=nassocs;
while(n--){
//THE FOLLOWING LINE OF CODE:
if(lst->keylo<=key && key<=lst->keyhi) return lst;
lst=(const FXObject::FXMap Entry*) (((const FXchar*)lst)+as socsz);
}
return NULL;
}

If you already know exactly what the problem is GREAT! I'd really
appreciate if you could get back to me as soon as possible. If however
you need a bit more info then read on as I'v included the bit of code
that defines the textures:

if ((TextureImage[0]=LoadBMP("COMPA SS ROSE.bmp")) && //Load those
bitmaps!
(TextureImage[1]=LoadBMP("RUNWA Y.bmp")) &&
(TextureImage[2]=LoadBMP("VOR.b mp")) &&
(TextureImage[3]=LoadBMP("ILS and ILS-DME.bmp")) &&
(TextureImage[4]=LoadBMP("NDB.b mp")) &&
(TextureImage[5]=LoadBMP("DME.b mp")) &&
(TextureImage[6]=LoadBMP("TAC.b mp")) &&
(TextureImage[7]=LoadBMP("VOR-DME.bmp")))
{
Status=TRUE; // Set The Status To TRUE glGenTextures(8 ,
&texture[0]); // Create 8 Textures

for (int loop=0; loop<1; loop++) // Loop Through All 8 Textures
{
glBindTexture(G L_TEXTURE_2D, texture[loop]);

glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_ FILTER,GL_LINEA R);

glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_ FILTER,GL_LINEA R);

gluBuild2DMipma ps(GL_TEXTURE_2 D, 3, TextureImage[loop]->sizeX,
TextureImage[loop]->sizeY, GL_RGB, GL_UNSIGNED_BYT E,
TextureImage[loop]->data);
}
}

for (int loop=0; loop<1; loop++) // Loop Through All 8
Textures
{
if (TextureImage[loop]) // If Texture Exists
{
if (TextureImage[loop]->data) // If Texture Image Exists
{
free(TextureIma ge[loop]->data); // Free The Texture Image
Memory
}
free(TextureIma ge[loop]); // Free The Image Structure
}
}
Sorry about the length of this enquiry I just wanted to make sure I
included as much info as possible, if I'v missed anything you need to
know please dont hesitate to ask. Thanks a lot

Pete

p.s HEEEEEEEEEELLLL LPPP!!!!!!!!!!! !!!!!!

Apr 14 '06 #1
2 1820
Pete wrote:

0xC0000005: Access Violation from:

// Find function
const void* FXMetaClass::se arch(FXSelector key) const {
register const FXObject::FXMap Entry* lst=(const
FXObject::FXMap Entry*)assoc;
register FXuint n=nassocs;
while(n--){
//THE FOLLOWING LINE OF CODE:
if(lst->keylo<=key && key<=lst->keyhi) return lst;
lst=(const FXObject::FXMap Entry*) (((const FXchar*)lst)+as socsz);
}
return NULL;


My lst is in invalid pointer. Make sure that lst points to a valid object.

I also suggest you read the FAQ on how to post... you need to post a
minimal complete compilable example that demonstrates the issue.

However, given the error message, I'd check the value of assoc, and
nassoc. I'd also skip the register declaration, the compiler is
probably ignoring it anyways.

Apr 14 '06 #2
Pete wrote:
Well I've been sat here for hours twiddling with this code and it's
time to scream for help.


Please post this to a FOX mailing list. This newsgroup only discusses raw
C++ itself. I would bet that several here have read your code, looking for
some obvious C++ problem, such as a stray pointer.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3673
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc. And i have things to offer, and to request. And a lot of ideas, but who needs them.... here's an example (from type_struct.py):
10
3694
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. Andrew dalke@dalkescientific.com
0
10439
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7541
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.