Solved

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

Posted on 2004-09-19
1
877 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
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 antispam), the admini…

751 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