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

C / C++ / MFC

 
QuestionDraw two monitors syncron Pin
_Flaviu10-Apr-14 22:11
_Flaviu10-Apr-14 22:11 
AnswerRe: Draw two monitors syncron Pin
Richard MacCutchan10-Apr-14 22:41
mveRichard MacCutchan10-Apr-14 22:41 
AnswerRe: Draw two monitors syncron Pin
pasztorpisti11-Apr-14 6:17
pasztorpisti11-Apr-14 6:17 
GeneralRe: Draw two monitors syncron Pin
_Flaviu13-Apr-14 22:23
_Flaviu13-Apr-14 22:23 
Question[MFC Desktop Application for enumerating Virtual customized folder and files] Windows 8 Address Bar icon problem Pin
Nirmal K P10-Apr-14 19:39
Nirmal K P10-Apr-14 19:39 
QuestionUse PlaySound api caused memory loading? Pin
cedricvictor10-Apr-14 16:02
cedricvictor10-Apr-14 16:02 
AnswerRe: Use PlaySound api caused memory loading? Pin
Richard Andrew x6410-Apr-14 17:19
professionalRichard Andrew x6410-Apr-14 17:19 
QuestionMS Word Automation - I get so far - now what? Pin
Bryan Anslow10-Apr-14 9:43
Bryan Anslow10-Apr-14 9:43 
Hi,
I am trying to rewrite an old VC++ wrapper class around MS Word Automation - it used to use *.tli and *.tlh files, but now MS recommends just using the *.h files which get generated. So, that is another level of complexity.

So, I got so far, now I am wondering what to do next.

Here are some code snips, the real code obviously has error correction etc., so here is what I have so far;

IDispatch       *pWordInst;
CApplication    *pWordApp;
CDocument0      *pDoc;
IUnknown        *pUnknown;


  HRESULT res = CoInitialize(NULL);

  CLSID clsid;
  HRESULT hr = CLSIDFromProgID(L"Word.Application", &clsid);

  hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&pWordInst);

  pUnknown = NULL;
  REFIID iid2 = __uuidof(IUnknown);

  hr = pWordInst->QueryInterface(iid2, (void **)&pUnknown);

So, now I need to get the Application and Document objects (assuming that this code creates a new document as it used to).

I am guessing I need a getApplication() but what MS class do I use for that?

Once I have the Application, then I can get the Document, presumably with a get_Documents() or get_ActiveDocument()?.

After that I guess it will run like my older version used to.

Any help and advice would be great.

Many Thanks,

Bryan.
AnswerRe: MS Word Automation - I get so far - now what? Pin
Richard MacCutchan10-Apr-14 22:39
mveRichard MacCutchan10-Apr-14 22:39 
SuggestionRe: MS Word Automation - I get so far - now what? Pin
David Crow11-Apr-14 4:40
David Crow11-Apr-14 4:40 
QuestionList And iterator Pin
Hamza Bin Amin10-Apr-14 2:49
Hamza Bin Amin10-Apr-14 2:49 
AnswerRe: List And iterator Pin
Maximilien10-Apr-14 10:21
Maximilien10-Apr-14 10:21 
SuggestionRe: List And iterator Pin
David Crow10-Apr-14 15:49
David Crow10-Apr-14 15:49 
Questionavoiding or skipping Divide by zero showing junk values Pin
manoharbalu10-Apr-14 0:50
manoharbalu10-Apr-14 0:50 
AnswerRe: avoiding or skipping Divide by zero crashes Pin
Heng Xiangzhong10-Apr-14 1:00
Heng Xiangzhong10-Apr-14 1:00 
AnswerRe: avoiding or skipping Divide by zero crashes Pin
Heng Xiangzhong10-Apr-14 1:01
Heng Xiangzhong10-Apr-14 1:01 
GeneralRe: avoiding or skipping Divide by zero crashes Pin
manoharbalu10-Apr-14 1:51
manoharbalu10-Apr-14 1:51 
GeneralRe: e: avoiding or skipping Divide by zero crashes Pin
Richard MacCutchan10-Apr-14 2:22
mveRichard MacCutchan10-Apr-14 2:22 
AnswerRe: avoiding or skipping Divide by zero showing junk values Pin
Munchies_Matt10-Apr-14 5:53
Munchies_Matt10-Apr-14 5:53 
AnswerRe: avoiding or skipping Divide by zero showing junk values Pin
User 5924111-Apr-14 19:07
User 5924111-Apr-14 19:07 
QuestionCDHtmlDialog: Changing HTML File Dynamically Pin
Don Guy9-Apr-14 11:31
Don Guy9-Apr-14 11:31 
QuestionSetWindowText() style question Pin
econy9-Apr-14 4:24
econy9-Apr-14 4:24 
AnswerRe: SetWindowText() style question Pin
jeron19-Apr-14 5:06
jeron19-Apr-14 5:06 
AnswerRe: SetWindowText() style question Pin
Maximilien9-Apr-14 8:30
Maximilien9-Apr-14 8:30 
GeneralRe: SetWindowText() style question Pin
econy9-Apr-14 10:11
econy9-Apr-14 10:11 

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.