﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Bluebit Software Support Forum / Technical Support and Help / Matrix ActiveX Component  / Using Bluebit with C++ / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Bluebit Software Support Forum</description><link>http://www.bluebit.gr/forum/</link><webMaster>support@bluebit.gr</webMaster><lastBuildDate>Wed, 08 Feb 2012 18:16:34 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Using Bluebit with C++</title><link>http://www.bluebit.gr/forum/Topic438-1-1.aspx</link><description>I finally got the program to work.  &lt;/P&gt;&lt;P&gt;I declared a IMatrixPtr tempPtr;&lt;/P&gt;&lt;P&gt;tempPtr = pLeftMatrix-&amp;gt;Transpose(&amp;amp;pRtMatrix)&lt;/P&gt;&lt;P&gt;pTLftMatrix = tempPtr.Detach();&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Marmot</description><pubDate>Fri, 05 Oct 2007 13:30:24 GMT</pubDate><dc:creator>Marmot</dc:creator></item><item><title>RE: Using Bluebit with C++</title><link>http://www.bluebit.gr/forum/Topic438-1-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;You know I am creeping along here. And I am wondering if some of my troubles are related to the program not recognizing our registered copy of the program.&lt;/P&gt;&lt;P&gt;pMatrix is the transpose of pMatrix2&lt;/P&gt;&lt;P&gt;pMatrix2 is a 10 X 3 matrix and pMatrix is a 3 X 10 matrix and pMatrix3 should be a 3 X 3 matrix.   &lt;/P&gt;&lt;P&gt;pMatrix3 = pMatrix-&amp;gt;Times(&amp;amp;pMatrix2);&lt;/P&gt;&lt;P&gt;   pMatrix3-&amp;gt;GetCols();  //This causes an exception&lt;/P&gt;&lt;P&gt;So what am I doing wrong?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Marmot</description><pubDate>Tue, 02 Oct 2007 16:47:45 GMT</pubDate><dc:creator>Marmot</dc:creator></item><item><title>RE: Using Bluebit with C++</title><link>http://www.bluebit.gr/forum/Topic438-1-1.aspx</link><description>Hi &lt;/P&gt;&lt;P&gt;Your suggestion was helpful.  But I have already looked at that example.  It is very limited.  I set the items using SetItem(long, long, double)?&lt;/P&gt;&lt;P&gt;When I do a GetString(long, linedelimitors), I don't get the matrix back.&lt;/P&gt;&lt;P&gt;CString temp;&lt;/P&gt;&lt;P&gt;temp.Format("%s", A-&amp;gt;GetString(5, ""));&lt;/P&gt;&lt;P&gt;Is there some help for the C++ function calls?&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Marmot</description><pubDate>Tue, 02 Oct 2007 15:39:58 GMT</pubDate><dc:creator>Marmot</dc:creator></item><item><title>RE: Using Bluebit with C++</title><link>http://www.bluebit.gr/forum/Topic438-1-1.aspx</link><description>Hello, &lt;P&gt;In the "Samples\C++ Demo" folder (default install location "C:\Program Files\Matrix ActiveX Component 3.1\Samples\C++ Demo" ) we have a C++ project which demonstrates the use of MaXC with C++.&lt;/P&gt;&lt;P&gt;In order to set a matrix element you should use:&lt;/P&gt;&lt;P&gt;[code]A-&amp;gt;PutItem( row, col, val);[/code]</description><pubDate>Tue, 02 Oct 2007 12:02:00 GMT</pubDate><dc:creator>Trifon</dc:creator></item><item><title>Using Bluebit with C++</title><link>http://www.bluebit.gr/forum/Topic438-1-1.aspx</link><description>Hi,&lt;P&gt;I am trying to use your product to find the best fit parabola for data we have collected in a C++ .NET 2003 Unmanaged code program.&lt;/P&gt;&lt;P&gt;Below is my code:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/P&gt;&lt;P&gt;::CoInitialize(NULL);&lt;/P&gt;&lt;P&gt;hr = ::CoCreateInstance(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;__uuidof&lt;/FONT&gt;&lt;FONT size=2&gt;(Matrix), NULL, CLSCTX_INPROC, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;__uuidof&lt;/FONT&gt;&lt;FONT size=2&gt;(IMatrix), (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt;**)&amp;amp;pLftMatrix);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt;(FAILED(hr))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; result;&lt;/P&gt;&lt;P&gt;hr = ::CoCreateInstance(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;__uuidof&lt;/FONT&gt;&lt;FONT size=2&gt;(Matrix), NULL, CLSCTX_INPROC, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;__uuidof&lt;/FONT&gt;&lt;FONT size=2&gt;(IMatrix), (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt;**)&amp;amp;pRtMatrix);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt;(FAILED(hr))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; result;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//Set the Left Matrix size&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;pLftMatrix-&amp;gt;Size(nDataPts + 1, 3);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//Set the Right Matrix size&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;pRtMatrix-&amp;gt;Size(nDataPts + 1, 1);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//Fill the matrices with data&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;for&lt;/FONT&gt;&lt;FONT size=2&gt; (i = 0; i &amp;lt;= nDataPts; i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;pLftMatrix-&amp;gt;Item[i][0] = 1;&lt;/P&gt;&lt;P&gt;pLftMatrix-&amp;gt;Item[i][1] = zPos[i];&lt;/P&gt;&lt;P&gt;pLftMatrix-&amp;gt;Item[i][2] = zPos[i] * zPos[i];&lt;/P&gt;&lt;P&gt;pRtMatrix-&amp;gt;Item[i][0] = thickness[i];&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;pTLftMatrix = pLftMatrix-&amp;gt;Transpose();&lt;/P&gt;&lt;P&gt;/*My program dies here.  The call pTLftMatrix-&amp;gt;Cols causes an exception.  What am I doing wrong?  Also  How can I capture the exceptions.  I have a catch for : &lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;P&gt;catch&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; (_com_error&amp;amp; e)  &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;But it doesn't catch it.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;Below is the rest of my code.*/&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;errMsg.Format("TLeftMatrix Cols = %s", pTLftMatrix-&amp;gt;Cols);&lt;/P&gt;&lt;P&gt;errMsg.Format("LeftMatrix Rows = %s", pLftMatrix-&amp;gt;Rows);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt;(pTLftMatrix-&amp;gt;Cols == pLftMatrix-&amp;gt;Rows)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;tempPtr = pTLftMatrix-&amp;gt;Times(&amp;amp;pLftMatrix);&lt;/P&gt;&lt;P&gt;p3X3LftMatrix = tempPtr-&amp;gt;Clone();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt;(pTLftMatrix-&amp;gt;Cols == pRtMatrix-&amp;gt;Rows)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;tempPtr = pTLftMatrix-&amp;gt;Times(&amp;amp;pRtMatrix);&lt;/P&gt;&lt;P&gt;p3X1RtMatrix = tempPtr-&amp;gt;Clone();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;pSolveMatrix = p3X3LftMatrix-&amp;gt;SolveGauss(&amp;amp;p3X1RtMatrix);&lt;/P&gt;&lt;P&gt;result.thickness = pSolveMatrix-&amp;gt;Item[0][0] - (pSolveMatrix-&amp;gt;Item[1][0] * pSolveMatrix-&amp;gt;Item[1][0] / 4 * pSolveMatrix-&amp;gt;Item[2][0]);&lt;/P&gt;&lt;P&gt;result.zPos = -pSolveMatrix-&amp;gt;Item[1][0] / 2 * pSolveMatrix-&amp;gt;Item[2][0];&lt;/P&gt;&lt;P&gt;result.density = 0;&lt;/P&gt;&lt;P&gt;result.Successful = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt;(pLftMatrix)&lt;/P&gt;&lt;P&gt;pLftMatrix-&amp;gt;Release();&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt;(pRtMatrix)&lt;/P&gt;&lt;P&gt;pRtMatrix-&amp;gt;Release();&lt;/P&gt;&lt;P&gt;Do you have more examples for using the ActiveX component with C++?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Diane&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;FONT color=#008000 size=2&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;FONT color=#008000 size=2&gt; &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;</description><pubDate>Mon, 01 Oct 2007 20:55:21 GMT</pubDate><dc:creator>Marmot</dc:creator></item></channel></rss>
