Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7160555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:25:05+00:00 2026-05-28T13:25:05+00:00

I have MSXML2::IXMLDOMNodeList interface. I can find the common length of all MSXML2::IXMLDOMNode-s from

  • 0

I have MSXML2::IXMLDOMNodeList interface.
I can find the common length of all MSXML2::IXMLDOMNode-s from this list using such code:

MSXML2::IXMLDOMNode* pDOMXMLNode = 0;
BSTR NodeText;
ULONG lValueSize = 0;
ULONG lCommonLength = 0;
while(pDOMXmlNodeList->nextNode(&pDOMXMLNode)== S_OK)
{      
 pDOMXMLNode->get_xml(&NodeText);      
 CString strNode(NodeText);
 lValueSize += strNode.GetLength();      
}    
lCommonLength += lValueSize;

It is good, but it is not what i want to find: i want to determine object instance’s size in memory.
Is there a way to make it in C++?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:25:06+00:00Added an answer on May 28, 2026 at 1:25 pm

    I’m not sure if you can determine exact size of COM object. However, you can use the following trick to determine approximate size of COM objects.

    //First determine how much memory your program is currently using. 
    //Say it is currently `m1`
    
    //allocate COM object
    
    //Now again, determine how much memory your program is using
    //Say it is m2
    
    //COM object size = m2 - m1
    

    Microsoft provides some API to determine the memory state of the program. Here is how you apply the above technique to Microsoft API:

    _CrtMemState m1;
    _CrtMemCheckpoint( &m1 );
    
     //COM object creation
    
    _CrtMemState m2;
    _CrtMemCheckpoint( &m2 );
    
    _CrtMemState difference;
    _CrtMemDifference(&difference, &m1,&m2);
    

    The object difference tells the size of COM object. You can print its value as:

    _CrtMemDumpStatistics( &difference );
    

    Or, you can further analyse the object difference which is of type _CrtMemState defined as:

    //crtdbg.h
    
    struct _CrtMemBlockHeader;
    typedef struct _CrtMemState
    {
        struct _CrtMemBlockHeader * pBlockHeader;
        size_t lCounts[_MAX_BLOCKS];
        size_t lSizes[_MAX_BLOCKS];
        size_t lHighWaterCount;
        size_t lTotalCount;
    } _CrtMemState;
    

    Read the documentation at MSDN:

    • Memory State Comparison
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object xmlHttp = CreateObject(MSXML2.xmlhttp) How can I store this object( xmlhttp
I have a VBScript COM Component where I'm using Msxml2.FreeThreadedDOMDocument.4.0 however is there /
I have this node MSXML2::IXMLDOMNodePtr node; node->Getxml() returns <level3>333<level4 atribute=444><level5>555<level6>666</level6></level5></level4></level3> node->Gettext(); returns 333555666 node->GetnodeValue()
I have a rowset coming back using the Microsoft rowset schema from my stock
I am using MSXML3 and have loaded an xml document which is a HTML
Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have something like this: uses MSXML2_TLB; type TDocumentType = (dtOrder, dtInvoice, dtStatus, dtError);
I try to access from a browser a simple mailing list service I developed.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.