Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. CEdit in COM

CEdit in COM

Scheduled Pinned Locked Moved COM
helpc++comlounge
3 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tomaz Rotovnik
    wrote on last edited by
    #1

    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

    T 2 Replies Last reply
    0
    • T 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

      T Offline
      T Offline
      Tomaz Rotovnik
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • T 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

        T Offline
        T Offline
        Tomaz Rotovnik
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups