Weird error with member variables?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Ok, I'm stumped. I'm getting an access violation with the following
code, but no clue why.

Definition:
class CRoughView : public CScrollView
{
protected:
CRoughView();
DECLARE_DYNCREATE(CRoughView)
//...Overwritten functions...

public:
void SetStepDistance(float NodeStepDistance)
{
fDistance = NodeStepDistance;
}
private:
float fDistance;
};

Nothing to complicated right? A simple float variable, and a simple
variable assigment.

However, when I call the SetStepDistance function, I get an access
violation writing location 0x000002ac in debug mode. Anyone have any
clue why I'm unable to define / touch this variable?

Thanks,
Josh McFarlane

.



Relevant Pages

  • Problem with registering the service with the ServiceControlHandle
    ... handle fails with "An Access Violation" error. ... I dont have a clue as to which ... memory I am stepping on. ...
    (microsoft.public.win32.programmer.kernel)
  • Application AV
    ... I often get this message error: ... Access violation at address 00568A08 in module 'FacLoja2001.exe'. ... Can anyone give me a clue on what is provoquing this? ...
    (borland.public.delphi.non-technical)