|
Therefore, it seems that this compiler generates good enough code for both cases. We should be curious which behavior have other compilers in case of "if vs. ?:" problem.
|
|
|
|
|
Viorel. wrote: it seems that this compiler generates good enough code for both cases.
BTW, I am using VC++ 2005.
Maxwell Chen
|
|
|
|
|
or this
<br />
int Test(int n)<br />
{<br />
int nReturn = 0 ;<br />
switch(n)<br />
{<br />
case 0:<br />
case 1:<br />
nReturn=1;<br />
break;<br />
default:<br />
nReturn=-1;<br />
break;<br />
}<br />
return nReturn;<br />
}<br />
whitesky
|
|
|
|
|
PLZ HELPME SEND FULL CODE
how to fetch, store ,delete and update date in mysql table from MFC at run time from vc++ code(MFC)
PLZ SEND ME THIS CODE TO HELP THANKS FOR THIS
gourav dogra jfjunf
|
|
|
|
|
|
Hi,
I have lauchned an application B from my application A using ShellExecute() , it will return a Handle.
How can I track in application A that application B is closed at certain stage?
Thanks
Regards.
|
|
|
|
|
First of all what type of application you are creating.
Here you can chect the value of handle....
check if it exist...
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Does it means that If when 2nd application is closed then the handle returned by ShellExecute will automaticlay become flase or expired or null.
Regards.
|
|
|
|
|
|
I don't think there is an easy way to track an application. The Handle returned by ShellExecute() is not a handle, but a value.
There are other ways you can track an application like: Events , Mutexes etc.
this is this.
|
|
|
|
|
zahid_ash wrote: Hi,
I have lauchned an application B from my application A using ShellExecute() , it will return a Handle.
How can I track in application A that application B is closed at certain stage?
You may keep track of process by enumrating the running processes in specific time stamp.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
if u r application happens to be an .exe then u can get Processid.Using it u can track application B in Application A.This might help u.
never say die
|
|
|
|
|
Process32First and Process32Next to get the Processid:->
never say die
|
|
|
|
|
In order to see that a process was closed, you need its "handle". Please compare ShellExecuteEx and CreateProcess in order to see which is more suitable to obtain the handle. Then use the handle in the following mode:
if(::WaitForSingleObject(handle, 0) == WAIT_OBJECT_0)
{
}
else
{
}
If you want to wait until the process is closed, then specify a timeout value in WaitForSingleObject . See this function for more details.
|
|
|
|
|
Use SHELLEXECUTEINFO with ShellExecuteEx() and the structure has a member "hProcess" this is the handle to newly created process.
suhredayan There is no place like 127.0.0.1
|
|
|
|
|
HI.
I am running my application using command prompt.
like C:\> D:\App.exe
after launching this Application the command prompt come back to prompt again
like C:\>
does it means that application has been ended . but the appliccation is still running
then how can I come to know that application is still running using command prompt
thanks
Regards.
|
|
|
|
|
when you type : c:\ D:\App.exe and comes back to c:\
it will happen ...Here you are not changing the drive to access but just specifying the path of your exe.
Your exe will start as a new process ....so you have to eplicitly terminate your application
Cheers
"Peace of mind through Technology"
|
|
|
|
|
OK, Thanks.
But I have one more question that when we run Format command or some other command on Comand prompt, then why these comand are not run as new process. they usualy run in same command prompt and will not free the prompt until the command execution ends
Regards.
|
|
|
|
|
zahid_ash wrote: Format command or some other command on Comand prompt
That is because those are Command-line applications. Back in the days of DOS, all applications were Command-line.
this is this.
|
|
|
|
|
zahid_ash wrote: HI.
I am running my application using command prompt.
like C:\> D:\App.exe
after launching this Application the command prompt come back to prompt again
like C:\>
does it means that application has been ended . but the appliccation is still running
then how can I come to know that application is still running using command prompt
if the application is Command prompt based then it runs fine...
but if it is windows based then application chooses the windows platform to run and application's info enters into windows enviornment not into DOS environment even it run from command prompt.
if you want to check the application running state then you have to check into running processes by enumarating processes or any other way.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
CAN SOMEBODY HELP ME PLZ
iam using mfc with mysql
how can i fetch only single row from mysql table from vc++(MFC)
when i write
mysql_query(myDB,"SELECT * FROM empinfo4 e,proinfo4 p");
(" WHERE empid = \'" + f + "\' and e.gid = p.gid ");
res=mysql_store_result(myDB);
if (!res)
{
MessageBox("Could not run query");
}
row = mysql_fetch_row(res);
this will give the first row from the mysql table only
it will not give other rows
how can i fetch other row when i give id on form at run time and it will fetch the row which matched in the mysql table
so id is recieved by:
GetDlgItemText(IDC_EMPID,id);
here id is value which i enter in the edit control
and i want that whenever i enter id value it display only that row which matchee in the mysql table row
plz help me in this regards
hi
-- modified at 1:02 Tuesday 6th June, 2006
|
|
|
|
|
Hi all,
I'd like to know, whether itz possible to send "Integers" and "arrays" through a RS-232 interface??is there any way to do it??
Thanks in advance,
rajeev
-- modified at 0:40 Tuesday 6th June, 2006
|
|
|
|
|
The RS232 interface is just that, a simple interface. How you send data depends on your protocol.
The tigress is here
|
|
|
|
|
I believe it is possible, but you would have to send them over byte by byte, and then decoding them back to the original form at the other end. Actually much of the time, you would create an array of some data, either ASCII or Binary, but it takes the same way to send.
this is this.
|
|
|
|
|
rajeev82 wrote: I'd like to know, whether itz possible to send "Integers" and "arrays" through a RS-232 interface??is there any way to do it??
Rs232 only understand Bytes.. so you have to interpret your Sending and receiving data!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|