CEdit in COM
-
Hi I'm creating COM addin for MS Word. I would like to create Option Window for my application, so I used template class CAxDialogImpl(sugested on this message board) class CDial : public CAxDialogImpl I would also like to set(insert) some properties from Edit Box. From MFC I found that Edit Box is attached to CEdit class and value can be read into CString class. Unfortunately when I include CEdit class (or CString) in my declaration of CDial class I get next error: error C2146: syntax error : missing ';' before identifier 'm_edi' error C2501: 'CEdit' : missing storage-class or type specifiers error C2501: 'm_edi' : missing storage-class or type specifiers so I added: #include but then I get VC98\MFC\INCLUDE\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include I tried also with settings->General: Use MFC in shared dll but no success. Please help Tomaz Rotovnik
-
Hi I'm creating COM addin for MS Word. I would like to create Option Window for my application, so I used template class CAxDialogImpl(sugested on this message board) class CDial : public CAxDialogImpl I would also like to set(insert) some properties from Edit Box. From MFC I found that Edit Box is attached to CEdit class and value can be read into CString class. Unfortunately when I include CEdit class (or CString) in my declaration of CDial class I get next error: error C2146: syntax error : missing ';' before identifier 'm_edi' error C2501: 'CEdit' : missing storage-class or type specifiers error C2501: 'm_edi' : missing storage-class or type specifiers so I added: #include but then I get VC98\MFC\INCLUDE\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include I tried also with settings->General: Use MFC in shared dll but no success. Please help Tomaz Rotovnik
Hi again I move #include in file StdAfx.h but now I get linking error link: executing 'C:\PROGRA~1\MICROS~4\VC98\Bin\link.exe' nafxcw.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in RecToR.obj nafxcw.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in RecToR.obj; second definition ignored Creating library ReleaseMinDependency/RecToR.lib and object ReleaseMinDependency/RecToR.exp ReleaseMinDependency/RecToR.dll : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. How can I solve that? Tomaz Rotovnik
-
Hi I'm creating COM addin for MS Word. I would like to create Option Window for my application, so I used template class CAxDialogImpl(sugested on this message board) class CDial : public CAxDialogImpl I would also like to set(insert) some properties from Edit Box. From MFC I found that Edit Box is attached to CEdit class and value can be read into CString class. Unfortunately when I include CEdit class (or CString) in my declaration of CDial class I get next error: error C2146: syntax error : missing ';' before identifier 'm_edi' error C2501: 'CEdit' : missing storage-class or type specifiers error C2501: 'm_edi' : missing storage-class or type specifiers so I added: #include but then I get VC98\MFC\INCLUDE\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include I tried also with settings->General: Use MFC in shared dll but no success. Please help Tomaz Rotovnik
I think I found the problem. I write down steps for those who will have the same problem 1. Because dll which I build is Extension DLL I shouldn't have definition _USRDLL in preprocessor definitions 2. I include CEdit, CString classes which need afxwin.h header so I put #include as first include statement in StdAfx.h header file before all other #include statements. (solved C1189 error) 3. I think CDialog class is MFC so I also set option: Use MFC in a Shared Dll Tomaz Rotovnik