Jump to content
Software FX Community

Re: GetTitle causing access violations.


User (Legacy)
 Share

Recommended Posts

I've been referred to that knowledge base article before, but it really 

doesn't address the problem at hand. I'm not having any problems reading

data out of the chart and the values I extract are exactly what I expect.

What's causing the access violation is if I try to write a new title into

the chart AFTER extracting the old one.

Example:

// Put in a title

pChart->Title[CHART_BOTTOMTIT] = "abc"; // fine

// Now copy it out (code copied from knowledge base.)

char s[256], *sp;

sp = s;

sp = pChart->Title[CHART_BOTTOMTIT]; // fine. results ok.

pChart->Title[CHART_BOTTOMTIT] = "def"; // Access violation here.

I've tried several permutations, including loading the titles into character

arrays and passing them as char* 's, but it makes no difference. I noticed

that I can assign as many different titles as I want BEFORE extracting the

title and the access violation does not occur (and, as expected, the most

recently assigned title is that one that is extracted.) It never fails,

however, that if I try to assign a title after I have previously extracted

it, I get an access violation from inside the chart object. Is there some

sort of "reset" function I need to call on titles?

Andrew

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...