首页 \ 问答 \ 带有32位标志的Excel 2016条件编译(Excel 2016 conditional compilation with 32-bit flags)

带有32位标志的Excel 2016条件编译(Excel 2016 conditional compilation with 32-bit flags)

在今天通过更新获得的OSX上新的64位版本的Excel 2016中,在检查没有定义PtrSafe的函数定义时似乎没有遵循条件编译(如32位的情况)平台)。 在这个例子中,我们对不同的平台有相同功能的不同定义,当Excel加载加载项时,它会死掉并抱怨第三个定义在函数声明中没有PtrSafe(但当然不是因为它适用于32位平台)。

有没有办法让Excel在VBA中遇到此代码时不会死? 或者这只是OSX上64位Excel 2016中的一个错误? 对我来说似乎是一个明显的错误。 我在哪里报告Excel中的错误?

#If Mac Then
' Even though the functions are exported with a leading underscore, Excel 2011 for Mac doesn't want the leading underscore as part of name
Private Declare PtrSafe Function get_global_param_string_private Lib "libCoolProp.dylib" Alias "get_global_param_string" (ByVal param As String, ByVal Output As String, ByVal n As Integer) As Long
#ElseIf Win64 Then
Private Declare PtrSafe Function get_global_param_string_private Lib "CoolProp_xls_x64.dll" Alias "get_global_param_string" (ByVal param As String, ByVal Output As String, ByVal n As Integer) As Long
#Else
Private Declare Function get_global_param_string_private Lib "CoolProp_xls_std.dll" Alias "_get_global_param_string@12" (ByVal param As String, ByVal Output As String, ByVal n As Integer) As Long
#End If

这是Excel的错误


