|
There is, but it is no longer C++. It is compiler implementation code which is not in C++ standard.
Class (memory) structure is something like this:
this_pointer -> [vtable_pointer, dataField1, dataField2, ...]
where vtable_pointer points to the table of virtual functions:
vtable_pointer -> [func1, func2, ...]
So, in theory, you can get access to class (public/private do not make sense in binary) members like this:
data1 = *((char*)(*this) + 4);
data2 = *((char*)(*this) + 8); // or 12 or 16 depending on the type of data1
Notice, I said in theory, because in practice the compiler aligns data fields the way it wants, even the order matters. So, if you have an integer data field and a double data field you may get something like this:
[4 bytes for vtable_pointer, 4 bytes garbage, 4 bytes int, 8 bytes double]
There is no simple way to figure out the order and the types of data fields unless you disasm the binary to see which memory locations are accessed from public functions that you know.
That's not much, but I hope it'll be helpful.
-- modified at 12:28 Wednesday 10th May, 2006
|
|
|
|
|
|
when a class uses the methods of a library file(dll).
Since the binary file(dll) does not contain the type of access specifier(public,private)a method is assocaited with,How can the class identify whether the method is public or private ???
|
|
|
|
|
Hi all,
I have a class CMyStatic which inherites from CStatic.
In the class constructor i load 2 cursors (looking at their handle in debug they are looking fine).
I implement 2 events : ON_WM_SETCURSOR() and ON_WM_NCHITTEST()
in the hittest i check a certain position, and in the WM_SETCURSOR i check if i am in that position i do :
...
::SetCursor(HT_MYHITTEST == nHitTest ? m_hCursor1 : m_hCursor2);
return CStatic::OnSetCursor(pWnd, nHitTest, message);
problem is i never see the icon changed ???
help?
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
ok i've figured it out....
i need to return TRUE instead of CStatic::OnSetCursor(pWnd, nHitTest, message);
then it works
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Question and answer are yours...
- NS -
|
|
|
|
|
you created question and you give answer to question result 1+1=1
|
|
|
|
|
am doing my final year masters in computer application and i hav to do a project as part of my academics. my project deals with desktop backup and i have completed the project, the thing is i need help in " Email Notification". ie.. if my backup task is over, i have to send a email to the specified email address. it should be simple, so please help me to rule out.. if really any one wanted to help me out...i will send in the project which i have done..can you help me out...
vivekkrishna
|
|
|
|
|
please send to me : e-mail: zhmster@gmail.com
alantop
|
|
|
|
|
|
You can use the MAPI functions.
or if you wish you can send the code.
_AnShUmAn_
|
|
|
|
|
i am getting following error in vc++ program.
fatal error (line Number): cannot open include file(file name),No such file or directory.
|
|
|
|
|
|
Can you be more specific
maybe you dont have your file or file is in different path
|
|
|
|
|
fatal error (line number):cannot open include file No such file or directory exits
|
|
|
|
|
|
|
which question?
|
|
|
|
|
|
toxcct wrote: you want an answer ?
i want a question...
You have one organ missing, that too a vital one...;P A good and tender heart
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
Nibu thomas wrote: You have one organ missing, that too a vital one...
you talk about me or him ?
i think he's missing more brains than me, 'cause he's just forgot to ask the question for us to answer...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
I think it's pretty clear no ? The file you included cannot be opened. Check if it where it should be.
|
|
|
|
|
|
|