3

すべての C API XLM 関数の完全なドキュメントを探すのにかなりの時間を費やしましたが、うまくいきませんでした。

それらのいくつかを説明するこのページを見つけました: http://msdn.microsoft.com/en-us/library/office/bb687910%28v=office.12%29.aspx

しかし、たとえば、xlfAddMenu を理解して使用したかったのですが、MSDN で説明しているページが見つかりません。

利用可能なドキュメントがあるかどうか知っていますか? どうやらそこにたどり着くのはそれほど簡単ではありません。

4

2 に答える 2

0

すべての C API XLM 関数に関する完全な公式ドキュメントはありません。ただし、ドキュメントには、C API XLM 関数に関して次のように記載されています。

Excel では、XLL を開発するときに役立つ、C API を介してさらに多くの関数が公開されています。これらは、Excel ワークシート関数、および XLM マクロ シートから使用できる関数とコマンドに対応しています。」

また、EXAMPLE.[C,H]SDK のインストールに付属するファイルは、これらの機能の一部を使用しており、使用方法を学習するために使用できます。たとえば、xlfAddMenuはコールバック関数で使用されxlAutoOpenます。

// In the following block of code, the Generic drop-down menu is created.
// Before creation, a check is made to determine if Generic already
// exists. If not, it is added. If the menu needs to be added, memory is
// allocated to hold the array of menu items. The g_rgMenu[] table is then
// transferred into the newly created array. The array is passed as an
// argument to xlfAddMenu to actually add the drop-down menu before the
// help menu. As a last step the memory allocated for the array is
// released.
//
// This block uses TempStr12() and TempNum12(). Both create a temporary
// XLOPER12. The XLOPER12 created by TempStr12() contains the string passed to
// it. The XLOPER12 created by TempNum12() contains the number passed to it.
// The Excel12f() function frees the allocated temporary memory. Both
// functions are part of the framework library.

Excel12f(xlfGetBar, &xTest, 3, TempInt12(10), TempStr12(L"Generic"), TempInt12(0));

if (xTest.xltype == xltypeErr)
{
    hMenu = GlobalAlloc(GMEM_MOVEABLE,sizeof(XLOPER12) * g_rgMenuCols * g_rgMenuRows);
    px = pxMenu = (LPXLOPER12) GlobalLock(hMenu);

    for (i=0; i < g_rgMenuRows; i++)
    {
        for (j=0; j < g_rgMenuCols; j++)
        {
            px->xltype = xltypeStr;
            px->val.str = TempStr12(g_rgMenu[i][j])->val.str;
            px++;
        }
    }

    xMenu.xltype = xltypeMulti;
    xMenu.val.array.lparray = pxMenu;
    xMenu.val.array.rows = g_rgMenuRows;
    xMenu.val.array.columns = g_rgMenuCols;

    Excel12f(xlfAddMenu,0,3,TempNum12(10),(LPXLOPER12)&xMenu,TempStr12(L"Help"));

    GlobalUnlock(hMenu);
    GlobalFree(hMenu);
}
于 2014-01-31T08:37:37.357 に答える