Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn 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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

929 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

15 Experts available now in Live!

Get 1:1 Help Now