The file content:
100 2 360 650000
11, 1024, 995-22131 212 200 100. Dat 0 MLII
11 1024 1011 20052 212 200 100. Dat 0 V5
# 69 M 1085 1629 x1
# Aldomet, Inderal
In addition to the system generated code I added code below
BOOL CECG2Doc: : OnOpenDocument (LPCTSTR lpszPathName)
{
if (! CDocument: : OnOpenDocument (lpszPathName))
return FALSE;
//TODO: here to add your special creation code
CFile hfile;
Cstrings info [25];
Cstrings tempinfo;
Int m=0;
Hfile. Open (_T (" C: \ Users \ Desktop \ 100. Hea "), CFile: : modeRead);
Char pbufs [500].
Hfile. Read (pbufs, sizeof (pbufs));
Char * HP;
HP=& amp; Pbufs [0].
For (int k=0; K<=sizeof (pbufs); K++)
{
If (m==25)
{
break;
}
If ((int) * HP==10 | | (int) * HP==13)
{
Hp++;
}
If (* HP!=' '& amp; & (int) * HP!=10 & amp; & (int) * HP!=13)
{
Tempinfo=tempinfo + (cstrings) (* HP);
}
The else
{
The info [m]=tempinfo;//remove the read information stored in the array
Tempinfo="";
M++;
}
Hp++;
}
M_case. M_ID=info [0];//the medical record information stored in the structure
M_case. M_dao0=info [12].
M_case. M_dao1=info [21].
M_case. M_Name=info [13].
If (info [24]=="F")
{
M_case. M_Sex="female";
}
The else
{
M_case. M_Sex="male";
}
M_case. M_Age=info [23].
Hfile. Close ();
return TRUE;
}
H
the statement in stafx.Struct {//statement structure m_case
Cstrings m_ID;
Cstrings m_dao0;
Cstrings m_dao1;
Cstrings m_Name;
Cstrings m_Sex;
Cstrings m_Age;
} m_case;
Program error is as follows:
The first wrong out in hfile. Open (_T (" C: \ Users \ Desktop \ 100. Hea "), CFile: : modeRead);
1> C: \ users \ documents \ visual studio 2010 \ projects \ ecg2 \ ecg2 \ ecg2doc CPP (150) : warning C4129: ": do not identify escape sequences of characters
1> C: \ users \ documents \ visual studio 2010 \ projects \ ecg2 \ ecg2 \ ecg2doc CPP (150) : warning C4129: a "D" : do not identify escape sequences of characters
The second fault lies in a
1> Stdafx. Obj: error LNK2005: "struct & lt; Unnamed - type - m_case & gt; (m_case "? M_case @ @ 3 u & lt; Unnamed - type - m_case & gt; @ @ A) has been ECG2Doc. Obj defined in
1> C: \ Users \ Documents \ Visual Studio 2010 \ Projects \ ECG2 \ Debug \ ECG2 exe: fatal error LNK1169: locate one or more of the definition of multiple symbol
CodePudding user response:
Hfile. Open (_T (" C: \ Users \ Desktop \ 100. Hea "), CFile: : modeRead);CodePudding user response:
Hfile. Open (_T (" C: \ Users \ Desktop \ 100. Hea "), CFile: : modeRead); In this line of code has a problem, the double quotes \ should be changed to \ \ theHfile. Open (_T (" C: \ \ Users \ \ Desktop \ \ 100. Hea "), CFile: : modeRead);
CodePudding user response:
Escape \ \ \ said just said the backslashThe header file to add
#pragma once
CodePudding user response: