problem in using namespace Word

H

hamidC++

I used the statement:

#import "C:\Program Files\Microsoft Office\Office11\MSWORD.OLB" \
rename_namespace("MSWord"),named_guids, \
raw_interfaces_only
using namespace MSWord;

to import Word library to my addin, but it came to some compile error in
msword.tlh file
 
H

hamidC++

I understood what was the problem:
I had import mso.dll and MSWORD.OLB with the statements:

#import "C:\Program Files\Common Files\Microsoft
Shared\OFFICE11\MSO.DLL" rename_namespace("Office"),\
named_guids , raw_interfaces_only
using namespace Office;

#import "C:\Program Files\Microsoft Office\Office11\MSWORD.olb"
rename_namespace("MSWORD"), \
rename("ExitWindows","WordExitWindows"),named_guids,
raw_interfaces_only
using namespace MSWORD;
but it came to fatal error LNK1179: invalid or corrupt file: duplicate
comdat "_IID_CanvasShapes"
after some search I found I should remove named_guids from the secound
statement.
It works, but I really don't know why.
 
H

hamidC++

I found what the problem was:
I had import mso.dll and msword.olb using these statements:
#import "C:\Program Files\Common Files\Microsoft
Shared\OFFICE11\MSO.DLL" rename_namespace("Office"),\
named_guids , raw_interfaces_only
using namespace Office;

#import "C:\Program Files\Microsoft Office\Office11\MSWORD.olb"
rename_namespace("MSWORD"), \
rename("ExitWindows","WordExitWindows"),named_guids,
raw_interfaces_only
using namespace MSWORD;
but it came to error:
fatal error LNK1179: invalid or corrupt file: duplicate comdat
"_IID_CanvasShapes"
after some searches I faound that I should remove named_guides from the
second statement. It works, but I really don't know why. Do anyone has
any idea?
 

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