I'm trying to write a blinding and I found both IID_ITaskbarList and IID_ITaskbarList2 are defined but IID_ITaskbarList3 isn't. Any reason why it isn't defined? sorry if it sounds such a naive question, I'm new to COM and D interop. I knew a thing or two about PInvokes with C#.

Then how do I define it myself?

I've tried this:

GUID IID_ITaskbarList3 = createGUIDFromString("{ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf}");

GUID createGUIDFromString(string guidStr) {
                GUID guid;
                wchar* GUID_STR = toUTFz!(wchar*)(guidStr);
                HRESULT hr = IIDFromString(GUID_STR, &guid);
                assert(SUCCEEDED(hr));
                return guid;
        }

I'm unsure if it's the proper way to do it (if not, please show me the right one)

But the call to CoCreateInstance() still fails to access any member of m_pITaskBarList3 object, so I'm making sure I'm passing the correct arguments to the function. The memory access error is:

object.Error@(0): Access Violation



HRESULT hr = CoCreateInstance(&CLSID_TaskbarList, null, CLSCTX_INPROC_SERVER, &IID_ITaskbarList3,
cast(void **)   &m_pITaskBarList3);
assert(hr == S_OK);

The assert() doesn't run, so the error is somewhere else... I guess.

Reply via email to