Home > Software engineering >  MFC, connecting word problems
MFC, connecting word problems

Time:11-07

Use vc + +, MFC, CTR + w class wizard to add msword. After the olb (all the classes are imported),
Always prompt
: the error C2011: 'Fields' :' struct type redefinition
: the error C2011: 'Field' : 'struct type redefinition
.

My MFC mfc_word name, called word class dialog box is for DialogReport,

According to the online call word steps, I do a simple small program, there are no errors,,, but moved to their own MFC synchronization, always prompt error,,,,,,,
Excuse me:
1, how to solve, no matter the msword. H is added to the mfc_worddlg. H or DialogReport. J h, all have this problem, how do I solve??
Search to redefine the problem and give suggestion is # # ifndef, but with bad
2, the problem, something to do with my DialogReport CPP # include "h", the zha get?
thank you

CodePudding user response:

Word derived class header file # pragma once with this sentence

CodePudding user response:

Behind this error message should not prompt, xyz file defines the * * *, and then xyz file defines the * * *, and see where is defined, and then analysis and problem analysis to see where,

CodePudding user response:

reference 1st floor Xu Wenjun response:
word derived class header file # pragma once add the

Directly in msword. Add the h # pragma useless ah, I kind of wizard, add a msword all class, has been an error, all kinds of repeat definition,,,

CodePudding user response:

refer to the second floor of tiny ants reply:
shouldn't behind this error message prompt, xyz file defines the * * *, and then xyz file defines the * * *, and see where is defined, and then analysis and problem analysis to see where,

Is word class definition of yourself, I don't add code

CodePudding user response:

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


refer to the second floor of tiny ants reply:
shouldn't behind this error message prompt, xyz file defines the * * *, and then xyz file defines the * * *, and see where is defined, and then analysis and problem analysis to see where,


reference 1st floor Xu Wenjun response:
word derived class header file # pragma once add the

CodePudding user response:

3534 lines repeated defines Fields, remove this,

CodePudding user response:

4534 repeated defines the Fields to delete this line