Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Problem in passing a VARIANT to IXMLDOMNodePtr

Problem in passing a VARIANT to IXMLDOMNodePtr

Scheduled Pinned Locked Moved ATL / WTL / STL
c++helpxmlquestion
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rocky
    wrote on last edited by
    #1

    hi everyone, well I gotta say this, I'm not a gr8 fan for programming in ATL/MFC but now I'm in a situation where I have to do this stuff. I'm using MSXML 4.0 in a project where I need to develop an XML log as the functions get called. I'm trying to pass a CString to the nodeTypedValue or NodeValue functions and its giving the error error C2064: term does not evaluate to a function taking 1 arguments the Code is given below CString t = "No Error"; pRetCode->nodeTypedValue(_variant_t(t)); Its also giving this error on this CString t; t.Format("0x%x",hr); pRetCode->nodeValue(_variant_t(t)); code> Can u plz tell me what to do here??? Thanks in advance Rocky _You can't climb up a ladder with your hands in your pockets._

    M L M 3 Replies Last reply
    0
    • R Rocky

      hi everyone, well I gotta say this, I'm not a gr8 fan for programming in ATL/MFC but now I'm in a situation where I have to do this stuff. I'm using MSXML 4.0 in a project where I need to develop an XML log as the functions get called. I'm trying to pass a CString to the nodeTypedValue or NodeValue functions and its giving the error error C2064: term does not evaluate to a function taking 1 arguments the Code is given below CString t = "No Error"; pRetCode->nodeTypedValue(_variant_t(t)); Its also giving this error on this CString t; t.Format("0x%x",hr); pRetCode->nodeValue(_variant_t(t)); code> Can u plz tell me what to do here??? Thanks in advance Rocky _You can't climb up a ladder with your hands in your pockets._

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Have you included comdef.h?

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze

      R 1 Reply Last reply
      0
      • M Michael Dunn

        Have you included comdef.h?

        --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze

        R Offline
        R Offline
        Rocky
        wrote on last edited by
        #3

        yup now i have a still no change... Everythings the same:(

        Rocky You can't climb up a ladder with your hands in your pockets.

        1 Reply Last reply
        0
        • R Rocky

          hi everyone, well I gotta say this, I'm not a gr8 fan for programming in ATL/MFC but now I'm in a situation where I have to do this stuff. I'm using MSXML 4.0 in a project where I need to develop an XML log as the functions get called. I'm trying to pass a CString to the nodeTypedValue or NodeValue functions and its giving the error error C2064: term does not evaluate to a function taking 1 arguments the Code is given below CString t = "No Error"; pRetCode->nodeTypedValue(_variant_t(t)); Its also giving this error on this CString t; t.Format("0x%x",hr); pRetCode->nodeValue(_variant_t(t)); code> Can u plz tell me what to do here??? Thanks in advance Rocky _You can't climb up a ladder with your hands in your pockets._

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          pRetCode->nodeValue(_variant_t(**(LPCTSTR)**t));

          R 1 Reply Last reply
          0
          • L led mike

            pRetCode->nodeValue(_variant_t(**(LPCTSTR)**t));

            R Offline
            R Offline
            Rocky
            wrote on last edited by
            #5

            well actualy that problem got solved when i did something like this pTempNode->nodeTypedValue = _T("MixNSplit 12"); pNode->nodeValue = _variant_t(ObjType); Thanks I think that LPCTSTR would also come in useful somewhere for me

            Rocky You can't climb up a ladder with your hands in your pockets.

            1 Reply Last reply
            0
            • R Rocky

              hi everyone, well I gotta say this, I'm not a gr8 fan for programming in ATL/MFC but now I'm in a situation where I have to do this stuff. I'm using MSXML 4.0 in a project where I need to develop an XML log as the functions get called. I'm trying to pass a CString to the nodeTypedValue or NodeValue functions and its giving the error error C2064: term does not evaluate to a function taking 1 arguments the Code is given below CString t = "No Error"; pRetCode->nodeTypedValue(_variant_t(t)); Its also giving this error on this CString t; t.Format("0x%x",hr); pRetCode->nodeValue(_variant_t(t)); code> Can u plz tell me what to do here??? Thanks in advance Rocky _You can't climb up a ladder with your hands in your pockets._

              M Offline
              M Offline
              myshketer
              wrote on last edited by
              #6

              Olen'! when you open first parenthesis - what you see in help tooltip? There is should be enumerate of parametres in function, yes? So, how many parameteres in that function? Actually, I have meet that problem - in MS .NET Studio and MS VS 6.0 count of parametres in MSXML namespace function are dfferents. But don't wory - the absent parametr is result of DWORD types. So, pRetCode->nodeValue(_variant_t(t)); transform to DWORD dw; pRetCode->nodeValue(_variant_t(t), &dw); or some looks like thiat :)

              R 1 Reply Last reply
              0
              • M myshketer

                Olen'! when you open first parenthesis - what you see in help tooltip? There is should be enumerate of parametres in function, yes? So, how many parameteres in that function? Actually, I have meet that problem - in MS .NET Studio and MS VS 6.0 count of parametres in MSXML namespace function are dfferents. But don't wory - the absent parametr is result of DWORD types. So, pRetCode->nodeValue(_variant_t(t)); transform to DWORD dw; pRetCode->nodeValue(_variant_t(t), &dw); or some looks like thiat :)

                R Offline
                R Offline
                Rocky
                wrote on last edited by
                #7

                template HRESULT _QueryInterface(_InterfacePtr p) throw()
                {
                HRESULT hr;

                    // Can't QI NULL
                    //
                    if (p != NULL) {
                        // Query for this interface
                        //
                        Interface\* pInterface;
                        hr = p->QueryInterface(GetIID(), reinterpret\_cast(&pInterface));**//Error Statementc:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include\\comip.h(850): error C2227: left of '->QueryInterface' must point to class/struct/union**
                
                        // Save the interface without AddRef()ing.
                        //
                        Attach(SUCCEEDED(hr)? pInterface: NULL);
                    }
                    else {
                        operator=(static\_cast(NULL));
                        hr = E\_NOINTERFACE;
                    }
                
                    return hr;
                }
                

                I've got another problem now. I sorted that previous one earlier but now its reporting an error here on the variable p. I havent even touched the code in this file and I dont have any idea how this one came about. Can u give me any suggestions for this? Its using typedef to define the _Interface type but I havent foiund any typedef statement for _InterfacePtr. I tried toadd it but to no avail.

                Rocky You can't climb up a ladder with your hands in your pockets.

                M 1 Reply Last reply
                0
                • R Rocky

                  template HRESULT _QueryInterface(_InterfacePtr p) throw()
                  {
                  HRESULT hr;

                      // Can't QI NULL
                      //
                      if (p != NULL) {
                          // Query for this interface
                          //
                          Interface\* pInterface;
                          hr = p->QueryInterface(GetIID(), reinterpret\_cast(&pInterface));**//Error Statementc:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include\\comip.h(850): error C2227: left of '->QueryInterface' must point to class/struct/union**
                  
                          // Save the interface without AddRef()ing.
                          //
                          Attach(SUCCEEDED(hr)? pInterface: NULL);
                      }
                      else {
                          operator=(static\_cast(NULL));
                          hr = E\_NOINTERFACE;
                      }
                  
                      return hr;
                  }
                  

                  I've got another problem now. I sorted that previous one earlier but now its reporting an error here on the variable p. I havent even touched the code in this file and I dont have any idea how this one came about. Can u give me any suggestions for this? Its using typedef to define the _Interface type but I havent foiund any typedef statement for _InterfacePtr. I tried toadd it but to no avail.

                  Rocky You can't climb up a ladder with your hands in your pockets.

                  M Offline
                  M Offline
                  myshketer
                  wrote on last edited by
                  #8

                  I think the problem in your code when you (or system) have call QueryInterface. You can review call stack and determinate where this error ocure.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups