|
I don't know about the thema, so I can not help you a lot. But if you LOAD ... is there an "unload"??
I mean somthing like with the DLL, it can be there... but it is reached (in dinamic linking) only when LoadLibrary is called, and so far as FreeLibrary is not called.
Is it possible to do that in your question?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Please don't guess like this.
|
|
|
|
|
I am sorry if you didn't like it but, sometimes, "silly/simple" guesses from non-prof people can give you the idea to the solution.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Not when they are so much of a guess; that is a nice way of saying innacurate. You are accomplishing nothing except clutter this thread; I will ignore you from now on.
|
|
|
|
|
Hi,
Is there a way for me to automatically call an original member function from an overloaded function?
Like let's say I have a class, Class, which is inherited from BaseClass. BaseClass has member function "OnSave" and Class has its own version of "OnSave." Is there a way I can automatically have Class's OnSave call BaseClass's OnSave whenever it is called?
I don't want to do something like:
BaseClass::OnSave();
I want it to automatically call its inherited OnSave without me having to put that line of code in.
Thanks!
KR
|
|
|
|
|
KellyR wrote: I want it to automatically call its inherited OnSave without me having to put that line of code in.
You need to specifically/explicitly call the base class implementation.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Calling base class version of function is your or rather implementation "need".
There is not such implicit mechanism available for that and can not be provided due to resaon stated in my first argument.
|
|
|
|
|
drugs are bad !
|
|
|
|
|
Agreed!!
www.wickedorange.com
www.andrewvos.com
|
|
|
|
|
|
KellyR wrote: BaseClass::OnSave();
IFAIK this is the only way to call the base class member.
Regards,
Paresh.
|
|
|
|
|
I want to animate an object(lets say a square that continualy rotates around)
and then able to select it and drag it to a differnt posistion with a mouse/keyboard
I have a very basic understanding of mfc, my guess to go about this
is to use a loop in the ondraw section with the settimer function
but I get a bit confused on how the mouse/keyboard listner will be implemented
would anybody be kind enough on giving me a quick explaination or soloution to the above mentioned.
thank you
Simon
Simon
-- modified at 18:11 Tuesday 6th November, 2007
|
|
|
|
|
Simon, why did you cross post this into the Vista forum?
Don't you think books and articles on the internet are available that discuss and provide examples of animation? Probably even some on this site.
|
|
|
|
|
led mike wrote: Simon, why did you cross post this into the Vista forum?
Probably he wants his animation Vista compatible?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
For animate an object MSDN has an article that I think its helpful for you I think its name was Cube.
|
|
|
|
|
And to Drag-Drop a way to do it is:
1) When MouseDown save the point of the click and set a bool variable i.e. bAllowMoving to TRUE
2) OnMouseMove, ask bAllowMoving, if TRUE, update the saved point with the actual coordinates
3) When MouseUp, if the bAllowMoving is TRUE, get the last point of the click-release, move your object to that point, erase background and update window/view. And reset the bAllowMoving.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
NickYan wrote: i need to get those 2 separate codes into one source code...
What in the world does this mean?
NickYan wrote: ...which will ask the user to either convert from binary to decimal vice versa
You've coded all of this, yet you cannot figure out how to ask a question and call a different function depending on the answer.
printf("Convert to (b)in or (d)ecimal? ");
char c;
scanf("%c", &c);
if ('b' == c)
bintodec();
else if ('d' == c)
dectobin();
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: You've coded all of this, yet you cannot figure out how to ask a question and call a different function depending on the answer.
You seem surprised?
|
|
|
|
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int tobase=0;
int number =0;
int counter = 0;
int bin [25];
int quo = 1;
printf("Enter your number:");
scanf("%d",&number);
printf("Enter base to convert to: ");
scanf("%d",&tobase);
while (quo!= 0)
{
quo= number/tobase;
bin[counter] = number%tobase;
counter ++;
number=quo;
}
while (counter > 0)
{
printf( "%d", bin[counter-1]);
counter --;
}
system("PAUSE");
return 0;
}
how to make this code into a function?
|
|
|
|
|
i have tried to come up with my own way of having a code but its not working ...corect it please .
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* Function Prototypes */
int bintodec(int fmbase, int num);
int dectobin(int tobase, int num);
int main()
{
int num;
int fmbase;
int tobase;
int result;
int convert;
int counter = 0;
int bin [25];
int quo = 1;
printf("Enter 0 to convert to binary\n");
printf("Enter 1 to convert to decimal\n");
scanf("%d",&convert);
printf("Enter the value to be converted:");
scanf("%d",&num);
printf("Enter base to be converted from: ");
scanf("%d",&fmbase);
printf("Enter base to be converted to: ");
scanf("%d",&tobase);
if(convert ==0)
convert= dectobin();
else if (convert ==1)
convert= bintodec();
else
{
printf("Error in Input");
exit(1);
}
result = bintodec(fmbase,num);
printf("The result is:%d", result);
result = dectobin(tobase,num);
printf("The result is:%d", result);
int dectobin( int tobase, int num)
do (quo!= 0)
{
quo= num/tobase;
bin[counter] = num%tobase;
counter ++;
num=quo;
}
while (counter > 0)
{
printf( "%d", bin[counter-1]);
counter --;
}
int bintodec(int fmbase, int num)
{
int bin[256];
int counter ;
int counterR ;
int quo ;
int result =0;
int result1 =0;
int res[256];
int sum =0;
if(quo>0)
{
quo= num/10;
bin[counter] = num%10;
num=quo;
counter++;
}
while (counter>0)
{
result = pow(fmbase, (counter-1));
result1=result*bin[counter-1];
res[counterR]=result1;
counter--;
counterR++;
}
while (counterR > 0)
{
sum = sum + res[counterR-1];
counterR--;
}
return sum;
}
system("PAUSE");
return 0;
|
|
|
|
|
NickYan wrote: corect it please
ok
Correct it please.
|
|
|
|
|
NickYan wrote: how to make this code into a function?
Other than the function it already is in? Apply some logic here, Nick.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i know that i can do it but i need to write up a report with a set of headings in the assignment not only to get the code working and time is short 1 more day till its due
|
|
|
|
|
NickYan wrote: ...time is short 1 more day till its due
Good luck.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks but you guys are suppose to help even if it is a little at least not only give advice .........
|
|
|
|