English 中文(简体)
对于2003年Excel Excel, XLL 中的UDF 能使用多重线条吗?
原标题:For Excel 2003, can a UDF in an XLL use multiple threads?

FYI 1: UDF = User Defined (Worksheet) Function FYI 2: XLL = Excel add-in (DLL -> XLL)

I am writing an XLL add-in for Excel in C/C++ using the Excel4() API from Microsoft.
Link: http://msdn.microsoft.com/en-us/library/bb687835.aspx

我有一个“复杂”的任务,我想用多个线索来改进业绩。 虽然我理解Excel 2003的计算是单线的, 但我想知道我的UDF是否可以(a) 产卵线来工作,(b) 等待线索完成,以及(c) 返回结果。

说得非常清楚,我将不做任何Excel自动化工作,也不打电话给Excel4()。

优多代码 :

Variant MyComplexUDF(Variant input1, Variant input2)
{
    Thread t1 = new WorkerThread(input1);
    Thread t2 = new WorkerThread(input2);
    t1.join();
    t2.join();
    return [t1.Result(), t2.Result()];
}

表面看来没问题 但我不是DLL/XLL和线的专家

我搜索了谷歌(高低)寻找这一答案,

最佳回答

您可以开始尽可能多的线索, 然后等待这些线索 。 在最新版本的 API 中, 也支持 Async UDF s 。 您可以在 < a href=" http://xll.codplex.com" rel=“ no follow" > http://xll.codplex.com 上找到一些例子。 请查看 测试/ async. cpp: < a href=" http://xll.codplex.com/ a href=" http://xll. colverplection/ change control/view/14528# 139508" rel=“ no folfol. com/resourcources/changset/view/14528# 139508

问题回答

暂无回答




相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签