CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2021
    Posts
    11

    TRACE MACRO problem in MFC

    I'm able to see the data via watch list and cursor over var but unable to print the data via TRACE using specifiers %lf or any other specifiers
    the results keep showing 0.000000
    I even set the var to a local var and it still only shows 0.000000
    all the numerical data I use through out my program is doubles

    Code:
    //for testing purposes of the tribuffer
    void CCubeShapes::TestTriBuffer(CTriangleDepthBuffer* TriBuf)
    {
    	//TRACE("\naddress of tribuf: %i\n"), TriBuf;
    	POSITION pos = NULL;
    	CTriangle* tri = NULL;
    	double res;
    	if (!TriBuf->m_listoftriangles.IsEmpty())
    	{
    		if (pos = TriBuf->m_listoftriangles.GetHeadPosition())
    		{
    			tri = TriBuf->m_listoftriangles.GetAt(pos);
    			TRACE("\nheadpos distance %lf \n"), res=tri->depth;
    		}
    		while (pos)
    		{
    			TriBuf->m_listoftriangles.GetNext(pos);
    			if (pos)
    			{				
    				tri = TriBuf->m_listoftriangles.GetAt(pos);
    				res = tri->depth;
    				TRACE("\ngetnext distance %lf \n"), res;
    			}
    		}
    
    	}
    }

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,112

    Re: TRACE MACRO problem in MFC

    And what value did you expect to be printed with this TRACE?
    Victor Nijegorodov

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,112

    Re: TRACE MACRO problem in MFC

    Quote Originally Posted by jstoll View Post
    Code:
    //for testing purposes of the tribuffer
    void CCubeShapes::TestTriBuffer(CTriangleDepthBuffer* TriBuf)
    {
    	...
    			{				
    				tri = TriBuf->m_listoftriangles.GetAt(pos);
    				res = tri->depth;
    				TRACE("\ngetnext distance %lf \n"), res;
    			}
    		}
    
    	}
    }
    Wouldn't you like to change this to something like
    Code:
    			{				
    				tri = TriBuf->m_listoftriangles.GetAt(pos);
    				res = tri->depth;
    				TRACE("\ngetnext distance %lf \n", res);
    			}
    Victor Nijegorodov

  4. #4
    Join Date
    Aug 2021
    Posts
    11

    Re: TRACE MACRO problem in MFC

    thank you sir, definitly a typographic error was the problem,i didn't even notice it i'm suprised it even compiled that way

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured