|
You may use the getaddrinfo() function [^].
|
|
|
|
|
In file atldef.h
#ifndef ATLASSUME
#define ATLASSUME(expr) do { ATLASSERT(expr); __analysis_assume(!!(expr)); } while(0)
#endif // ATLASSERT
I do not know why use do{} while(0), not { }.
|
|
|
|
|
Because its not while iteration it do-while iteration.
you must need to know the structure of do-while
the structure is
do
{
...
...
}while(condition);
the basic difference between while loop and do-while is
in case of while loop first it will check for condition. if it is not true statements in the while loop wont be executed.
but in case of do-while first the statement would be executed then it will check for further execution.
|
|
|
|
|
Thank you for you reply.
I know the different between do-while and while.
I do know why this Macro why not defined as following:
#define ATLASSUME(expr) { ATLASSERT(expr); __analysis_assume(!!(expr)); }
because the loop "do-while(0)" will be execute only once.
|
|
|
|
|
|
Very good answer. +5.
Thanks very much.
|
|
|
|
|
You are welcome.
Veni, vidi, vici.
|
|
|
|
|
Traitor.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Veni, vidi, vici.
|
|
|
|
|
Some compilers may complain (warning level of course) for the semicolon after the {}. do-while does not have that problem.
|
|
|
|
|
Hi I'm trying to get this to work, but I'm not sure how to get the right syntax.
template <int N>
double array_sum(double * var[N], int n, double (*f)(double var[N])) {
double ret 0.0;
for (int i = 0; i < n; ++i) {
ret += f(args);
}
return ret;
}
double mul(double var[3]) {
return var[0] * var[1] * var[2];
}
int main() {
double * length = new double[10];
double * width = new double[10];
double * height = new double[10];
array_sum({length, width, height}, 10, mul);
delete [] length;
delete [] width;
delete [] height;
return 0;
}
The function should give the volume of the described element, but vstudio says that no template matches the given data.
Thanks in advance,
G
Hah, ok I solved it, and yeah there are some syntax arguments in this, but I'll still leave this open to the group to have fun with.
modified 11-Apr-12 20:03pm.
|
|
|
|
|
Since you solved it I'm not going to try this out, but to me it seems the compiler has no way to figure out the value of the template parameter N in your code. It might work if you pass that parameter explicitely, as in
array_sum<10>(...);
Besides you don't pass the right arguments to that function pointer - and I'm not just referring to the unspecified identifier args , but also the parameter list.
On a sidenote, unless this is an exercise in learning the use of templates, that looks like an extremely complicated, awkward, and error-prone way to do some very simple calculations.
|
|
|
|
|
Say there are alot of rows and you only want to show the rows that meet a specific criteria. Is there a way to do that?
|
|
|
|
|
Are you asking something regarding the Ultimate Grid Tool. If yes, then please send a query to the Author of the article. You just go to the bottom part of the Article and you can click on new message. Ask your query there. The author will respond to your query.
Every new day is another chance to change your life.
|
|
|
|
|
I also want to know If I can Hide some rows. I did it by saving all data in a dynamic memory and adding only the desired row in to list
|
|
|
|
|
HI,
I need to migrate my Visualstudio 2008 win 32 Dll creation application to Visual Studio 6. Please suggest some tips or mention where i can get information to migrate it.
Thanks,
Krishna
|
|
|
|
|
|
|
I installed VC++ 6.0 on Windows 7 Ultimate x64.
Sometimes when I debug the MFC program, I press Shift+F5 to terminate the debug, but the program shows "not responding" and VC++ 6.0 IDE shows normally.
Then I want to kill the progress with Task Manager, but failed. I try to terminate the progress in CMD with administrator permission, still failed. Then, I download ProgressExplore.exe from Microsoft's site, and pskill.exe. I just can't terminate the disgusting progress.
When I log of Windows, the Progress can be killed and when I close VC++ 6.0 IDE, the progress automatically terminated. But as you know, it's miserable to debug programs in this way: debug one time, close the VC++ IDE one time.
Anyone can tell me how to force to kill the specific progress with overwhelming permission(just like Windows did when close or log off)?
Thank you in advance!
|
|
|
|
|
It might be better to look at your code and try to determine how your program gets into this state. Do you have a closed loop somewhere, or a process wait that cannot be stopped?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
No, I think this is the issue of incompatibility(Win7 X64 and VC6.0).
|
|
|
|
|
Falconapollo wrote: No, I think this is
Fine, now you need to do some testing to confirm it.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
did you try
taskkill /f /t /im devenv.exe
to make sure you kill the child process/app?
|
|
|
|
|
It does't work. I only want to terminate the debugged app, not VC6.0 IDE.
Thank you all the same!
|
|
|
|
|
Falconapollo wrote: Sometimes when I debug the MFC program, I press Shift+F5 to terminate the debug, but the program shows "not responding" and VC++ 6.0 IDE shows normally.
When you are debugging, on process tree debugging app is the child of the MSDEV. could you please check at what exact location it is not responding is it any hardware call or IO call!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|