MSWORD9 to 11

S

Stevie G

Hi group,
I'm trying to upgrade an old application to work with MS Word 11 and
can't seem to get around the following error (and I suspect related
warnings):

\debug\mso.tlh(11133) : warning C4003: not enough actual parameters
for macro 'GetFirstChild'
\debug\msword.tlh(38330) : warning C4003: not enough actual parameters
for macro 'GetNextSibling'
\debug\msword.tlh(38330) : error C2059: syntax error : ','

I've changed my code to import the new office, word and VB libraries:
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE11\
\MSO.DLL" rename("RGB","MSORGB")
rename("GetFirstChild","MSOGetFirstChild")
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\
\VBE6EXT.OLB"
#import "C:\\Program Files\\Microsoft Office\\Office11\\MSWORD.OLB"
rename("ExitWindows","WordExitWindows")

I also understand that I have to rename some parameters to avoid
conflict. The RGB and ExitWindows renames solve issues but renaming
GetFirstChild and GetNextSibling don't seem to help with the errors.

Has anyone else had these issues or have any help for me?

Thanks in advance, Steve.
 
S

Stevie G

Hi group,
I'm trying to upgrade an old application to work with MS Word 11 and
can't seem to get around the following error (and I suspect related
warnings):

\debug\mso.tlh(11133) : warning C4003: not enough actual parameters
for macro 'GetFirstChild'
\debug\msword.tlh(38330) : warning C4003: not enough actual parameters
for macro 'GetNextSibling'
\debug\msword.tlh(38330) : error C2059: syntax error : ','

I've changed my code to import the new office, word and VB libraries:
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE11\
\MSO.DLL" rename("RGB","MSORGB")
rename("GetFirstChild","MSOGetFirstChild")
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\
\VBE6EXT.OLB"
#import "C:\\Program Files\\Microsoft Office\\Office11\\MSWORD.OLB"
rename("ExitWindows","WordExitWindows")

I also understand that I have to rename some parameters to avoid
conflict. The RGB and ExitWindows renames solve issues but renaming
GetFirstChild and GetNextSibling don't seem to help with the errors.

Has anyone else had these issues or have any help for me?

Thanks in advance, Steve.

----------- Cut down version of my solution I found elsewhere
--------------------

That warning is referring to mso.tlh (MS Office imported type lib),
code I have no control of. I suspect it cannot resolve some ambiguity
between:

Office::DiagramNodeChildren::GetFirstChild
Word::DiagramNodeChildren::GetFirstChild
Word::XMLNode::GetFirstChild
GetFirstChild in include\WindowsX.h
From the list that pops up when I select Go To Definition in VS.
It's only the WindowsX.h that is a macro and I'm pretty sure that's
not the include I need.

....................................
Whhhhhhhhhooohhh
Got it.
I've got an #include "windowsx.h" elsewhere in my code. Something must
have changed with all this office XML backend. When I comment it out
I'm all good.

I've got to work out if this action has done any damage but it does
look like I've got it sorted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top