Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMemory leak Pin
parag20-Jun-01 20:56
parag20-Jun-01 20:56 
GeneralRe: Memory leak Pin
Christian Graus20-Jun-01 22:25
protectorChristian Graus20-Jun-01 22:25 
GeneralLVN_ITEMCHANGED - CListCtrl Pin
sankar20-Jun-01 20:49
sankar20-Jun-01 20:49 
GeneralRe: LVN_ITEMCHANGED - CListCtrl Pin
Michael Dunn20-Jun-01 20:53
sitebuilderMichael Dunn20-Jun-01 20:53 
GeneralRe: LVN_ITEMCHANGED - CListCtrl Pin
Michael Dunn20-Jun-01 21:43
sitebuilderMichael Dunn20-Jun-01 21:43 
Questionhow can i handle file commands to read and write xml files Pin
pathi20-Jun-01 20:27
pathi20-Jun-01 20:27 
AnswerRe: how can i handle file commands to read and write xml files Pin
Tomasz Sowinski21-Jun-01 0:24
Tomasz Sowinski21-Jun-01 0:24 
GeneralRe: how can i handle file commands to read and write xml files Pin
pathi21-Jun-01 23:56
pathi21-Jun-01 23:56 
Yeah I am trying to override OnOpenDocument() but i cant get the data from file into the document.I declared DISPPARAMS pointer in document and trying to get the data read from file into this pointer but getting an error.my aim is to read from file and show it in view.
my code is
void componentView::fileOpen()
{
isFileOpen=true;
CFileDialog file(true,
NULL, NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
NULL, GetParent());
file.DoModal();

CString filep=file.GetPathName();
BSTR filepath;
TCHAR szStringRepresentation[200];
wsprintf ( szStringRepresentation, _T("%s"), filep );
filepath=_bstr_t(szStringRepresentation) ;


CClientDC cdc(this);
CPen penStroke(PS_SOLID, 1, RGB(0,0,0));

cdc.SelectObject(&penStroke);

parse pa;

DISPPARAMS var=pa.readFile(filepath);

DISPPARAMS *params;
params=&var;
VARIANT myVars[2];
VariantInit(&myVars [0]);
myVars[0].vt=VT_ARRAY|VT_I4;
myVars[0]=params->rgvarg[0];
VariantInit(&myVars [1]);
myVars[1].vt=VT_ARRAY|VT_I4;
myVars[1]=params->rgvarg[1];
SAFEARRAY* SXArray;
SAFEARRAY* SYArray;
SXArray=myVars[0].parray;
SYArray=myVars[1].parray;
long lxbound,lybound;
long uxbound,uybound;
SafeArrayGetLBound(SXArray,1,&lxbound);
SafeArrayGetUBound(SXArray,1,&uxbound);
SafeArrayGetLBound(SYArray,1,&lybound);
SafeArrayGetUBound(SYArray,1,&uybound);

VARIANT ptVar;
VariantInit(&ptVar);
ptVar.vt=VT_BSTR;

int i,j,k,l;
for(long p=lxbound;p<=uxbound;p++)
{
SafeArrayGetElement(SXArray,&p,(&ptVar.bstrVal));
i=strtol(_bstr_t(ptVar.bstrVal),NULL,10);
SafeArrayGetElement(SYArray,&p,(&ptVar.bstrVal));
k=strtol(_bstr_t(ptVar.bstrVal),NULL,10);
p++;
SafeArrayGetElement(SXArray,&p,(&ptVar.bstrVal));

j=strtol(_bstr_t(ptVar.bstrVal),NULL,10);
SafeArrayGetElement(SYArray,&p,(&ptVar.bstrVal));
l=strtol(_bstr_t(ptVar.bstrVal),NULL,10);

cdc.MoveTo(i,k);
cdc.LineTo(j,l);
}

}
I did in view but how can I read file in document and draw the lines in view?

bhikshapathi_g@semanticspace.com
GeneralRe: how can i handle file commands to read and write xml files Pin
Tomasz Sowinski22-Jun-01 1:50
Tomasz Sowinski22-Jun-01 1:50 
QuestionHow can I send a key combination (for example Ctrl+F2) to any window? Pin
20-Jun-01 20:03
suss20-Jun-01 20:03 
AnswerRe: How can I send a key combination (for example Ctrl+F2) to any window? Pin
Amit Jain21-Jun-01 4:35
Amit Jain21-Jun-01 4:35 
GeneralPrint preview Pin
20-Jun-01 18:38
suss20-Jun-01 18:38 
GeneralRe: Print preview Pin
Christian Graus20-Jun-01 18:54
protectorChristian Graus20-Jun-01 18:54 
GeneralRe: Print preview Pin
20-Jun-01 20:32
suss20-Jun-01 20:32 
GeneralRe: Print preview Pin
Christian Graus20-Jun-01 22:26
protectorChristian Graus20-Jun-01 22:26 
General'GetUserName' failure Pin
Todd Shipp20-Jun-01 17:28
Todd Shipp20-Jun-01 17:28 
GeneralRe: 'GetUserName' failure Pin
Christian Graus20-Jun-01 18:57
protectorChristian Graus20-Jun-01 18:57 
GeneralRe: 'GetUserName' failure Pin
markkuk20-Jun-01 19:31
markkuk20-Jun-01 19:31 
GeneralRe: 'GetUserName' failure Pin
Orbital^20-Jun-01 22:39
Orbital^20-Jun-01 22:39 
GeneralRe: 'GetUserName' failure Pin
Todd Shipp21-Jun-01 4:23
Todd Shipp21-Jun-01 4:23 
GeneralRe: 'GetUserName' failure Pin
21-Jun-01 5:29
suss21-Jun-01 5:29 
QuestionPanel in C++?? Pin
Farah Mansor20-Jun-01 16:45
Farah Mansor20-Jun-01 16:45 
AnswerRe: Panel in C++?? Pin
20-Jun-01 17:01
suss20-Jun-01 17:01 
GeneralSimple CMainFrame App problem Pin
John Treubig20-Jun-01 16:42
John Treubig20-Jun-01 16:42 
GeneralWindows explorer command line Pin
Avneesh Bhatnagar20-Jun-01 16:18
Avneesh Bhatnagar20-Jun-01 16:18 

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.