The MASM Forum

General => The Workshop => Topic started by: sinsi on March 06, 2019, 04:25:37 PM

Title: When to release an interface
Post by: sinsi on March 06, 2019, 04:25:37 PM
Let's say I have an IShellFolder interface and get an IExtractIcon interface from it.
I want to use the IExtractIcon for a while but am finished with IShellFolder.

Can I release IShellFolder without affecting IExtractIcon? Or do I need to release IExtractIcon before IShellFolder?

Title: Re: When to release an interface
Post by: aw27 on March 06, 2019, 08:49:16 PM
I think you can, you are not inheriting from it.

Of course, you can also use the ExtractIcon API function.

Title: Re: When to release an interface
Post by: sinsi on March 06, 2019, 09:20:52 PM
>I think you can, you are not inheriting from it.
That's what I thought (hoped) but C++ is beyond me.
The interface itself is simple (just a struct) but parameters like **ppv are a struggle.

>Of course, you can also use the ExtractIcon API function.
This is just a small part of a bigger project (desktop icons).
Title: Re: When to release an interface
Post by: nidud on March 07, 2019, 05:23:53 AM
deleted