Solved

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

Posted on 2004-09-19
1
840 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 250 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now