Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[MFC] ¤@­ÓError Message

0 views
Skip to first unread message

優質水瓶

unread,
Feb 22, 1998, 3:00:00 AM2/22/98
to

【 在 blac...@bbs.tku.edu.tw (邊緣人) 的大作中提到: 】
: 我用Visual C++寫了一個MDI程式,Project Name叫作Infer,
: 我在CInferDoc中宣告一個變數double m_dblX0,
: 並且在BOOL CInferDoc::OnNewDocument中給它記憶體,
: ======================================
: m_dblX0 = new double[m_lngCount+1]; //m_lngCount=11
: ======================================
: 然後在CInferView::OnInitialUpdate中call CinferDoc的
: member function如下,
: ======================================
: CInferDoc *pDoc = GetDocument();
: pDoc->RealValue(1);
: ======================================
: double CInferDoc::RealValue(int intIndex)
: {
: return *(m_dblX0 + intIndex);
: }
: ======================================
: 結果會產生"Access Violation"的Error Message,
: why?

1. If you want to call member function "RealValue" in class "CInferView"
you have to set "RealValue" as "public" or set "CinferView" as friend

2. If you want to return a point in function "RealValue",your function
"RealValue" should declare as " public double* CInferDoc::RealValue
(int intIndex); "

--
人的一生中
總會遇到一個他摯愛的人
雖然我生命中的摯愛已離我遠去
但我永遠珍惜與她共同擁有的日子
Dear lover:
平安 快樂 ActiveX 98/02/14

[m [1;37m※ 來源:‧神秘之旅 bbs.ice.cycu.edu.tw‧[FROM: pc21411.ice.cycu.edu.tw] [m

0 new messages