Click here to Skip to main content
14,765,715 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
Generalavailable serial com emulation Pin
vc-programmer-30-Jan-05 17:57
Membervc-programmer-30-Jan-05 17:57 
GeneralRe: available serial com emulation Pin
vc-programmer-30-Jan-05 19:25
Membervc-programmer-30-Jan-05 19:25 
QuestionHow to create a Windows API function? Pin
rushing30-Jan-05 17:10
Memberrushing30-Jan-05 17:10 
AnswerRe: How to create a Windows API function? Pin
careerdrill31-Jan-05 1:58
Membercareerdrill31-Jan-05 1:58 
GeneralWindow Messaging Pin
JKallen30-Jan-05 16:34
MemberJKallen30-Jan-05 16:34 
GeneralRe: Window Messaging Pin
Blake Miller31-Jan-05 6:49
MemberBlake Miller31-Jan-05 6:49 
Generalaccess violation at 0x00000000 Pin
IsaacLitingjun30-Jan-05 16:19
MemberIsaacLitingjun30-Jan-05 16:19 
GeneralRe: access violation at 0x00000000 Pin
IsaacLitingjun30-Jan-05 16:24
MemberIsaacLitingjun30-Jan-05 16:24 
In My CvcydcjDoc Class, i have such kind of memory to store data.

<br />
class CvcydcjDoc : public CDocument<br />
{<br />
protected: // create from serialization only<br />
	CvcydcjDoc();<br />
	DECLARE_DYNCREATE(CvcydcjDoc)<br />
<br />
// Attributes<br />
public:<br />
struct MEM_MEMORY{<br />
	int  State;//<br />
<br />
	char szBz[100];// <br />
	int	 nCjzcs;	//<br />
	int	 nSbzcg;	//<br />
	int  nZdcjcs; //<br />
	char szZje[12];	//<br />
	int  nCjcgcs;	//<br />
	int  nZdcjcgcs;	//<br />
	int  nCjymcs; //<br />
	int  nZdcjsbcs;//<br />
	char szRowid[20];<br />
	char szCjzt[2];// <br />
        <br />
        ...<br />
<br />
};<br />
<br />
MEM_MEMORY memRead[2000];<br />


and in my thread, i access data using this way:

1. First i get the Doc pointer:

CMainFrame* pMainFrmWnd = (CMainFrame*)AfxGetMainWnd();<br />
	ASSERT(pMainFrmWnd != NULL);<br />
	CvcydcjView* pMyView = NULL;<br />
	CWnd* pchildWnd = pMainFrmWnd->GetWindow(GW_CHILD);<br />
	ASSERT(pchildWnd->GetSafeHwnd() != NULL);<br />
	//while(pchildWnd->GetSafeHwnd() != NULL)<br />
	//{<br />
	//	ASSERT(pchildWnd->GetSafeHwnd() != NULL);<br />
	//	if(pchildWnd->GetRuntimeClass()->m_lpszClassName == "CvcydcjView")<br />
	//	{<br />
			pMyView = (CvcydcjView*)pchildWnd;<br />
	//		break;<br />
	//	}<br />
	//	pchildWnd = pchildWnd->GetWindow(GW_HWNDNEXT);<br />
	//}<br />
	ASSERT(pMyView != NULL);<br />
	CListCtrl* pList = (CListCtrl*)pMyView->getItem(IDC_LIST_DIAL);<br />
	CListCtrl* pListMsg = (CListCtrl*)pMyView->getItem(IDC_LIST_MESSAGE);<br />
	CStatic* pCjcount = (CStatic*)pMyView->getItem(IDC_CJCOUNT);<br />
	CStatic* pCjymcount = (CStatic*)pMyView->getItem(IDC_CJYMCOUNT);<br />
	CStatic* pCjcgcount = (CStatic*)pMyView->getItem(IDC_CJCGCOUNT);<br />
	CStatic* pCjcscount = (CStatic*)pMyView->getItem(IDC_CJCSCOUNT);	<br />
	CvcydcjDoc* pMydoc = (CvcydcjDoc*)lp;<br />


then i manipulate that data in this way:
<br />
...<br />
strcpy(pMydoc->memRead[nRecNumber].szCjzjhm,str);<br />
...<br />


i don't know whether it's the problem or not...

Hope someone can help me,,, Thx!

________________________________________

Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could!
Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ...

There can be miracles! When you believe, though hope is frail, it's hard to kill!
Who knows what miracles, you can achieve! When you believe, somehow you will ...

YOU WILL WHEN YOU BELIEVE

GeneralRe: access violation at 0x00000000 Pin
PJ Arends30-Jan-05 17:09
professionalPJ Arends30-Jan-05 17:09 
GeneralRe: access violation at 0x00000000 Pin
IsaacLitingjun30-Jan-05 18:22
MemberIsaacLitingjun30-Jan-05 18:22 
Generaltext file to Word document Pin
yannah30-Jan-05 15:56
Memberyannah30-Jan-05 15:56 
Generalget the system driver Pin
masmstudio30-Jan-05 15:40
Membermasmstudio30-Jan-05 15:40 
GeneralPowering down Win98 system Pin
Still learning how to code30-Jan-05 12:05
MemberStill learning how to code30-Jan-05 12:05 
GeneralRe: Powering down Win98 system Pin
PJ Arends30-Jan-05 12:32
professionalPJ Arends30-Jan-05 12:32 
GeneralRe: Powering down Win98 system Pin
Still learning how to code31-Jan-05 9:29
MemberStill learning how to code31-Jan-05 9:29 
GeneralRe: Powering down Win98 system Pin
PJ Arends31-Jan-05 10:21
professionalPJ Arends31-Jan-05 10:21 
GeneralRe: Powering down Win98 system Pin
Still learning how to code31-Jan-05 11:31
MemberStill learning how to code31-Jan-05 11:31 
GeneralRe: Powering down Win98 system Pin
PJ Arends31-Jan-05 11:45
professionalPJ Arends31-Jan-05 11:45 
GeneralRe: Powering down Win98 system Pin
Still learning how to code31-Jan-05 12:31
MemberStill learning how to code31-Jan-05 12:31 
GeneralCalling th OSK (ON-Screen Keyboard) Pin
Alex Evans30-Jan-05 10:43
MemberAlex Evans30-Jan-05 10:43 
GeneralAlgorithm and necessary code Pin
joy00730-Jan-05 6:57
Memberjoy00730-Jan-05 6:57 
QuestionHow to Enable at runtime Pin
joy00730-Jan-05 6:40
Memberjoy00730-Jan-05 6:40 
AnswerRe: How to Enable at runtime Pin
Bob Ciora30-Jan-05 7:15
MemberBob Ciora30-Jan-05 7:15 
AnswerRe: How to Enable at runtime Pin
Ravi Bhavnani30-Jan-05 7:17
professionalRavi Bhavnani30-Jan-05 7:17 
GeneralCArray can't add Pin
jw8130-Jan-05 6:31
Memberjw8130-Jan-05 6:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.