带有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
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
原文:https://stackoverflow.com/questions/39813612
最满意答案
只需使用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 ...
-
面部表情检测(Facial expression detection)[2022-10-06]
您正在寻找机器学习解决方案。 FaceSDK看起来像一个很好的功能提取器。 我不认为会有一个可用的库来解决您的具体问题。 你最好的选择是: 选择一个带有java实现的机器学习框架(SVM,PCA) 拍摄一系列照片并用目标表达自己标记(快乐或悲伤) 计算你的模型并测试它 这涉及一些关于机器学习的知识。 You are looking for machine learning solutions. FaceSDK looks like a good feature extractor. I don't thin ... -
面部识别[关闭](Facial Recognition [closed])[2023-08-04]
您可以使用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类型的矩阵,包含检测到对象的图像。 对象 - 矩形的向量,其中每 ...