본문 바로가기

Programming/MFC

MFC app MANIFEST for x64 including x86 COMCTL32.dll

출처 : https://msdn.microsoft.com/en-us/library/bb773175(VS.85).aspx


인터넷에서 받은 소켓 통신하는 MFC 프로그램(32bit)을 실행하였더니 정상적으로 실행이 되었다.


x64로 플랫폼을 변경 후 정상 빌드는 됐지만 0xc000007b라는 에러코드를 발생하며 런타임 에러를 뿜어냈다.


3일 동안 정말 많은 검색을 하였고 150개 정도의 웹 페이지를 보았다.


그 중 한 사이트에서 아래와 같은 메시지를 볼 수 있었다. 하지만 MFC를 많이 개발해보지 않은 나로써는 무슨 말인지 정확히 알지 못하였다.


메시지 대로 Dependency Walker도 이미 실행해봤지만 COMCTL32.dll만 x86으로 dll을 로드하고 있었다.

설명

Project not explicitly including any libs has 'standard windows libraries'

Project was migrated from VS 2008 and originally was x86 only

Dependency walker shows an x86 version of COMCTL32.dll - 64 bit versions of everything else

It is using mc.exe and midl.exe for an event viewer interface (which uses the x86 versions even on a 64 bit platform)

App builds but crashes on startup. Workaround was to disable Manifest generation and app now OK. 


또다시 많은 검색을 타고타고 들어가보니 다음과 같은 메시지를 볼 수 있었다.

https://msdn.microsoft.com/en-us/library/bb773175(VS.85).aspx



Important  Set the processorArchitecture entry to "X86" if your application targets the 32 bit Windows platform, or to "amd64" if your application targets the 64 bit Windows platform. You can also specify "*", which ensures that all platforms are targeted, as shown in the following examples.
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="*"
    name="CompanyName.ProductName.YourApplication"
    type="win32"
/>
<description>Your application description here.</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>


결론은 manifest파일을 열어 X86을 amd64로 변경하면 해결된다!!

'Programming > MFC' 카테고리의 다른 글

[winapi] DC에 대해서...(GetDC / BeginPaint)  (0) 2017.07.04
timeSetEvent 64bit 오류  (0) 2017.07.04
MFC 프로젝트 속성 > 구성 속성  (0) 2017.07.03
런타임 라이브러리 (Run-time Libraries)  (0) 2017.07.03
CFile Class  (0) 2017.06.28