Hi Jeffrey,
Infinite thanks for yet another excellent response.
I followed your instructions and they seem to have solved the compile
problem. So now I've gotten passed the compile stage.
Unfortunately, the link stage has failed with the following errors:
Merging metadata
MainFrm.obj : error LNK2022: metadata operation failed (8013118D) :
Inconsistent layout information in duplicated types (_PROPSHEETPAGEA):
(0x020000f1).
MainFrm.obj : error LNK2022: metadata operation failed (8013118D) :
Inconsistent layout information in duplicated types (_PROPSHEETPAGEW):
(0x020000f4).
MainFrm.obj : error LNK2022: metadata operation failed (8013118D) :
Inconsistent layout information in duplicated types (tagTOOLINFOA):
(0x020001f1).
Finished merging metadata
I am at a complete loss here. I have no idea what to do. I follows the
LNK2022 suggestion and (ildasm -tokens).
I am at a loss as to what to look for in the results of (ildasm -tokens).
These structures (PROPSHEETPAGEA, PROPSHEETPAGEW) are actually single/double
byte #ifdef(s) in Win32 and we don't use them directly. We use
the MFC classes instead, CPropertySheet, CPropertyPage, etc..... I don't
understand why the linker complains about the ansi TOOLINFO and not the wide
one?
Again, we don't user this struct directly we use the MFC class instead.
When errors like this appear, do you have a check list of things to do that
will reveal why the linker complains?
If so may I have that list?
Can you please help with this newest problem?
Thank you,
Phnimx.
> Hi Phnimx,
>
[quoted text clipped - 50 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Jeffrey Tan[MSFT] - 08 Jan 2007 02:35 GMT
Hi Phnimx,
You are welcome.
Based on my research, there may be several causes to this LNK2022 error.
One is caused by using anonymous structures in Managed C++:
"FIX: Error LNK2022: Metadata Operation Failed (8013118D)"
http://support.microsoft.com/default.aspx/kb/324088
If you did not use anonymous structures in your application, this KB is not
related.
Another more possible cause is the inconsistent _WIN32_IE & _WIN32_WINNT
definitions which causes inconsistent _PROPSHEETPAGEA structure size and
layout during link-time.
To resolve this issue you may try to add the following statement in
stdafx.h, which re-defines _WIN32_IE and _WIN32_WINNT:
#if (_WIN32_IE <0x0400)
#define _WIN32_IE 0x0401
#endif
#if (_WIN32_WINNT < 0x0500)
#define _WIN32_WINNT 0x0500
#endif
This ensures a compatible definition and I hope you are able to link the
application successfully.
The 3rd possibility is the windows.h header file alignment incompatible, if
you have the following setting:
Under Configuration Properties->C/C++->Code Generation->set Struct Member
Alignment: 1 Byte (/Zp1)
Since windows.h header files require 8 packing, you need to force the
compiler to do this. You may wrap your Windows.h header file with #pragma
pack(8):
#pragma pack(8)
#include <windows.h>
#pragma pack()
The link below speaks more about pragma directives:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html
/_predir_pragma_directives.asp
Hope this helps.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jeffrey Tan[MSFT] - 10 Jan 2007 02:19 GMT
Hi Phnimx,
How about this LNK2022 error now? Have you reviewed my last reply to you?
Does it make sense to you?
If you still need any help or have any concern, please feel free to tell
me, thanks.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
phnimx - 11 Jan 2007 15:29 GMT
Hi Jeffrey,
I have successfully completed the migration process!
The help I received from you (specifically) was instrumental in the success
of the migration.
The experiences I have had with you with regard to ALL of the problems I
have brought to you, have been the best experiences EVER on the MSDN
Newgroups!
YOU SIR ARE #1 IN MY BOOK!
If we ever meet, I'm buying you whatever (breakfast/lunch/dinner) you like.
I very much appreciate your help. Keep up the amazing work.
Best regards,
Phnimx
> Hi Phnimx,
>
[quoted text clipped - 26 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Jeffrey Tan[MSFT] - 12 Jan 2007 04:04 GMT
Hi Phnimx,
Thanks for confirming the status!
I am also glad to work you such a nice customer. If you need further help,
please feel free to post, thanks.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.