<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>CodeGuru Forums - Visual C++ Programming</title>
		<link>http://forums.codeguru.com</link>
		<description>Ask questions about Windows programming with Visual C++ and help others by answering their questions.</description>
		<language>en</language>
		<lastBuildDate>Wed, 16 May 2012 13:49:57 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forums.codeguru.com/images/misc/rss.jpg</url>
			<title>CodeGuru Forums - Visual C++ Programming</title>
			<link>http://forums.codeguru.com</link>
		</image>
		<item>
			<title>Looking for .bmp OR .jpg</title>
			<link>http://forums.codeguru.com/showthread.php?t=523821&amp;goto=newpost</link>
			<pubDate>Wed, 16 May 2012 08:20:11 GMT</pubDate>
			<description><![CDATA[Hi,

We have a box label at work that we print through nicelabel software. It's hooked up to a database so when you print, you enter the barcode number in, and the image is populated by finding the image number associated with the barcode number, looking for it in a folder and adding it in. We were only dealing with .bmp files, so we had some code that would basically get the image number, add .bmp at the end of it and then look for this file in the folder.

Now we've got jpgs too, we've hit a bit of a brick wall in that the execution of the script will fail because the script is looking for, for example '1111.bmp' when it's actually '1111.jpg'.

We need to add something to the script that will possibly do the first part of the code adding .bmp, then if nothing is found in the folder, rather than failing and presenting us with an error message, it just automatically looks for a .jpg version instead.

Is there any way of doing this? I don't know how it would work, something like ignoring the file extension possibly?]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
We have a box label at work that we print through nicelabel software. It's hooked up to a database so when you print, you enter the barcode number in, and the image is populated by finding the image number associated with the barcode number, looking for it in a folder and adding it in. We were only dealing with .bmp files, so we had some code that would basically get the image number, add .bmp at the end of it and then look for this file in the folder.<br />
<br />
Now we've got jpgs too, we've hit a bit of a brick wall in that the execution of the script will fail because the script is looking for, for example '1111.bmp' when it's actually '1111.jpg'.<br />
<br />
We need to add something to the script that will possibly do the first part of the code adding .bmp, then if nothing is found in the folder, rather than failing and presenting us with an error message, it just automatically looks for a .jpg version instead.<br />
<br />
Is there any way of doing this? I don't know how it would work, something like ignoring the file extension possibly?</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>TeachYourselfRunning</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523821</guid>
		</item>
		<item>
			<title>How to disable a checkbox in the class CListCtrl?</title>
			<link>http://forums.codeguru.com/showthread.php?t=523814&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 22:10:01 GMT</pubDate>
			<description>I set up checkbox style for the CListCtrl control. Now I want to disable the checkbox in the control to make checkbox read only. Is there any way I can do that? Thanks.</description>
			<content:encoded><![CDATA[<div>I set up checkbox style for the CListCtrl control. Now I want to disable the checkbox in the control to make checkbox read only. Is there any way I can do that? Thanks.</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>LarryChen</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523814</guid>
		</item>
		<item>
			<title>Image recognition in C++</title>
			<link>http://forums.codeguru.com/showthread.php?t=523811&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 20:44:22 GMT</pubDate>
			<description><![CDATA[Hi, ALL,
1. You guys were very good in the past so here I'm again asking for help.
2. I don't know if this question belongs here. If not, please don't kick me too hard. ;-)

I have a photograph taken by the Android/iPhone camera. This photo consists of:

a) background
b) white paper A4
c) human foot

Depending on the lightning condition and the position of the camera shadow will appear on the paper.

My task is to find where the foot is on this picture and get some parameters out of it.

I can successfully filter out the background and get the resulting image with just a paper and the foot.
I can successfully skip processing the paper and find where the actual foot is located.

However I can not differentiate between the actual skin of the foot and the shadow.
Now I know that the resulting pixel of an image is a (background pixel (op) paper pixel (op) shadow pixel | foot pixel). Problem is I have no idea what (op) is and will getting the foreground pixel will help.

I tried googling for "image recognition c++", There are lots and lots of theoretical books of how to do the face recognition what is this algorythm and why it is preferred over that algorythm. But there is no simple: you need to find this compazre with that if they don't match you found the edge.
If they match you need to find the foreground pixel by doing a, b and c.

So my question is: What would be the way of finding out the foreground rgb value of pixel and will it help in my case?

I'm not doing face recgnition which is far more hard task. This is foot, the shape is known and the position is somewhere in the middle of the paper.

Thank you in advance for any hints.]]></description>
			<content:encoded><![CDATA[<div>Hi, ALL,<br />
1. You guys were very good in the past so here I'm again asking for help.<br />
2. I don't know if this question belongs here. If not, please don't kick me too hard. ;-)<br />
<br />
I have a photograph taken by the Android/iPhone camera. This photo consists of:<br />
<br />
a) background<br />
b) white paper A4<br />
c) human foot<br />
<br />
Depending on the lightning condition and the position of the camera shadow will appear on the paper.<br />
<br />
My task is to find where the foot is on this picture and get some parameters out of it.<br />
<br />
I can successfully filter out the background and get the resulting image with just a paper and the foot.<br />
I can successfully skip processing the paper and find where the actual foot is located.<br />
<br />
However I can not differentiate between the actual skin of the foot and the shadow.<br />
Now I know that the resulting pixel of an image is a (background pixel (op) paper pixel (op) shadow pixel | foot pixel). Problem is I have no idea what (op) is and will getting the foreground pixel will help.<br />
<br />
I tried googling for &quot;image recognition c++&quot;, There are lots and lots of theoretical books of how to do the face recognition what is this algorythm and why it is preferred over that algorythm. But there is no simple: you need to find this compazre with that if they don't match you found the edge.<br />
If they match you need to find the foreground pixel by doing a, b and c.<br />
<br />
So my question is: What would be the way of finding out the foreground rgb value of pixel and will it help in my case?<br />
<br />
I'm not doing face recgnition which is far more hard task. This is foot, the shape is known and the position is somewhere in the middle of the paper.<br />
<br />
Thank you in advance for any hints.</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>OneEyeMan</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523811</guid>
		</item>
		<item>
			<title>Controlling mouse through keyboard</title>
			<link>http://forums.codeguru.com/showthread.php?t=523803&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 15:19:39 GMT</pubDate>
			<description>Hi I want to create a service/app where i can control the mouse through my keyboard.
