Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Meaning of typedef HRESULT (*WriterCreator)(IUnknown**);

Posted on 2004-09-19
1
Medium Priority
?
911 Views
Last Modified: 2012-06-27
Can any on explaning the meaning the follwing declaration

typedef HRESULT (*WriterCreator)(IUnknown**);

If you can. please give an eqvallent of vb.net syntax

regards
prakash
0
Comment
Question by:prakash_prk
1 Comment
 
LVL 48

Accepted Solution

by:
AlexFM earned 750 total points
ID: 12099763
WriterCreator is pointer to the function which returns HRESULT and has IUnknown** parameter. In C++ this type may be used by the following way:

HRESULT SomeFunction(IUnknown** IUnknown)
{
    ...
}

WriterCreator p;              // pointer
p = SomeFunction;          // now p points to SomeFunction

IUnknown* pUnknown = ...;   // pointer to some IUnknown interface

HRESULT h = (*p)(&pUnknown);    // call SomeFunction using p pointer

.NET equivalent of typedef definition is delegate type declaration. C++ Line
WriterCreator p;
is equal to creating of .NET delegate instance. C++ line
HRESULT h = (*p)(&pUnknown);  
is equal to calling function pointed by delegate.

I cannot write exact VB .NET equivalent because I don't know what is IUnknown in .NET. Post link to this question from .NET and VB .NET areas, possibly somebody who knows COM Interoperability can help.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question