qqwwwee 发表于 2007-3-13 16:34:00

The function acedInvoke can not work

I defined myfun as following in lisp:
(defun myfun() (* 2 180))
And the function works right in command state.
commandmyfun)
360
But when I spawn the function in ARX,it's can not work.
Here is my code:
+++++++++++++++++++++++++++++++++++++++++
struct resbuf *result = NULL, *list;
list = acutBuildList(RTSTR, "myfun", 0);
if (list != NULL)
{
int stat = acedInvoke(list, &result);
if (stat == RTERROR)
acdbFail(L"Cannot run \n");
acutRelRb(list);
}
if (result != NULL)
{
// Do somthing
acutRelRb(result);
}
else
AfxMessageBox(L"NULL");
+++++++++++++++++++++++++++++++++++++++++++
The result show "Cannot run " and result == NULL.

Please help me.

logitechlike 发表于 2010-8-23 19:31:00

list = acutBuildList(RTSTR, "myfun", 0);
改为list = acutBuildList(RTSTR, _T("myfun"), 0);
即可
页: [1]
查看完整版本: The function acedInvoke can not work