Click here to Skip to main content
15,888,330 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: if is someone who can help me? PLEASE !!!!!!!!! PLZ!!!!!! Pin
Parthi_Appu3-Aug-06 2:47
Parthi_Appu3-Aug-06 2:47 
AnswerRe: if is someone who can help me? PLEASE !!!!!!!!! PLZ!!!!!! Pin
Hamid_RT3-Aug-06 0:34
Hamid_RT3-Aug-06 0:34 
QuestionScrollBar of CWnd Pin
includeh102-Aug-06 22:54
includeh102-Aug-06 22:54 
AnswerRe: ScrollBar of CWnd Pin
Naveen2-Aug-06 23:20
Naveen2-Aug-06 23:20 
AnswerRe: ScrollBar of CWnd Pin
Viorel.2-Aug-06 23:21
Viorel.2-Aug-06 23:21 
QuestionI NEEEED HEEELLLPPP !!!!!!!!! Pin
Bravoone_20062-Aug-06 22:53
Bravoone_20062-Aug-06 22:53 
AnswerRe: I NEEEED HEEELLLPPP !!!!!!!!! Pin
includeh102-Aug-06 22:59
includeh102-Aug-06 22:59 
QuestionProblems in Opening and Saving file After Automating MSWord in VC++ Pin
georgekjolly2-Aug-06 22:46
georgekjolly2-Aug-06 22:46 
Hi all,

I have successfully automated MSWord in VC++, I hve tried to open a doc file and save it as a txt. But while executing saveAs statement , it is encountering an Unhandled Exception(Run time Error)

My Code is

if(!AfxOleInit()) // Your addition starts here
{
AfxMessageBox("Could not initialize COM dll");
return FALSE;
}
else
{
AfxMessageBox("Inint");
}

_Application app; // app is the Excel _Application object



if(!app.CreateDispatch("Word.Application"))
{
AfxMessageBox("Couldn't start Excel.");
}
else
{
//Make Excel Visible and display a message
app.SetVisible(TRUE);
AfxMessageBox ("Word is Running!");
}

//COleVariant covTrue(true),covFalse(false),covOptional(NULL);


COleVariant
covTrue((short)TRUE), covFalse((short)FALSE), covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR), covFormat( short(7));


Documents docs;
_Document oDoc;

oDoc.AttachDispatch( // opening file
(docs.Open(COleVariant("D:\\george\\geo.doc"),
covTrue, // Confirm Conversion.
covFalse, // ReadOnly.
covFalse, // AddToRecentFiles.
covOptional, // PasswordDocument.
covOptional, // PasswordTemplate.
covFalse, // Revert.
covOptional, // WritePasswordDocument.
covOptional, // WritePasswordTemplate.
covTrue,
covTrue,
covOptional,
covOptional,
covOptional,
covOptional
)),

FALSE);

//saving to txt format
//Problem comes from here

oDoc.SaveAs(COleVariant("D:\\george\\win.txt"),
covFormat,covOptional,covOptional,
covOptional,covOptional,covFalse,
covOptional,covFalse,covTrue,
covTrue,covTrue,covTrue,covTrue,
covTrue,covTrue);
//Can Anyone tell what alteration should I make to run my programme without error

Please Help me
Thanks in Advance
George K Jolly
AnswerRe: Problems in Opening and Saving file After Automating MSWord in VC++ Pin
Viorel.2-Aug-06 23:14
Viorel.2-Aug-06 23:14 
GeneralWorking Perfectly Pin
georgekjolly2-Aug-06 23:43
georgekjolly2-Aug-06 23:43 
QuestionCreate Bitmap from CMemFile??? Pin
majco3332-Aug-06 22:44
majco3332-Aug-06 22:44 
AnswerRe: Create Bitmap from CMemFile??? Pin
Hamid_RT3-Aug-06 7:19
Hamid_RT3-Aug-06 7:19 
Questionhosts file parser or winapi function? Pin
hunter132-Aug-06 22:39
hunter132-Aug-06 22:39 
GeneralC++ vtable Pin
Sarath C2-Aug-06 22:33
Sarath C2-Aug-06 22:33 
GeneralRe: C++ vtable Pin
Hamid_RT2-Aug-06 22:49
Hamid_RT2-Aug-06 22:49 
GeneralRe: C++ vtable Pin
Sarath C2-Aug-06 22:51
Sarath C2-Aug-06 22:51 
QuestionHow to track scroll event in IE? Pin
Hemant kulkarni2-Aug-06 22:24
Hemant kulkarni2-Aug-06 22:24 
AnswerRe: How to track scroll event in IE? Pin
Naveen3-Aug-06 0:24
Naveen3-Aug-06 0:24 
AnswerRe: How to track scroll event in IE? Pin
Hamid_RT3-Aug-06 7:14
Hamid_RT3-Aug-06 7:14 
QuestionProblem in Rich Text box using VC++ Pin
maniram2-Aug-06 22:15
maniram2-Aug-06 22:15 
AnswerRe: Problem in Rich Text box using VC++ Pin
Manfred Staiger2-Aug-06 22:58
Manfred Staiger2-Aug-06 22:58 
AnswerRe: Problem in Rich Text box using VC++ Pin
Hamid_RT3-Aug-06 7:40
Hamid_RT3-Aug-06 7:40 
QuestionProcess Return Code Pin
Daniel Kanev2-Aug-06 22:04
Daniel Kanev2-Aug-06 22:04 
AnswerRe: Process Return Code Pin
Viorel.2-Aug-06 22:11
Viorel.2-Aug-06 22:11 
AnswerRe: Process Return Code Pin
Naveen2-Aug-06 22:13
Naveen2-Aug-06 22:13 

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.