|
Hi,
Make "myfile" global. then in your 123.cpp file declare it as extern.
like
extern ofstream myfile;
thanks,
Nitheesh
|
|
|
|
|
pl_kode wrote: ofstream myfile;
myfile.open (path.c_str(), fstream::app);
you could take help of singleton pattern, you could write all of your code writing data into the file in singleton class, then call teh object of singleton anywhere from program.
http://www.codeproject.com/KB/cpp/singletonrvs.aspx[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
<br />
<br />
BOOL dlgWait::OnInitDialog(void) <br />
{ <br />
CDialog::OnInitDialog(); <br />
<br />
SetTimer(1,500, NULL); <br />
<br />
return TRUE; <br />
} <br />
<br />
void dlgWait::OnTimer(UINT_PTR nIDEvent) <br />
{ <br />
AfxMessageBox("aaaa"); <br />
CDialog::OnTimer(nIDEvent); <br />
} <br />
<br />
dlgWait waitDlg; <br />
waitDlg.Create(IDD_DLG_WAIT,NULL); <br />
waitDlg.ShowWindow(SW_SHOW);
Sleep(10000); <br />
<br />
<br />
<br />
|
|
|
|
|
The problem is because of the Sleep(10000). By doing that, you prevent window messages to be processed, thus your timer message will only be processed after the sleep.
|
|
|
|
|
hanlei0000000009 wrote: waitDlg.ShowWindow(SW_SHOW); // AfxMessageBox("aaaa"); would't display
Sleep(10000);
Sleep (10000); will block message pumping.
|
|
|
|
|
hanlei0000000009 wrote: Sleep(10000);
anyways why you require sleep(10000) here!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hi
I am using this structure and getting the MailPath and Attachment name
/////////////////////////////////////////////////////////////
struct loginInfo
{
ACL_STATUS status;
ACL_STRUCT_INFO *ACL_INFO;
ACL_STRUCT_MBUSERS_MAIL *ACL_STMAIL;
ACL_STRUCT_MBUSERS *ACL_MBUSERS;
// ACL_STRUCT_MBUSERS_INFO ACL_MBUSER_INFO;
};
loginInfo *linfo = (loginInfo*)dummy;
linfo->ACL_INFO=new ACL_STRUCT_INFO;
linfo->ACL_STMAIL=new ACL_STRUCT_MBUSERS_MAIL[MAX_MAIL_COUNT];
linfo->ACL_MBUSERS=new ACL_STRUCT_MBUSERS[MAX_MAILBOX_COUNT];
//////////////////////////////////////////////////////////////////////////
Now i am getting result as
////////////////////////////////////////
printf("Path of the mail is %s\n",linfo->ACL_STMAIL[y].cMBUserMailPath);
printf(,"\n%s Attachment Found\n",linfo->ACL_STMAIL[y].cMBUserMailAttachFile);
///////////////////////////////////////////
OutPut is
///////////////////////
linfo->ACL_STMAIL[y].cMBUserMailPath = "http://test/sharan/inbox/wel.xml"
linfo->ACL_STMAIL[y].cMBUserMailAttachFile)=#Sample.jpg#TSXGMP850_EN_V10.pdf
/////////////////////////////
Requuirement
///////////////////
First i want to get the "#" sign from attachments separate the attachment file
1)Sample.jpg
2)TSXGMP850_EN_V10.pdf
////////////////////
I hope u understood me ..plz help me
thank you
sharan
Hi,,
I am sharan.Working as a software Engineer in Indo-Fuji Software Company located in BTM Layout.Bangalore.India.
I have Completed my B.E(COmputers)in 2006.ANd I am having 2 years of Exp in VC++.
thanking you
sharan
|
|
|
|
|
I prefer tokenize API with delimiter '#' like CString::Tokenize, strtok
|
|
|
|
|
If you're using a plain C approach, then have a look at strtok [^] function.
If you need a more sophisticated tool for parsing strings, consider the Boost.Regex [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi..
I am having
My code
///////////////////////////////
CString MailPath,strMailPath,Attachment;
MailPath = linfo->ACL_STMAIL[y].cMBUserMailPath;
fprintf(stderr,"\nPath of the mail is %s\n",MailPath);
Attachment = linfo->ACL_STMAIL[y].cMBUserMailAttachFile;
fprintf(stderr,"\n%s Attachment Found\n",Attachment);
getchar();
strMailPath = Attachment.Right(MailPath.Find("#"));
printf("new %s attachment",strMailPath);
getchar();
//////////////////////////////////////
See actually Attachment has
#Sample.jpg#TSXGMP850_EN_V10.pdf
I want to separate sample.jpz in one string
and TSXGMP850_EN_V10.pdf in another string..
i am trying the above code.
plz help me
sharan
Hi,,
I am sharan.Working as a software Engineer in Indo-Fuji Software Company located in BTM Layout.Bangalore.India.
I have Completed my B.E(COmputers)in 2006.ANd I am having 2 years of Exp in VC++.
thanking you
sharan
|
|
|
|
|
sharanu wrote: Hi,,
I am sharan.Working as a software Engineer in Indo-Fuji Software Company located in BTM Layout.Bangalore.India.
I have Completed my B.E(COmputers)in 2006.ANd I am having 2 years of Exp in VC++.
thanking you
sharan
are you looking for job ???
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Some months before i asked him to move those to the profile page if required.
|
|
|
|
|
Rajkumar R wrote: Some months before i asked him to move those to the profile page if required.
what about job site !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
|
he he he .. right you say! i feel anonyed sometime.. there is lot of scope for vc++ programmer in india.. but we never find the right job to do!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
no no dude, i mean i feel irritated when he degrades s/w Engg. (2+ years exp ) in india with his dumb posts.
|
|
|
|
|
It looks like an own goal.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
own goal to get job , so it will my goal also
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
For instance you can do:
CString s = "#Sample.jpg#TSXGMP850_EN_V10.pdf";
CString szAttachment[10];
int iAttachment = 0;
int iStart;
int iEnd;
for ( iStart = 1, iEnd = 0; iEnd != -1; )
{
iEnd = s.Find("#", iStart);
if ( iEnd != -1 )
{
szAttachment[iAttachment] = s.Mid(iStart, iEnd-iStart);
iStart = iEnd + 1;
}
else
{
szAttachment[iAttachment] = s.Mid(iStart);
}
}
Please note that above code is (intentionally, for concision purposes) not robust.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You've made it appear far more complex than it actually should be. Is that intentional?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Nope. I didn't know about esoteric ReverseFind and it is a bit more general than yours.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: esoteric
Is that the word?
I saw yours was a more general approach, but then I chose to leave the generalisation part to the OP.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: I chose to leave the generalisation part to the OP.
I think a simple Software Engineer can't be expected to be able to.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: I think a simple Software Engineer can't be expected to be able to. [Big Grin]
You know, he has 2+ years of experience in VC++.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hi..
Thank you its working fine..
now i want to append that attachment file to mail path...
Example my mail Path is
"https://testsrv1.ifit.com/Exchange/Administrator/Inbox">https://testsrv1.ifit.com/Exchange/Administrator/Inbox /ss.jpg"
I need to appen after Inbox/
first attachment file
example
"https://testsrv1.ifit.com/Exchange/Administrator/Inbox">https://testsrv1.ifit.com/Exchange/Administrator/Inbox/sample.jpg"...
Hi,,
I am sharan.Working as a software Engineer in Indo-Fuji Software Company located in BTM Layout.Bangalore.India.
I have Completed my B.E(COmputers)in 2006.ANd I am having 2 years of Exp in VC++.
thanking you
sharan
|
|
|
|