#import .tlb文件在特定配置和特定项目文件夹位置中生成编译错误 [英] #import .tlb file make compile error in a specific configuration and specific project folder location
问题描述
您好
我进口
stdafx.h中的
// ----- Inventor接口包括
#pragma
警告 ( disable :4192
4049)
#import
< RxInventor.tlb>
rename_namespace( " Inventor" )named_guids raw_dispinterfaces
raw_method_prefix ( "" )high_method_prefix( "方法" )
\
重命名( " DeleteFile"
, " IVDeleteFile" )
\\ \\
重命名( " CopyFile" ,
"IVCopyFile" )
\
重命名( " MoveFile" ,
" APIMoveFile" )
\
重命名( " GetObject" ,
" IVGetObject" )
\
重命名( " SetEnvironmentVariable"
, " IVSetEnvironmentVariable" )\
重命名( " MoveFile" ,
"IVMoveFile" ),no_implementation
在cpp文件中:
// ----- Inventor接口包括
#pragma
警告 ( disable :4192
4049)
#import
< RxInventor.tlb>
rename_namespace( " Inventor" )named_guids raw_dispinterfaces
raw_method_prefix ( "" )high_method_prefix( "方法" )
\
重命名( " DeleteFile"
, " IVDeleteFile" )
\\ \\
重命名( " CopyFile" ,
"IVCopyFile" )
\
重命名( " MoveFile" ,
" APIMoveFile" )
\
重命名( " GetObject" ,
" IVGetObject" )
\
重命名( " SetEnvironmentVariable"
, " IVSetEnvironmentVariable" )\
重命名( " MoveFile" ,
" IVMoveFile" ),implementation_only
并收到错误消息:
错误 1186 错误C2440:'return':无法con从 '发明者:: iFeatureEntityInput :: GetEntityType :: miFeatureEntityInputTypeEnum' 到 '发明者:: iFeatureEntityInputTypeEnum' &NBSP VERT; d:\install_2014\solidcam\output\releasewin32\tmp\hostlibiv2012\rxinventor.tli&NBSP; 218757
关于这个问题的奇怪之处是它在配置版本Win32中发生但在版本x64中没有发生
请指教
嗨Eranpo,
由于这个问题与VC ++语言开发有关,我正在搬家您的线程进入
Visual C ++ 论坛获得专门支持。感谢您的理解。
如果可能,您可以在新回复中共享一个简单的示例,因此VC ++专家可以帮助您解决/重现此问题。您还可以使用断点调试您的应用,因此我们可以确保它是否与特定的行代码相关。
奇怪的有关此问题的事情是在配置版本Win32中发生但在版本x64中没有发生
b也许您可以共享有关如何更改配置的屏幕截图,是吗?您在Configuration Manager中更改平台?
错误 1186 错误C2440:'return':无法从'Inventor转换: :iFeatureEntityInput :: GetEntityType :: miFeatureEntityInputTypeEnum"到 '发明者:: iFeatureEntityInputTypeEnum' &NBSP; d:\install_2014\solidcam\output\releasewin32\tmp\hostlibiv2012\rxinventor.tli&NBSP; 218757 跨度>
我还发现了一个MSDN文档,它向我们分享了编译器错误C2440的潜在原因"'转换':无法从'type1'转换为'type2'",希望它可以提供帮助。
最好的问候,
Hi
I make import
in stdafx.h
//----- Inventor interfaces include
#pragma warning(disable:4192 4049)
#import <RxInventor.tlb> rename_namespace("Inventor") named_guids raw_dispinterfaces raw_method_prefix("") high_method_prefix("Method") \
rename("DeleteFile" , "IVDeleteFile") \
rename("CopyFile", "IVCopyFile") \
rename("MoveFile", "APIMoveFile") \
rename("GetObject", "IVGetObject") \
rename("SetEnvironmentVariable" , "IVSetEnvironmentVariable")\
rename("MoveFile", "IVMoveFile"), no_implementation
in a cpp file:
//----- Inventor interfaces include
#pragma warning(disable:4192 4049)
#import <RxInventor.tlb> rename_namespace("Inventor") named_guids raw_dispinterfaces raw_method_prefix("") high_method_prefix("Method") \
rename("DeleteFile" , "IVDeleteFile") \
rename("CopyFile", "IVCopyFile") \
rename("MoveFile", "APIMoveFile") \
rename("GetObject", "IVGetObject") \
rename("SetEnvironmentVariable" , "IVSetEnvironmentVariable")\
rename("MoveFile", "IVMoveFile"), implementation_only
and get an error:
Error 1186 error C2440: 'return' : cannot convert from 'Inventor::iFeatureEntityInput::GetEntityType::miFeatureEntityInputTypeEnum' to 'Inventor::iFeatureEntityInputTypeEnum' d:\install_2014\solidcam\output\releasewin32\tmp\hostlibiv2012\rxinventor.tli 218757
the strange thing about this problem is it happens in configuration Release Win32 but not in Release x64
Please advise
Hi Eranpo,
Since this issue is related to the VC++ language development, I am moving your thread into the Visual C++ Forum for dedicated support. Thanks for your understanding.
If possible, you could share a simple sample in your new reply, so it will be helpful for VC++ expert to troubleshoot/repro this issue. You could also debug your app with breakpoints, so we could make sure that whether it is related to specific line code.
The strange thing about this problem is it happens in configuration Release Win32 but not in Release x64
Maybe you could share a screen shot about how you change the configuration, do you mean that you change the platforms in Configuration Manager?
Error 1186 error C2440: 'return' : cannot convert from 'Inventor::iFeatureEntityInput::GetEntityType::miFeatureEntityInputTypeEnum' to 'Inventor::iFeatureEntityInputTypeEnum' d:\install_2014\solidcam\output\releasewin32\tmp\hostlibiv2012\rxinventor.tli 218757
I also found a MSDN document which shared us the potential reasons for the compiler Error C2440 "'conversion' : cannot convert from 'type1' to 'type2'", hope it could help.
Best Regards,
这篇关于#import .tlb文件在特定配置和特定项目文件夹位置中生成编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!