|
wow9999 wrote:
Can a static function call a non-static function inside the same class?
no
or
Can a static function call a non-static function in different class?
no
|
|
|
|
|
Yes, no problem. As long as you have the object you wish to invoke the function.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Dear Tim Smith
can you show me a example or hint to see a static or non-static funciton to call a static or non-static function.
Thanks
|
|
|
|
|
|
A static method doesn't have a this reference. Hence, it can only call other static methods of its class. However, if the static method has access to an instance of a class, it can call that instance's static or non-static method.
class Foo {
...
public:
static void staticFuncA();
static void staticFuncB();
void nonStaticFunc();
}
void Foo::staticFuncA()
{
staticFuncB();
nonStaticFunc();
Foo f;
f.nonStaticFunc();
} /ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
1)Yes, if I pass to the function object of its class.
2) By a same way.
================================
Useful links
|
|
|
|
|
Anyone has handy library fuction to copy CMenu or HMENU???
Thanks,
Brian
P.S.
I know how, just to lazy to iterate menues & submenus & states...
|
|
|
|
|
do you mean the resource?
If so, open the *.rc file which contains the menu resource you want in visual studio while the destination project is opened. click on the resource ID, drag it to your destination project. That's it.
|
|
|
|
|
>do you mean the resource?
Nope
Dynamic CMenu/HMENU....
|
|
|
|
|
No, but could you be more specific.
Trust in the code Luke. Yea right!
|
|
|
|
|
Hi,
I have a application which doesn't have proper window name
and class name(Class name will be #32770(Dialog) and Window name was "").So i can't use FindWindow(). Application is a third party application,about which we don't have much information. Now i want to check for existance of that application. How can i do that?
Regards
|
|
|
|
|
If you have the name of application exe file, you can find it using the following functions:
EnumProcesses
For each enumerated process
OpenProcess
EnumProcessModules
GetModuleFileNameEx
|
|
|
|
|
Hi
How do you read bytes from the harddisk using Visual C++ 6.0? (Used for reading filesystems)
I know you can use _bios_disk() with the bios.h include, but VC++ doesn't have this file or it's functionality. Is there another way to do it in windows, without using assembler?
Cheers
|
|
|
|
|
|
Anonymous wrote:
I know you can use _bios_disk()
You can only do this in winodows 9X or lower. Win NT, 2k or XP will not allow this because you cannot access the bios interrupts directly.
John
|
|
|
|
|
Be more specific. What is your goal? As for using the bios and asymbly, that is why we have so many versions of 9.x (direct access without security).
Trust in the code Luke. Yea right!
|
|
|
|
|
Hi there...I'm writing a program that will work at bits/byte level. It will accept a double number as an argument, and then the number will be decomposed in two parts: the high and the low, I'm going to do some operations with them.
I know about the bitwise operators, but Is anyboady know how to make the decomposition
double FUNCTION(double argument)
{
int hx,lx
//MISSING THIS PART!!!!
hx = HIGH_PART(argument);
lx = LOW_PART(argument);
//other operations with hx and lx
//
return(final_result)
}
Eric Manuel Rosales Pena Alfaro
PhD student
Unversity of Essex
Wivenhoe Park
Colchester, CO4 3SQ
Essex, Uk
email: emrosa@essex.ac.uk
tel: +44-01206-87311
|
|
|
|
|
emrosa wrote:
...bits/byte level...double...
Do you perchance talk about DWORD ?
Or do you really mean double , the extended precision floating point type?
In case of DWORD , have a look at the HIWORD and LOWORD macros in MSDN.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Why not use a standra C union:
union Converter
{
{
short low;
short high;
}
double value;
};
Converter x;
x.value = 5.67;
short low = x.low;
short high = x.high;
My uinion syntax may not be correct as I have not sed them for years n years n years....
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Thanks for the hint...I have already tried that and it works fine.
Thanks again
Eric Manuel Rosales Pena Alfaro
PhD student
Unversity of Essex
Wivenhoe Park
Colchester, CO4 3SQ
Essex, Uk
email: emrosa@essex.ac.uk
tel: +44-01206-87311
|
|
|
|
|
Your kiding me, that actualy worked? Please explane why.
From MSDN:
Type double
Double precision values with double type have 8 bytes. The format is similar to the float format except that it has an 11-bit excess-1023 exponent and a 52-bit mantissa, plus the implied high-order 1 bit. This format gives a range of approximately 1.7E–308 to 1.7E+308 for type double.
Microsoft Specific —>
The double type contains 64 bits: 1 for sign, 11 for the exponent, and 52 for the mantissa. Its range is +/–1.7E308 with at least 15 digits of precision.
END Microsoft Specific
Ok I probubly just broke the law. But I need to know.
|
|
|
|
|
Hello,
in MDI project,i want to hide the main menu (IDR_MAINFRAME) when i press F11 and show the menu when a press F12 , i already try
SetMenu(NULL) to hide it, and it works, but i don't know how to show the menu ?
help please
thx in advance
|
|
|
|
|
CMenu *pMenuOid = SetMenu(NULL);
//............................
//restore it!
SetMenu(pMenuOld);
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
thx
but it don't works, SetMenu(NULL) return a BOOL and not a CMenu.
i try
CMenu *pMenuOid = GetMenu(NULL);
SetMenu(NULL)
and to restore it :
SetMenu(pMenuOid);
but when i restore i have a Error message (Debug Assertion failed)
|
|
|
|
|
Dear all
i will like to use a loop and CString.Find method to find a string from a text file.
Example-----
Object 0:
aaaaaaaaaa
Object 1:
bbbbbbbbbbb
Object 2:
ccccccccccc
Object 3:
dddddddddd
for(int i=0;i<3;i++)
{
xxx.Find("Object [i]:");
}
Can someone tell me how to code the integer part,[i], in Find method.
|
|
|
|