CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2025 开发者帮助

处理来自调用函数的错误

2024-5-18 19:24| 发布者: admin| 查看: 19| 评论: 0|原作者: admin|来自: AutoCAD

处理来自调用函数的错误

当返回 时,这意味着外部函数已被调用并成功返回。它并不意味着外部函数成功获得了结果;若要获取此信息,程序必须检查结果参数。如果外部函数成功并且旨在返回值,则结果将指向包含一个或多个值的结果缓冲区列表。如果外部函数失败,则 result 参数设置为 。如果外部函数未返回结果,则 result 参数也是如此。acedInvoke()RTNORMNULLNULL

以下示例代码片段检查预期返回一个或多个结果值的外部函数的返回值:

struct resbuf *xfcnlist, *xresults; 
// Build the invocation list, xfcnlist.  
rc = acedInvoke(xfcnlist, &xresults); 
if (rc != RTNORM) { 
// Couldn't call the function—report this error (or even abort).  
    return BAD; 
} 
if (xresults == NULL) { 
    // Function was called but returned a bad result.  
    return BAD; 
} 
// Look at return results and process them.  

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-6-27 16:11

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部