Solved

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

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft vcsetup.exe and vcssetup.exe 8 422
_itoa_s  equivalent in c# 3 173
Weird problem with CListCtrl::InsertItem() in Windows 8 17 428
looking for books on c++ and javascript 4 158
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

770 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