Home > Software engineering >  MFC project called word for mswod. H
MFC project called word for mswod. H

Time:11-12

According to post operation steps, did a test using MFC, add msword. The olb all classes, code, and so on, implements the dialog box to bring up the word, the word form,
Problem is, according to the steps, add all the classes in msword to himself involved in software, is a problem, (all files from the class wizard to add the msword. Olb, has prompted msword. H. (3534) : error C2011: 'Fields' :' struct type redefinition of repeated definition problem)

Excuse me: 1, how should solve?
2, looked at it and all. H have similar

# if! Defined (AFX_INFOPERFECT_H__4748C2CA_DD73_49F2_A483_83F9F4E2279B__INCLUDED_)
# define AFX_INFOPERFECT_H__4748C2CA_DD73_49F2_A483_83F9F4E2279B__INCLUDED_

# if _MSC_VER & gt; 1000
# pragma once
# endif//_MSC_VER & gt; 1000
//InfoPerfect. H: the header file


Such as code, and only msword. H: no, if you need in msword. H joined the front, or change something? Thank you

CodePudding user response:

That is what you have defined elsewhere the name Fields (such as also imported the ADO)

Import can use rename or namespace keyword to avoid name collisions

For example,
# import "C: \ Program Files \ Microsoft Office \ OFFICE11 \ MSWORD OLB" rename (" Fields ", "WORDFields") rename (" Field ", "WORDField")

Or
# import "C: \ Program Files \ Common Files \ Microsoft Shared \ VBA \ VBE6EXT OLB" rename_namespace (" VBE6 ")
  • Related