none
Shim compile problems RRS feed

Answers

All replies

  • Hi David,

    Thank you for posting in the MSDN Forum.

    I'll consult my colleague on your issue. You'll be informed if there's any update.

    Thank you for your patience and understanding.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 15, 2013 7:26 AM
    Moderator
  • Hi Dave,

    What is the complete, exact text of the compile error you are getting?

    Does this Visual Studio project contain references (or other links) to Office?
    If so, what applications/objects are you connecting to?

    Assuming for the moment that the error message will point to a specific line of code, what is the code that is failing?

    Do you have this same issue if you build a new project in Visual Studio?

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    --------------------------------------------------------------------------------
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, April 16, 2013 1:57 PM
  • And now it's compiling ok (nothing changed). When it happens again I'll post the full dump here.

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Tuesday, April 16, 2013 5:34 PM
  • Got the error again. Here is the full output:

    1>------ Build started: Project: AutoTagShim64, Configuration: Debug x64 ------
    2>------ Build started: Project: AutoTagShim32, Configuration: Debug Win32 ------
    1>  ConnectProxy.cpp
    2>  ConnectProxy.cpp
    1>c:\src\jenova\11.1\merge\autotag\autotagshim64\ConnectProxy.h(23): error C2440: 'static_cast' : cannot convert from 'CConnectProxy::_ComMapClass *' to 'AddInDesignerObjects::IDTExtensibility2 *'
    1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    2>c:\src\jenova\11.1\merge\autotag\autotagshim32\connectproxy.h(23): error C2440: 'static_cast' : cannot convert from 'CConnectProxy::_ComMapClass *' to 'AddInDesignerObjects::IDTExtensibility2 *'
    2>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    2>c:\src\jenova\11.1\merge\autotag\autotagshim32\connectproxy.h(23): error C2440: 'initializing' : cannot convert from 'ATL::_ATL_CREATORARGFUNC (__stdcall *)' to 'DWORD_PTR'
    2>          There is no context in which this conversion is possible
    2>c:\src\jenova\11.1\merge\autotag\autotagshim32\connectproxy.cpp(161): error C2227: left of '->OnConnection' must point to class/struct/union/generic type
    2>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    2>c:\src\jenova\11.1\merge\autotag\autotagshim32\connectproxy.cpp(169): error C2227: left of '->OnAddInsUpdate' must point to class/struct/union/generic type
    2>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    2>c:\src\jenova\11.1\merge\autotag\autotagshim32\connectproxy.cpp(174): error C2227: left of '->OnStartupComplete' must point to class/struct/union/generic type
    2>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    2>c:\src\jenova\11.1\merge\autotag\autotagshim32\connectproxy.cpp(186): error C2227: left of '->OnBeginShutdown' must point to class/struct/union/generic type
    2>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    2>c:\src\jenova\11.1\merge\autotag\autotagshim32\connectproxy.cpp(202): error C2227: left of '->OnDisconnection' must point to class/struct/union/generic type
    2>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    2>c:\src\jenova\11.1\merge\autotag\autotagshim32\connectproxy.cpp(205): error C2227: left of '->Release' must point to class/struct/union/generic type
    2>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    1>c:\src\jenova\11.1\merge\autotag\autotagshim64\ConnectProxy.h(23): error C2440: 'initializing' : cannot convert from 'ATL::_ATL_CREATORARGFUNC (__cdecl *)' to 'DWORD_PTR'
    1>          There is no context in which this conversion is possible
    1>ConnectProxy.cpp(161): error C2227: left of '->OnConnection' must point to class/struct/union/generic type
    1>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    1>ConnectProxy.cpp(169): error C2227: left of '->OnAddInsUpdate' must point to class/struct/union/generic type
    1>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    1>ConnectProxy.cpp(174): error C2227: left of '->OnStartupComplete' must point to class/struct/union/generic type
    1>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    1>ConnectProxy.cpp(186): error C2227: left of '->OnBeginShutdown' must point to class/struct/union/generic type
    1>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    1>ConnectProxy.cpp(202): error C2227: left of '->OnDisconnection' must point to class/struct/union/generic type
    1>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    1>ConnectProxy.cpp(205): error C2227: left of '->Release' must point to class/struct/union/generic type
    1>          type is 'AddInDesignerObjects::IDTExtensibility2 *'
    
    

    Any ideas?

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Wednesday, April 17, 2013 6:09 PM
  • Hi Dave,

    I noticed at the top of the output that there two different configurations listed (Debug x64 and Debug Win32).
    Without seeing the code, it also seems that all of the errors may be related to a cast/type conversion error on line 23 of the ConnectProxy.h file.

    Based on this, my first suggestion would be to explicitly compile the project for either 32-bit or 64-bit and see if that provides more consistence to the issue.

    Assuming this is shared code (based on your comment "A couple of us are getting the following compile errors since installing Office 2013") it may be that some related component is being updated on one machine for a specific version or bit-level of Office and that is causing a problem on other machines. To test this, I would suggest that consistently use "Build \ Rebuild Solution" when compiling.

    Do you have multiple versions of Office installed on your machine?

    Is this "shared" code that is edited/compiled on multiple machines?
    If so, does everyone have the same version of Office on the machine?

    When you compile the project do you do "Build \ Build Solution" or "Build \ Rebuild Solution"?

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    --------------------------------------------------------------------------------
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, April 18, 2013 2:34 PM
  • And of course now everything is compiling fine (not that I'm complaining!!!) Let me answer what I can.

    There are 2 shims, one for 32-bit and one for 64-bit Office. They have completely separate code bases (although most of the code is identical). One is compiled at x64 and one Win32.

    We're not having a problem running this code - we don't run it on our dev systems. We're just having a problem compiling it.

    We do not have multiple versions of Office installed. But in all cases we did upgrade from 2010 to 2013. No one here has a clean 2013 install on their dev system. This is only occurring on systems where we've upgraded to 2013 - but only some of us and only some of the time.

    Next time it happens I'll try \ Clean and then \Rebuild and see if that resolves it.

    Also, one thing that might play into this. We are bouncing between 3 versions of our code. So we're compiling different versions. The only difference is a version number in the code.

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Thursday, April 18, 2013 6:11 PM
  • Hi Dave

    Do you see the issue in both the 32-bit and 64-bit projects or just one?

    Because you are "bouncing between 3 versions of our code" I suspect that the compiler is just getting confused on what needs to be compiled.

    I would check with the users that are not getting the issue to see if they are doing "Build \ Build Solution" or "Build \ Rebuild Solution".

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    --------------------------------------------------------------------------------
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Friday, April 19, 2013 1:41 PM
  • Hi;

    If you look at the console output you'll see "1>" and "2>" - that's because VisualStudio will run multiple compiles at once and so it is compiling both the 32-bit and 64-bit shim at the same time.

    The 3 versions of our code are in 3 different solutions (not projects, solutions) so VisualStudio should only see the pair in the solution it has open.

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Friday, April 19, 2013 2:54 PM
  • Hi Dave,

    At this I don't have any guesses at why you are getting this intermittent issue.

    That being said, as a test, the next time you see the issue (assuming "Build \ Rebuild Solution" does not resolve it) try compiling just 32-bit or just 64-bit and see that is successful.
    Also, keep track of the failures to see if the 32-bit or 64-bit compile consistently fails.

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    --------------------------------------------------------------------------------
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Monday, April 22, 2013 3:55 PM
  • Hi;

    I'm getting it again. Was building fine for a month, then suddenly one build today, it started happening again. And builds earlier today were fine. And I made no changes on my system today - all I've been doing is writing code, compiling, and running.

    I tried a rebuild all on the solution and a rebuild on just 1 shim. Below is the error for the 32-bit shim. Any idea what I can do to fix this?

    thanks - dave

    Error	42	error C2440: 'static_cast' : cannot convert from 'CConnectProxy::_ComMapClass *' to 'AddInDesignerObjects::IDTExtensibility2 *'	c:\src\jenova\12.0\merge\autotag\autotagshim32\connectproxy.h	23	1	AutoTagShim32
    Error	43	error C2440: 'initializing' : cannot convert from 'ATL::_ATL_CREATORARGFUNC (__stdcall *)' to 'DWORD_PTR'	c:\src\jenova\12.0\merge\autotag\autotagshim32\connectproxy.h	23	1	AutoTagShim32
    Error	44	error C2227: left of '->OnConnection' must point to class/struct/union/generic type	c:\src\jenova\12.0\merge\autotag\autotagshim32\connectproxy.cpp	167	1	AutoTagShim32
    Error	45	error C2227: left of '->OnAddInsUpdate' must point to class/struct/union/generic type	c:\src\jenova\12.0\merge\autotag\autotagshim32\connectproxy.cpp	175	1	AutoTagShim32
    Error	46	error C2227: left of '->OnStartupComplete' must point to class/struct/union/generic type	c:\src\jenova\12.0\merge\autotag\autotagshim32\connectproxy.cpp	180	1	AutoTagShim32
    Error	47	error C2227: left of '->OnBeginShutdown' must point to class/struct/union/generic type	c:\src\jenova\12.0\merge\autotag\autotagshim32\connectproxy.cpp	192	1	AutoTagShim32
    Error	48	error C2227: left of '->OnDisconnection' must point to class/struct/union/generic type	c:\src\jenova\12.0\merge\autotag\autotagshim32\connectproxy.cpp	208	1	AutoTagShim32
    Error	49	error C2227: left of '->Release' must point to class/struct/union/generic type	c:\src\jenova\12.0\merge\autotag\autotagshim32\connectproxy.cpp	211	1	AutoTagShim32
    


    Who will win The Windward International Collegiate Programming Championships?

    Wednesday, May 22, 2013 10:52 PM
  • And the solution is:

    1. Re-register MSADDNDR.DLL using regsvr32 
    2. Exit & re-start VisualStudio

    Who will win The Windward International Collegiate Programming Championships?

    • Marked as answer by DavidThi808 Friday, May 24, 2013 6:30 PM
    Friday, May 24, 2013 6:30 PM
  • Hi.  I ran into the same problem on a build computer that had Office 2013 installed.   Mine had nothing to do with Word.  My issue was with a COM AddIn for MS Project and another for Excel.  In both cases I had been employing the COMShim Wizard  solution published by Andrew Whitechapel and Misha Schneerson and installed as part of Visual Studio 2010.  It was working fine for years until I migrated to the new build computer that had Office 2013 installed.   Even there it worked for a while and then suddenly started giving the same compile errors that Dave reports above.   In my case I traced it back to stdafx.h, which tries get the definition of IDTExtensibility2 as follows:

      // Imports the MSADDNDR.DLL typelib which we need for IDTExtensibility2.
        #import "libid:AC0714F2-3D04-11D1-AE7D-00A0C90F26F4" raw_interfaces_only named_guids

    I found that MSADDNDR.DLL was already installed and registered on my computer and yet I was getting the compile errors.   I went back to a old computer on which the builds were working previously and copied the MSADDNDR.DLL from there.  Then I unregistered and re-registered this DLL using regsvr32.   The version of MSADDNDR.DLL that worked was 6.01.9816 (File version 6.1.98.16).  The version of MSADDNDR.DLL that did not work was 10.0.30319.1 (File Version 6.0.81.0).   Very odd!

    Things now seem to be working, not only in command-line builds but also in ordinary Visual Studio builds.

    Hope this information helps.

    Jim


    ...Jim Black



    • Edited by Jim Black CG Tuesday, May 27, 2014 3:39 PM minor corrections and additions
    Monday, May 26, 2014 11:47 PM
  • And the solution is:

    1. Re-register MSADDNDR.DLL using regsvr32 
    2. Exit & re-start VisualStudio

    Dave's answer worked for me, but I also had to start Visual Studio and rebuild there once before the IDTExtensibility2 errors would go away on the command line. I even rebooted a few times, and the error lingered. I don't know why it worked this way. Maybe I just needed to clean or maybe VS completed a registrations step.

    Also, just for convenience, here's the regsvr32 command

    regsvr32 %commonprogramfiles(x86)%\DESIGNER\MSADDNDR.DLL


    • Edited by tomasr2 Wednesday, June 17, 2015 10:23 PM
    Wednesday, June 17, 2015 10:22 PM
  • And the solution is:

    1. Re-register MSADDNDR.DLL using regsvr32 
    2. Exit & re-start VisualStudio

    Also, just for convenience, here's the regsvr32 command

    regsvr32 %commonprogramfiles(x86)%\DESIGNER\MSADDNDR.DLL


    More accurately, the command is:

    regsvr32 "%commonprogramfiles(x86)%\DESIGNER\MSADDNDR.DLL"

    Then, in VS, Clean and Rebuild the project.

    Monday, June 22, 2015 8:48 PM
  • Dave's answer worked for me, but I also had to start Visual Studio and rebuild there once before the IDTExtensibility2 errors would go away on the command line. I even rebooted a few times, and the error lingered. I don't know why it worked this way. Maybe I just needed to clean or maybe VS completed a registrations step.

    You have to clean before compiling again. 
    Tuesday, December 29, 2015 1:01 AM