Proposal: COM support.

Issue #42 closed
Winter Laite created an issue

COM support is one of the most widely used features of AHK. Forum search for ‘COM’ yields 73825 results.

Comments (5)

  1. Winter Laite reporter

    Proposals for providing COM support to Keysharp that might not involve re-inventing the wheel:

    1. Update the attached ‘COM.ahk’ (very old, by sean) to AHK2 and then to Keysharp syntax. The lib consists mainly of functions with DllCall (no classes), with an example shown below.
    COM_CreateObject(CLSID, IID = "", CLSCTX = 5)
    {
        DllCall("ole32\CoCreateInstance", "Uint", SubStr(CLSID,1,1)="{" ? COM_GUID4String(CLSID,CLSID) : COM_CLSID4ProgID(CLSID,CLSID), "Uint", 0, "Uint", CLSCTX, "Uint", COM_GUID4String(IID,IID ? IID : IID=0 ? "{00000000-0000-0000-C000-000000000046}" : "{00020400-0000-0000-C000-000000000046}"), "UintP", ppv)
        Return  ppv
    }
    

    2. Implement same functionality in Keysharp using p/invoke to create methods analogous to the functions in COM.ahk.

  2. Log in to comment