C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 22nd, 2002, 05:37 PM
MJEggertson MJEggertson is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2002
Location: Seattle WA
Posts: 863 MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 8
What is a (void**)?

The title says pretty much everything I want to know. I'm trying to wrap my brain around COM, and I've never seen a cast like (void**) before. It appears in the QueryInterface method of COM objects:

HRESULT QueryInterface( REFIID iid, void** ppvObject );

I know what a void pointer is, I guess I'm just confused with the ** part. Is it just a pointer to a pointer?

Reply With Quote
  #2  
Old March 23rd, 2002, 09:46 AM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,173 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 24
I don't know anything about this type of programming but I believe you are correct when you say it is a pointer to a pointer. The following link states:

ppvObject - An [out] pointer to the interface pointer identified by iid.

http://www.isd.mel.nist.gov/project...n/IUnknown.html

Reply With Quote
  #3  
Old March 23rd, 2002, 09:52 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
imagine a list of strings that you want to pass to a function.

each string is a char*, a list is passed via its address, so the "list of strings" is a char**

the void** is just more general.
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #4  
Old March 23rd, 2002, 04:04 PM
MJEggertson MJEggertson is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2002
Location: Seattle WA
Posts: 863 MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 8
Thanks. Its good to be able to confirm things. I hate "going on faith," for things like this, because eventually, assuming things catches up with you-- especially if your assumption was wrong.

Now if I could just figure out how to use these darn COM interfaces... . I didn't want to learn the COM, but the project I've started pretty much demands it if I'm gonna see it to completion. I guess I'm off to the bookstore this weekend.

It was supposed to be one of those 'simple' project. *cough* The amount of times I've heard that...

Reply With Quote
  #5  
Old March 23rd, 2002, 07:44 PM
MJEggertson MJEggertson is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2002
Location: Seattle WA
Posts: 863 MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 8
Ok, I'm out of ideas I guess. I'm hoping someone can offer some advice. Its a pretty specific problem. I have a view derived from CHTMLView. Its pretty basic, I use a template to put an 'empty' (html) document in the view, then I'm supposed to browse the DOM and populate/retrieve the form elements with data from the actual application's document (ie: the doc data from the doc/view architecture).

Here's the catch though, I'm able to browse the dom, but I can't for the life of me figure out how to access/modify any of its attributes. Here's what I got so far.

Code:
// Get the document's IDispatch pointer.
IDispatch* pHtmlDoc = GetHtmlDocument();

// Obtain a pointer to the IHTMLDocument2 interface.
IHTMLDocument2* pIDocument = NULL;
HRESULT hr;
hr = pHtmlDoc->QueryInterface(IID_IHTMLDocument2, (void**) &pIDocument);
if (SUCCEEDED(hr))
{

    // Obtain a pointer to the HTMLElements interface.
    IHTMLElementCollection* pIElements = NULL;
    hr = pIDocument->get_all(&pIElements);
    if (SUCCEEDED(hr))
    {

        // Obtain a pointer to all the Input elements from the collection
        IHTMLElementCollection* pInputs = NULL;
        hr = pIElements->tags(_variant_t("input"), (IDispatch**) &pInputs);
        if (SUCCEEDED(hr))
        {

            // For now, try to get element 0.
            // Eventually will need to try to iterate over all elements.
            IHTMLInputTextElement* pIThisElement = NULL;
            hr = pInputs->item(_variant_t((long) 0), _variant_t((long) 0),
                (IDispatch**) &pIThisElement);
            if (SUCCEEDED(hr))
            {

                // How do I get element name/value?
                pIThisElement->Release();
            }
            else
                ErrorMessage(_T("Failed at pIThisElement"));
        
            pInputs->Release();
        }
        else
            ErrorMessage(_T("Failed at pInputs"));

        pIElements->Release();
    }
    else
        ErrorMessage(_T("Failed at pIForms"));

    pIDocument->Release();
}
else
    ErrorMessage(_T("Failed at pIDocument"));

pHtmlDoc->Release();


The ErrorMessage() function is just a little shortcut to a message box to tell me exactly where the browsing failed.

How do I use the pIThisElement interface to edit (if the app is in a load procedure), or read (if the app is in a save procedure)? I can't seem to figure out the pIThisElement->get_value() or similar functions.

Reply With Quote
  #6  
Old March 25th, 2002, 05:42 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,335 Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level)Scorpions4ever User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 12 h 38 m 59 sec
Reputation Power: 662
Have you tried this:

Code:
CComBSTR bstr;

...
....
pIThisElement->get_name(&bstr); // To get the name
CString strTag = bstr;

pIThisElement->get_value(&bstr); // To get the value
pIThisElement->set_value(bstr); // To set the value
 

Reply With Quote
  #7  
Old March 26th, 2002, 01:38 AM
MJEggertson MJEggertson is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2002
Location: Seattle WA
Posts: 863 MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 8
Unfortunately, yes. I get an assertion error.


File: i386\chkesp.c
Line: 42

The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.


Funny thing is, I get this error even if I pass a plain old &BSTR to the get/put functions. Its got me stumped.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > What is a (void**)?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway