2013-04-14 1 views
0

단추를 사용하여 비디오를 녹화하고 비디오를 저장 한 다음 카메라에서 연결을 끊는 Visual C++ 프로그램에서이 오류가 발생했습니다. 이 문제를 해결하기 위해 c/C++ 속성의 명령 줄에/clr을 입력했습니다. 오류는Visual C++/clr 오류

1>c:\users\taycm_000\documents\visual studio 2010\projects\test-new\test\stdafx.h(28): error C3641: 'handleObjectEvent' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe 
1>c:\users\taycm_000\documents\visual studio 2010\projects\test-new\test\stdafx.h(32): error C3641: 'handlePropertyEvent' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe 
1>c:\users\taycm_000\documents\visual studio 2010\projects\test-new\test\stdafx.h(37): error C3641: 'handleStateEvent' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe 

/clr을 사용하지 않고 해결할 수 있습니까?

답변

1

"모든 코드를 일리노이로 컴파일"이라고 말하면 C++/CLI 컴파일러는별로 흥분하지 않고 네이티브 코드로 컴파일 된 함수 인 함수의 선언을 발견하게됩니다. 둘 다있을 수는 없습니다.

네이티브 코드 기능에 대한 선언을 포함하는 헤더를 알려주십시오. 즉석에서 앞뒤로 전환 할 수 있습니다. pragma로 쉽게 할 수 있습니다.

#pragma managed(push, off) 
#include "foo.h" 
#pragma managed(pop)