Why isn't IID_ITaskbarList3 defined?

evilrat evilrat666 at gmail.com
Mon Oct 16 05:06:26 UTC 2017


On Sunday, 15 October 2017 at 15:13:09 UTC, Nieto wrote:
> 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.

Did you call CoInitialize before creating anything? Is your 
ITaskbarList3 defined as interface?

Here is the simple example anyway
https://gist.github.com/Superbelko/277d86a17d497eae85a7f1788bfd83b4



There are no predefined GUID's and declarations for some stuff 
because standard WinAPI bindings is incomplete, you can probably 
contribute and add some
https://github.com/dlang/druntime


More information about the Digitalmars-d-learn mailing list