Any tips to get me started? Will this involve hooks? 
Just a little push in the right direction.</description>
			<content:encoded><![CDATA[<div>Hi I want to create a service/app where i can control the mouse through my keyboard.<br />
Any tips to get me started? Will this involve hooks? <br />
Just a little push in the right direction.</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>vinayak4gargya</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523803</guid>
		</item>
		<item>
			<title>What does this source code do?</title>
			<link>http://forums.codeguru.com/showthread.php?t=523795&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 12:02:31 GMT</pubDate>
			<description><![CDATA[I am still unable to understand how this source code extracts text from dialog box controls within a given rectangle boundry of a 3rd party application?




Code:
---------
HHOOK	hHook = NULL;
TCHAR	szBuff[2048]; // any buffer
CString ScrapeText(HWND hWnd, RECT& rect)
{
	hHook = SetWindowHookEx(WH_CALLWNDPROC, (HOOKPROC)CallWndProc, AfxGetApp()->GetCurrentInstance(), GetCurrentThread);
		
	RedrawWindow(hWnd, (const RECT*)&rect, NULL,RDW_ALLCHILDREN);

	// unhook after processing
	UnHookWindowsEx(hHook);
	return szBuff; // after concactenation from hook procedure
}

LRESULT CALLBACK CallWndProc(int nCode, WPARAM wParam, LPARAM lParam )
{
	if( nCode < 0 )
		return CallNextHookEx( hHook, nCode, wParam, lParam);

	MSG* pMsg = (MSG*)lParam;

	switch( nCode )
	{
	case HC_ACTION:
		if( pMsg->message == WM_SETTEXT && CLASSOF(pMsg->hWnd) ){
			_tcscat(szBuff, (LPCTSTR)lParam);
		}
		break;
	default:
		break;
	}
	return CallNextHookEx(hHook, nCode, wParam, lParam);
}
---------
]]></description>
			<content:encoded><![CDATA[<div>I am still unable to understand how this source code extracts text from dialog box controls within a given rectangle boundry of a 3rd party application?<br />
<br />
<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">HHOOK&nbsp; &nbsp; &nbsp; &nbsp; hHook = NULL;<br />
TCHAR&nbsp; &nbsp; &nbsp; &nbsp; szBuff[2048]; // any buffer<br />
CString ScrapeText(HWND hWnd, RECT&amp; rect)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; hHook = SetWindowHookEx(WH_CALLWNDPROC, (HOOKPROC)CallWndProc, AfxGetApp()-&gt;GetCurrentInstance(), GetCurrentThread);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; RedrawWindow(hWnd, (const RECT*)&amp;rect, NULL,RDW_ALLCHILDREN);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // unhook after processing<br />
&nbsp; &nbsp; &nbsp; &nbsp; UnHookWindowsEx(hHook);<br />
&nbsp; &nbsp; &nbsp; &nbsp; return szBuff; // after concactenation from hook procedure<br />
}<br />
<br />
LRESULT CALLBACK CallWndProc(int nCode, WPARAM wParam, LPARAM lParam )<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; if( nCode &lt; 0 )<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return CallNextHookEx( hHook, nCode, wParam, lParam);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; MSG* pMsg = (MSG*)lParam;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; switch( nCode )<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; case HC_ACTION:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( pMsg-&gt;message == WM_SETTEXT &amp;&amp; CLASSOF(pMsg-&gt;hWnd) ){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _tcscat(szBuff, (LPCTSTR)lParam);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
&nbsp; &nbsp; &nbsp; &nbsp; default:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; return CallNextHookEx(hHook, nCode, wParam, lParam);<br />
}</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>maverick786us</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523795</guid>
		</item>
		<item>
			<title>Forms</title>
			<link>http://forums.codeguru.com/showthread.php?t=523792&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 09:50:47 GMT</pubDate>
			<description>hello people.i have two forms,form1 and form2,how do i call form2 on form1 with a  button??</description>
			<content:encoded><![CDATA[<div>hello people.i have two forms,form1 and form2,how do i call form2 on form1 with a  button??</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>dotyp12</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523792</guid>
		</item>
		<item>
			<title>MFC help : code error 0000007B</title>
			<link>http://forums.codeguru.com/showthread.php?t=523790&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 08:02:29 GMT</pubDate>
			<description><![CDATA[hi,
i'm developing GUI using MFC in vs2008. i have developed code and it builds fine but when i debug my code, it gives system error 0000007B. part of the code that gives this error is given below + variable initialization.


int COMportNum= 3;
portstream_fd COMstream;
portstream_fd pstream;
char COMportPrefix[10] = "COM";
char COMportName[256];
 
sprintf(COMportName, "%s%d", COMportPrefix, COMportNum); // initialize serial port COM3
 
strng = CString(COMportName);
strng.Format(_T("%0.9s"), strng);
SetDlgItemText(IDC_STAT, strng);
 
set_baud_rate(BaudRate);
COMstream = open_host_port(COMportName); //opens serial port COM3
 
if ( COMstream == PORT_NOT_OPENED ) //conditional check if COM3 is opened
{
stw.Format(_T("%08X"), GetLastError()); //generates error if any
SetDlgItemText(IDC_PTUPORT, stw);
}
else 
SetDlgItemText(IDC_PTUPORT, (LPCTSTR) L"Ok");


can anyone please help me with this error.
Regards
Jawad]]></description>
			<content:encoded><![CDATA[<div>hi,<br />
i'm developing GUI using MFC in vs2008. i have developed code and it builds fine but when i debug my code, it gives system error 0000007B. part of the code that gives this error is given below + variable initialization.<br />
<br />
<br />
int COMportNum= 3;<br />
portstream_fd COMstream;<br />
portstream_fd pstream;<br />
char COMportPrefix[10] = &quot;COM&quot;;<br />
char COMportName[256];<br />
 <br />
sprintf(COMportName, &quot;%s%d&quot;, COMportPrefix, COMportNum); // initialize serial port COM3<br />
 <br />
strng = CString(COMportName);<br />
strng.Format(_T(&quot;%0.9s&quot;), strng);<br />
SetDlgItemText(IDC_STAT, strng);<br />
 <br />
set_baud_rate(BaudRate);<br />
COMstream = open_host_port(COMportName); //opens serial port COM3<br />
 <br />
if ( COMstream == PORT_NOT_OPENED ) //conditional check if COM3 is opened<br />
{<br />
stw.Format(_T(&quot;%08X&quot;), GetLastError()); //generates error if any<br />
SetDlgItemText(IDC_PTUPORT, stw);<br />
}<br />
else <br />
SetDlgItemText(IDC_PTUPORT, (LPCTSTR) L&quot;Ok&quot;);<br />
<br />
<br />
can anyone please help me with this error.<br />
Regards<br />
Jawad</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>jawadali477</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523790</guid>
		</item>
		<item>
			<title>Raster operations. Exchange between windows.</title>
			<link>http://forums.codeguru.com/showthread.php?t=523788&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 07:41:39 GMT</pubDate>
			<description><![CDATA[Hi!
In my MFC doc/view programm I have two classes with their windows. The first one is view, the second is a dialog. The view is constantly displaying image form camera. I want the second window, dialog, to show the image that has been in view when some event happens, in picture control actually.

I know how to show picture from program resources or from disk, and my code does it fine.
And I have some functions in view. Some of them get picture from view and can save it at disk.

But when I try to pass somehow image from view to dialog, even if no errors occure - nothing happens, nothing is drawn. I tried to pass pointer of CBitmap of actual DC of the view. I tried to pass BITMAP structures. By the way every part of this structures like some information goes fine, but no image itself. It seems to me there are some problems with "passing" pixelsbits.

so, I'll be glad to any help: ideas, examples, concepts)
Thanks in advance!]]></description>
			<content:encoded><![CDATA[<div>Hi!<br />
In my MFC doc/view programm I have two classes with their windows. The first one is view, the second is a dialog. The view is constantly displaying image form camera. I want the second window, dialog, to show the image that has been in view when some event happens, in picture control actually.<br />
<br />
I know how to show picture from program resources or from disk, and my code does it fine.<br />
And I have some functions in view. Some of them get picture from view and can save it at disk.<br />
<br />
But when I try to pass somehow image from view to dialog, even if no errors occure - nothing happens, nothing is drawn. I tried to pass pointer of CBitmap of actual DC of the view. I tried to pass BITMAP structures. By the way every part of this structures like some information goes fine, but no image itself. It seems to me there are some problems with &quot;passing&quot; pixelsbits.<br />
<br />
so, I'll be glad to any help: ideas, examples, concepts)<br />
Thanks in advance!</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>330xi</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523788</guid>
		</item>
		<item>
			<title>Enumerating Child Windows</title>
			<link>http://forums.codeguru.com/showthread.php?t=523786&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 06:39:00 GMT</pubDate>
			<description>I have the handle to a 3rd party DialogWindow (lets say 0x10056) now I want to enumerate the handes number of child windows present in that. How can I accompalish this?
 
Thanks in Advance</description>
			<content:encoded><![CDATA[<div>I have the handle to a 3rd party DialogWindow (lets say 0x10056) now I want to enumerate the handes number of child windows present in that. How can I accompalish this?<br />
 <br />
Thanks in Advance</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>maverick786us</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523786</guid>
		</item>
		<item>
			<title>Extracting Text from a Dialog Window</title>
			<link>http://forums.codeguru.com/showthread.php?t=523784&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 04:57:17 GMT</pubDate>
			<description><![CDATA[How can I extract text from an existing Dialog Window? Its a 3rd party dialog window so I don't have the source code of it. I have to extract text from its Lables and Text box. I think for extracting text from TextBox we can use WM_COPYDATA message (Not sure) But how can I extract text from labels of a dialog Window?]]></description>
			<content:encoded><![CDATA[<div>How can I extract text from an existing Dialog Window? Its a 3rd party dialog window so I don't have the source code of it. I have to extract text from its Lables and Text box. I think for extracting text from TextBox we can use WM_COPYDATA message (Not sure) But how can I extract text from labels of a dialog Window?</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>maverick786us</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523784</guid>
		</item>
		<item>
			<title>flash runs c/c++</title>
			<link>http://forums.codeguru.com/showthread.php?t=523783&amp;goto=newpost</link>
			<pubDate>Tue, 15 May 2012 04:47:18 GMT</pubDate>
			<description><![CDATA[Develop a 386 cpu virtual machine using Flash as3. The simulator runs 386 assemble code by interpretive execution. And the the assemble code is disassembled from the exe file that compiled from c/c++. In this way c/c++ programs can run in flash.
c/c++ will call operating API, that can be hooked and redirected to flash API. Special operating APIs may not work, for flash does not support.
The whole system(disassemble & simulator) is called c2flash for short.]]></description>
			<content:encoded><![CDATA[<div>Develop a 386 cpu virtual machine using Flash as3. The simulator runs 386 assemble code by interpretive execution. And the the assemble code is disassembled from the exe file that compiled from c/c++. In this way c/c++ programs can run in flash.<br />
c/c++ will call operating API, that can be hooked and redirected to flash API. Special operating APIs may not work, for flash does not support.<br />
The whole system(disassemble &amp; simulator) is called c2flash for short.</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>zhaolei_cpp</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523783</guid>
		</item>
		<item>
			<title>Functions, call and ref statements with for loops, output two separate tabless?</title>
			<link>http://forums.codeguru.com/showthread.php?t=523771&amp;goto=newpost</link>
			<pubDate>Mon, 14 May 2012 18:33:13 GMT</pubDate>
			<description><![CDATA[Need a little help please:
i have been trying to complete this for a couple days but i get more and more confused everytime i try.

When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period.
D = ½ gt^2

The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time in second that the object has been falling.
Write a function named fallingDistance that accepts an object’s falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Write a program that demonstrates the function by calling it in a loop that passes the values 1 though 10 as arguments, and displays the return value.

*Additional to this problem my prof wants two functions that calculate the falling distance.
function 1 passes arguments by value
function 2 passes argument by reference

outputs should be in form of a table

whats confusing is the prof established that in the main it should resemeble like this:

main()
{
for(--------------)
call (by value)
output

for(---------------------)
call (by reference)
output

        my code so far
call by ref works fine but call by value only works when i put double d as global but then it only comes back as 0's in the output. its not reading the equation.
--------------------------

# include <iostream>
# include <cmath>
# include <string>
using namespace std;

void fallingDistance2(double &);
double fallingDistance1(double);
const double g = 9.8;
int t;
double d;

int main()
{


	cout<<"calculated by passby values.\n";
	cout<<"Time \t\t Distance\n";
	cout<<"-------------------\n";
	for (t=1;t<=10;t++)
	{
		fallingDistance1(d);
		cout<<t<<"\t\t"<<d<<endl;
	}
	
	
	cout<<"calculated by reference values.\n";
	cout<<"Time \t\t Distance\n";
	cout<<"-------------------\n";
	for (t=1;t<=10;t++)
	{
		fallingDistance2(d);
		cout<<t<<"\t\t"<<d<<endl;
	}


	return 0;
}


double fallingDistance1(double d)
{
	d=0.5*9.8*t*t;
	return d;
}

void fallingDistance2(double &refd)
{
			refd=0.5*9.8*t*t;
}]]></description>
			<content:encoded><![CDATA[<div>Need a little help please:<br />
i have been trying to complete this for a couple days but i get more and more confused everytime i try.<br />
<br />
When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period.<br />
D = ½ gt^2<br />
<br />
The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time in second that the object has been falling.<br />
Write a function named fallingDistance that accepts an object’s falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Write a program that demonstrates the function by calling it in a loop that passes the values 1 though 10 as arguments, and displays the return value.<br />
<br />
*Additional to this problem my prof wants two functions that calculate the falling distance.<br />
function 1 passes arguments by value<br />
function 2 passes argument by reference<br />
<br />
outputs should be in form of a table<br />
<br />
whats confusing is the prof established that in the main it should resemeble like this:<br />
<br />
main()<br />
{<br />
for(--------------)<br />
call (by value)<br />
output<br />
<br />
for(---------------------)<br />
call (by reference)<br />
output<br />
<br />
        my code so far<br />
call by ref works fine but call by value only works when i put double d as global but then it only comes back as 0's in the output. its not reading the equation.<br />
--------------------------<br />
<br />
# include &lt;iostream&gt;<br />
# include &lt;cmath&gt;<br />
# include &lt;string&gt;<br />
using namespace std;<br />
<br />
void fallingDistance2(double &amp;);<br />
double fallingDistance1(double);<br />
const double g = 9.8;<br />
int t;<br />
double d;<br />
<br />
int main()<br />
{<br />
<br />
<br />
	cout&lt;&lt;&quot;calculated by passby values.\n&quot;;<br />
	cout&lt;&lt;&quot;Time \t\t Distance\n&quot;;<br />
	cout&lt;&lt;&quot;-------------------\n&quot;;<br />
	for (t=1;t&lt;=10;t++)<br />
	{<br />
		fallingDistance1(d);<br />
		cout&lt;&lt;t&lt;&lt;&quot;\t\t&quot;&lt;&lt;d&lt;&lt;endl;<br />
	}<br />
	<br />
	<br />
	cout&lt;&lt;&quot;calculated by reference values.\n&quot;;<br />
	cout&lt;&lt;&quot;Time \t\t Distance\n&quot;;<br />
	cout&lt;&lt;&quot;-------------------\n&quot;;<br />
	for (t=1;t&lt;=10;t++)<br />
	{<br />
		fallingDistance2(d);<br />
		cout&lt;&lt;t&lt;&lt;&quot;\t\t&quot;&lt;&lt;d&lt;&lt;endl;<br />
	}<br />
<br />
<br />
	return 0;<br />
}<br />
<br />
<br />
double fallingDistance1(double d)<br />
{<br />
	d=0.5*9.8*t*t;<br />
	return d;<br />
}<br />
<br />
void fallingDistance2(double &amp;refd)<br />
{<br />
			refd=0.5*9.8*t*t;<br />
}</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>eortiz10</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523771</guid>
		</item>
		<item>
			<title>How can I show a Customized Message in a Browser Window?</title>
			<link>http://forums.codeguru.com/showthread.php?t=523761&amp;goto=newpost</link>
			<pubDate>Mon, 14 May 2012 14:11:21 GMT</pubDate>
			<description><![CDATA[Hi All,

I'm injecting the DLL. With Server Response, there is also a Send and Receive process happens. So, I'm modifying the received buffer with the Customized message and showing this message into the Browser Window, it successfully worked for all Browsers. But, when there is no Send and Receive happens; means no Server Response; then how can I show the Customized message in the Browser Window??

Pls help..

*Rajesh*]]></description>
			<content:encoded><![CDATA[<div>Hi All,<br />
<br />
I'm injecting the DLL. With Server Response, there is also a Send and Receive process happens. So, I'm modifying the received buffer with the Customized message and showing this message into the Browser Window, it successfully worked for all Browsers. But, when there is no Send and Receive happens; means no Server Response; then how can I show the Customized message in the Browser Window??<br />
<br />
Pls help..<br />
<br />
<b><i>Rajesh</i></b></div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>rajeshcode@hotmail.c</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523761</guid>
		</item>
		<item>
			<title>CreateProcess( fails when file name same similar with Directory name</title>
			<link>http://forums.codeguru.com/showthread.php?t=523755&amp;goto=newpost</link>
			<pubDate>Mon, 14 May 2012 08:14:34 GMT</pubDate>
			<description><![CDATA[Hi Forum


Code:
---------
      if ( CreateProcess(
          NULL,          /* Module name is in the next parameter.             */
          cmd_buf,     /* Command to execute.                               */
          NULL,          /* Process security attributes - not inheritable.    */
          NULL,          /* Thread security attributes - not inheritable.     */
          FALSE,        /* Don't inherit handles.                            */
          0,                /* No special priority or console classification.    */
          NULL,          /* My environment is good enough for you.            */
          NULL,          /* Don't change the current working directory.       */
          &siStartup,   /* Start-up info.                                    */
          &piProcess)) { /* Process info.  Includes process & thread ids.     */
---------
I am trying to create a process at this path
C:\Documents and Settings\abc.exe
works file for me

But 
If I have a file called Documents in C drive like 
C:\Documents

this call fails

Any suggestions how to tackle this?]]></description>
			<content:encoded><![CDATA[<div>Hi Forum<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&nbsp; &nbsp; &nbsp; if ( CreateProcess(<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NULL,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* Module name is in the next parameter.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmd_buf,&nbsp; &nbsp;  /* Command to execute.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NULL,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* Process security attributes - not inheritable.&nbsp; &nbsp; */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NULL,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* Thread security attributes - not inheritable.&nbsp; &nbsp;  */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FALSE,&nbsp; &nbsp; &nbsp; &nbsp; /* Don't inherit handles.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* No special priority or console classification.&nbsp; &nbsp; */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NULL,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* My environment is good enough for you.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NULL,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* Don't change the current working directory.&nbsp; &nbsp; &nbsp;  */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;siStartup,&nbsp;  /* Start-up info.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;piProcess)) { /* Process info.&nbsp; Includes process &amp; thread ids.&nbsp; &nbsp;  */</code><hr />
</div>I am trying to create a process at this path<br />
C:\Documents and Settings\abc.exe<br />
works file for me<br />
<br />
But <br />
If I have a file called Documents in C drive like <br />
C:\Documents<br />
<br />
this call fails<br />
<br />
Any suggestions how to tackle this?</div>

]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>softmessager</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523755</guid>
		</item>
		<item>
			<title>Build COM library for AutoCAD(AutoLisp)</title>
			<link>http://forums.codeguru.com/showthread.php?t=523753&amp;goto=newpost</link>
			<pubDate>Mon, 14 May 2012 06:58:02 GMT</pubDate>
			<description><![CDATA[I try to build a COM library for AutoCAD(autolisp) using VS 2008 ATL Project. But if the library return type is 'unsigned', then the autoCAD will show as 'variant' type. For example, if return unsigned long 12345, then the autoCAD will show #<variant 19 12345>. 

Can anyone help me to solve this issue?

I attach the sample testing project file and sample AutoLisp script.]]></description>
			<content:encoded><![CDATA[<div>I try to build a COM library for AutoCAD(autolisp) using VS 2008 ATL Project. But if the library return type is 'unsigned', then the autoCAD will show as 'variant' type. For example, if return unsigned long 12345, then the autoCAD will show #&lt;variant 19 12345&gt;. <br />
<br />
Can anyone help me to solve this issue?<br />
<br />
I attach the sample testing project file and sample AutoLisp script.</div>


	<br />
	<div style="padding:3px">

	

	

	

	
		<fieldset class="fieldset">
			<legend>Attached Files</legend>
			<table cellpadding="0" cellspacing="3" border="0">
			<tr>
	<td><img class="inlineimg" src="http://forums.codeguru.com/images/attach/zip.gif" alt="File Type: zip" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
	<td><a href="http://forums.codeguru.com/attachment.php?attachmentid=29623&amp;d=1336978654">TestCOMAutoLISP.zip</a> (21.7 KB)</td>
</tr>
			</table>
		</fieldset>
	

	</div>
]]></content:encoded>
			<category domain="http://forums.codeguru.com/forumdisplay.php?f=7">Visual C++ Programming</category>
			<dc:creator>koolorochi</dc:creator>
			<guid isPermaLink="true">http://forums.codeguru.com/showthread.php?t=523753</guid>
		</item>
	</channel>
</rss>