In the new 64-bit version of Excel 2016 on OSX I obtained through update today, the conditional compilation doesn't seem to be followed when checking for function definitions that don't have PtrSafe defined (as would be the case for 32-bit platforms). In this example, we have different definitions of the same function for different platforms, and when Excel loads the add-in it dies and complains about the third definition not having a PtrSafe in the function declaration (but of course it doesn't because it is for a 32-bit platform).

Is there any way of making Excel not die when it hits this code in VBA? Or is this just a bug in 64-bit Excel 2016 on OSX? Seems like an obvious bug to me. Where do I report bugs in Excel?

#If Mac Then
' Even though the functions are exported with a leading underscore, Excel 2011 for Mac doesn't want the leading underscore as part of name
Private Declare PtrSafe Function get_global_param_string_private Lib "libCoolProp.dylib" Alias "get_global_param_string" (ByVal param As String, ByVal Output As String, ByVal n As Integer) As Long
#ElseIf Win64 Then
Private Declare PtrSafe Function get_global_param_string_private Lib "CoolProp_xls_x64.dll" Alias "get_global_param_string" (ByVal param As String, ByVal Output As String, ByVal n As Integer) As Long
#Else
Private Declare Function get_global_param_string_private Lib "CoolProp_xls_std.dll" Alias "_get_global_param_string@12" (ByVal param As String, ByVal Output As String, ByVal n As Integer) As Long
#End If

This is the error from Excel


原文:https://stackoverflow.com/questions/39813612
更新时间:2022-04-23 07:04

最满意答案

只需使用Apple的SquareCam应用程序中的代码即可。 它可以在前后摄像头的任何方向上正确对齐方形。 沿着faceRect插入正确的眼睛和嘴巴位置。 注意:您必须将x位置与面部特征的y位置交换。 不确定为什么你必须做交换,但这会给你正确的位置。


Just use the code from Apple's SquareCam app. It aligns the square correctly in any orientation for both the front and rear cameras. Interpolate along the faceRect for the correct eye and mouth positions. Note: you do have to swap the x position with the y position from the face feature. Not sure why exactly you have to do the swap but that gives you the correct positions.

相关问答

更多
  • 要获得地图上的确切位置,您需要2个参数: 点的纬度和经度。 GeoPoint在微度等级中接受纬度和经度,因此尝试创建这样的点以获得更好的准确性: double lati = location.getLatitude(); double longi = location.getLongitude(); GeoPoint geo_point= new GeoPoint((int)(lati * 1e6),(int)(longi * 1e6)); This was just my mistake - I for ...
  • 将标签添加到imageview,如下所示: holder.image1 = (ImageView) view.findViewById(R.id.imageView1); holder.image2 = (ImageView) view.findViewById(R.id.imageView2); holder.image3 = (ImageView) view.findViewById(R.id.imageView3); holder.ima ...
  • @tonyc您的解决方案仅适用于“UIImageOrientationRight”特定情况。 问题来自UIImage和CIDetectorImageOrientation之间的区别。 从iOS文档: CIDetectorImageOrientation 用于指定要检测其功能的图像显示方向的键。 该键是一个NSNumber对象,其值与TIFF和EXIF规定的值相同; 值的范围可以从1到8.该值指定图像的原点(0,0)所在的位置。 如果不存在,则默认值为1,这意味着图像的原点是左上角。 有关每个值指定的图像原点 ...
  • 为什么不简单地从视频中提取帧并在CIFaceDetector使用它们? 这个网站有一些关于如何从iOS上的视频文件中获取帧的好信息: http://www.7twenty7.com/blog/2010/11/video-processing-with-av-foundation Why not simply extract frames from the video as it is playing and use those in the CIFaceDetector? This site has som ...
  • 对象的所有子项的x位置为0.因此,当您尝试在其框架的位置绘制圆圈时,它们都被绘制在屏幕的左下角,这是正常的,因为在SpriteKit中,屏幕的原点是左下角,因为所有对象框架都与父母相关。 因此,如果您的父级x position为250 ,并且在此父级内,您有一个x position为0的节点,则此子节点的位置为0与其父级相关,但250与屏幕相关。 如果你想获得与obj节点子节点的屏幕位置相关的信息,我建议你这样做,例如: l.frame.origin.x + obj.frame.origin.x l.fra ...
  • 看起来您想要在面板的边界内移动标签,因此您应该为面板的MouseMove事件添加事件处理程序。 public Form1() { InitializeComponent(); panel1.MouseMove += panel1_MouseMove; } void panel1_MouseMove(object sender, MouseEventArgs e) { lbl.Location = e.Location; } It looks like you want to m ...
  • 只需使用Apple的SquareCam应用程序中的代码即可。 它可以在前后摄像头的任何方向上正确对齐方形。 沿着faceRect插入正确的眼睛和嘴巴位置。 注意:您必须将x位置与面部特征的y位置交换。 不确定为什么你必须做交换,但这会给你正确的位置。 Just use the code from Apple's SquareCam app. It aligns the square correctly in any orientation for both the front and rear camera ...
  • 您正在寻找机器学习解决方案。 FaceSDK看起来像一个很好的功能提取器。 我不认为会有一个可用的库来解决您的具体问题。 你最好的选择是: 选择一个带有java实现的机器学习框架(SVM,PCA) 拍摄一系列照片并用目标表达自己标记(快乐或悲伤) 计算你的模型并测试它 这涉及一些关于机器学习的知识。 You are looking for machine learning solutions. FaceSDK looks like a good feature extractor. I don't thin ...
  • 您可以使用OpenCV python接口。 http://opencv.org 但是,您还需要一些努力来集成数据库中的数据 You can use OpenCV python interface. http://opencv.org But You will need a bit of effort to integrate data from a database too
  • 在这一行中: face = self.face_cascade.detectMultiScale(grayscale_filter, 1.3, 5) 您传入以下可用参数(从文档中获取 ): 参数: 级联 - 哈尔分类器级联(仅限OpenCV 1.x API)。 它可以使用Load()从XML或YAML文件加载。 当级联不是 需要了,用它来释放它 cvReleaseHaarClassifierCascade(级联)。 image - CV_8U类型的矩阵,包含检测到对象的图像。 对象 - 矩形的向量,其中每 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)