此函数可以被 Excel 已经载入的 XLL 或 DLL 调用。它等效于宏表函数 UNREGISTER。

xlfUnregister 有两种调用形式:

  • 形式1:Unregister 单独的命令或函数
  • 形式2:卸载 和 去激活 XLL

之前使用 xlfRegister 或 REGISTER 函数时,会进函数调用次数进行计数,使用此函数可以减少计数。如果计数器已经为0,调用这个函数将不会产生任何效果。当使用DLL中所有的函数调用计数器都为0,DLL 将会从内存中卸载。

xlfRegister (Form 1) 还定义了一个隐藏的名字做为函数的文本参数,pxFunctionText,此参数会评估函数的或命令的注册ID。当反注册函数,此名称将使用 xlfSetName 删除。因此函数名称不会再次在 Function Wizard 中显示出来。

Excel4(xlfUnregister, LPXLOPER pxRes, 1, LPXLOPER pxRegisterId);

参数

pxRegisterId(xltypeNum)

这表示在反注册的函数注册ID

属性值和返回值

如果成功,返回 TRUE (xltypeBool),反之返回 FALSE

备注

函数注册ID由 xlfRegister 第函数第一次注册时返回。它也可以通过调用 xlfRegisterId 或 xlfEvaluate 函数返回。注意,如果函数没有注册的话,使用 xlfRegisterId 会将函数进行注册。正是由于这个原因,如果你只是想获取ID的而不注册函数的话,最好是将函数名作为 xlfEvaluate 参数进行处理。

实例

查看 \SAMPLES\GENERIC\GENERIC.C.

中的 fExit 函数

[C++]
int WINAPI fExit(void)
{
XLOPER12 xDLL, // The name of this DLL //
xFunc, // The name of the function //
xRegId; // The registration ID //
int i; //
// This code gets the DLL name. It then uses this along with information
// from g_rgFuncs[] to obtain a REGISTER.ID() for each function. The
// register ID is then used to unregister each function. Then the code
// frees the DLL name and calls xlAutoClose.
// // Make xFunc a string //
xFunc.xltype = xltypeStr; Excel12f(xlGetName, &xDLL, 0); for (i = 0; i < g_rgWorksheetFuncsRows; i++)
{
xFunc.val.str = (LPWSTR) (g_rgWorksheetFuncs[i][0]);
Excel12f(xlfRegisterId,&xRegId,2,(LPXLOPER12)&xDLL,(LPXLOPER12)&xFunc);
Excel12f(xlfUnregister, 0, 1, (LPXLOPER12) &xRegId);
} for (i = 0; i < g_rgCommandFuncsRows; i++)
{
xFunc.val.str = (LPWSTR) (g_rgCommandFuncs[i][0]);
Excel12f(xlfRegisterId,&xRegId,2,(LPXLOPER12)&xDLL,(LPXLOPER12)&xFunc);
Excel12f(xlfUnregister, 0, 1, (LPXLOPER12) &xRegId);
} Excel12f(xlFree, 0, 1, (LPXLOPER12) &xDLL); return xlAutoClose();
}

【XLL API 函数】xlfUnregister (Form 1)的更多相关文章

  1. 【XLL API 函数】xlfUnregister (Form 2)

    此函数可以被 Excel 已经载入的 XLL 或 DLL 调用.它等效于宏表函数 UNREGISTER. xlfUnregister 有两种调用形式: 形式1:Unregister 单独的命令或函数 ...

  2. 【XLL API 函数】xlAbort

    C API 中有 15个 Excel 回调函数只能使用 Excel4.Excel4v.Excel12.Excel12v 函数调用(或间接的使用框架函数 Excel 或 Excel12f 调用).也就是 ...

  3. 【XLL API 函数】xlGetHwnd

    返回顶层的 Excel 窗口句柄. Excel4(xlGetHwnd, LPXLOPER pxRes, 0); /* returns low part only */ Excel12(xlGetHwn ...

  4. 【XLL API 函数】xlUDF

    调用用户定义函数,这个函数允许DLL 调用 VBA 中的用户定义函数,XLM 宏语言函数,以及在其它 add-ins 中注册的函数. 原型 Excel12(xlUDF, LPXLOPER12 pxRe ...

  5. 【XLL API 函数】xlStack

    查看堆栈区还剩余多少空间 原型 Excel12(xlStack, LPXLOPER12 pxRes, 0); 参数 此函数没有带任何参数 属性值/返回值 返回堆栈区还剩余的字节数 备注 返回最新版本的 ...

  6. 【XLL API 函数】xlSheetNm

    从外部引用包含的工作表ID返回工作表或宏表名称,或是当前表名称. 原型 Excel12(xlSheetNm, LPXLOPER12 pxRes, 1, LPXLOPER12 pxExtref); 参数 ...

  7. 【XLL API 函数】xlSheetId

    查找命名的工作表ID,用于外部引用. 原型 Excel12(xlSheetId, LPXLOPER12 pxRes, 1, LPXLOPER12 pxSheetName); 参数 pxSheetNam ...

  8. 【XLL API 函数】xlGetName

    以字符串格式返回 DLL 文件的长文件名. 原型 Excel12(xlGetName, LPXLOPER12 pxRes, 0); 参数 这个函数没有参数 属性值和返回值 返回文件名和路径 实例 \S ...

  9. 【XLL API 函数】 xlGetInst

    返回正在调用 DLL 的 Excel 实例的实例句柄. 原型 Excel4(xlGetInst, LPXLOPER pxRes, 0); /* returns low part only */ Exc ...

随机推荐

  1. iframe框架嵌套技巧(全屏,去双滚动条)

    一般情况下我们很少用到iframe(框架),但有些特殊的情况下我们不得不使用iframe,那么或许或遇到嵌套内容不全屏,网页周围有边框,双滚动条等等情况,下面来说一下处理技巧. 全屏与边框处理: &l ...

  2. Net上传附件大小控控值(转)

    Server Error 404 – File or directory not found. The resource you are looking for might have been rem ...

  3. Thank you for your resubmission. Performance - 2.3.10 We noticed that your app or its metadata includes irrelevant third-party platform information. Specifically, Android logo is mentioned in the

    被拒很多次,各种修改,最后发现是提交的时候,含有安卓的图标!欲哭无泪呀! Thank you for your resubmission. Performance - 2.3.10 We notice ...

  4. SQL中关于日期的常用方法

    mysql数据库: logintime >= STR_TO_DATE('$$START_TIME','%Y-%m-%d %H:%i:%s') AND logintime < STR_TO_ ...

  5. 如何查看 Linux是32位还是64位?

    方法一:执行命令 file /sbin/init [root@localhost jianbao]# file /sbin/init /sbin/init: ELF 32-bit LSB shared ...

  6. 通过url地址传递base64加密参数遇到的问题整理

    1. base64的加密解密方法在C#的类库中就有 QueryString中的加号变成了空格问题 Server.UrlEncode(username),获取到的编码又将等于号变成了%3d; 到底改怎么 ...

  7. Google Java编程风格指南中文版

    作者:Hawstein出处:http://hawstein.com/posts/google-java-style.html声明:本文采用以下协议进行授权: 自由转载-非商用-非衍生-保持署名|Cre ...

  8. 修改Mysql默认编码

    show variables like 'character%';+--------------------------+----------------------------+| Variable ...

  9. CentOS 6.5 3.0.4安装agentd

    更改主机名为test3 [root@localhost ~]# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=test3 关闭selinux [ ...

  10. Knockout.Js案例一Introduction

    </strong></p> <p>Last name: <strong data-bind="text:lastName ">tod ...