|
A_Laxmanif the class contains atleast one virtual function then size is 2 bytes
r u sure about it ??
If it contains a virtual function ,then its size should be either 4(since the memory location will be 4 bytes long) or 5(4+1) bytes ..How can it be 2 bytes.
I am confused.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
NiceNaidu wrote: I am confused.
don't be confused.
In case of 16 bit applications(DOS)
the size of class when virtual function present is 2 bytes
In case of 32 bit application(Windows)
the size of class when virtual function present is 4 bytes
In case of empty class for both cases it is 1 byte
Knock out 't' from can't,
You can if you think you can
-- modified at 8:24 Friday 19th May, 2006
|
|
|
|
|
NiceNaidu wrote: ...to ensure different memory location for each instance of the class...
This is the answer. What else are you looking for?
FAQ[^]
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Hi,
I have a dialog window in which user has to enter some text in the IDC_WORD after clicking on search button i want the value to be stored in a variable line,
I have created a variable m_WORD of CString type ,
CString line;
line = m_WORD;
char * w =(char *) (LPCTSTR) line;
word = w;
but the value is not getting stored in line I used F5 and checked value of m_WORD is empty "" what will be cause ..?? can anyone help me with this….
Regards,
Vinay Charan.
|
|
|
|
|
Use UpdateData(TRUE) before line = m_WORD
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
vinaycool wrote: CString line;
line = m_WORD;
char * w =(char *) (LPCTSTR) line;
char * str=new char[MAX];
UpdateData();
lstrcpy(str,m_test.GetBuffer(m_test.GetLength()));
The code copies the data from the edit box into the str variable.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_Laxman wrote: vinaycool wrote: CString line;line = m_WORD;char * w =(char *) (LPCTSTR) line;
nope this code will also work well, have a try!
"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
|
|
|
|
|
ThatsAlok wrote: nope this code will also work well, have a try!
Yes buddy,
I have tried the code and works fine.
as well tried another to do same and posted in my previous post.;P
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
vinaycool wrote: I have created a variable m_WORD of CString type ,
Have you called GetWindowText in that Function or UpdateData(FALSE) !
"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
|
|
|
|
|
Use:
GetDlgItem(IDC_WORD)->GetWindowText(m_WORD);
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
use UpDateData then
m_youret.GetWindowText( m_WORD);
whitesky
|
|
|
|
|
There is another way to do it
- Assign a "Control" variable to your edit box (CEdit m_textEdit).
- Use the method
GetWindowText() for retrieving the results
void CDemo::OnBnClickedSearchButton()
{
...
CString userResponseText;
m_textEdit.GetWindowText(userResponseText);
...
}
Here you don't need to worry about UpdateData that usually has side effects.
Just wanted to give you another way to do it.
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
Hi all
I have a project, created in VS2005.
When I enter its directory, inside I have 2 files and 3 folders : Debug, MyProject, Release, MyProject.ncb, MyProject.sln
Strange is that MyProject.ncb is 16 MB in size.
And other files(folders), together are only 4 MB(If I clear the debug and release folders).
Strange is also that MyProject.pch file is 12MB, when Debug folders of my project is not empty.
Why are these files so large ?
Size of total source files I use is only 3MB.
Thank you.
|
|
|
|
|
NCB is the Intellisense Database. This sometimes messes up BADLY. I have had a NCB-File with a size of 1.2 GB (!!!). Sometimes the Parser will get a hick-up and go crazy. Just delete the file, it's automatically recreated when you reload your project. Looking stuff up (code completion etc.) might be a bit slow, but will soon get back to its old self.
The PCH-File is the precompiled header file. You can delete that one as well, it also will be recreated. If it is not there, compiling might take a bit longer (because it has to be recreated).
If you do not need recompiled headers, turn them off in the project properties.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Hello everyone,
i am working in c++.
is it possible to use strlog.h in win32 console application.
if so where can i find the file and the documentation for using it.
thanks in advance,
regs
vijay
|
|
|
|
|
|
Hi
Is any tabulor data entry control is available VC?
Thanx in advance
KK
|
|
|
|
|
kk.in wrote: Is any tabulor data entry control is available VC?
Are you talking about the control which looks same as Grid Controls in VB?
if so then there is CListCtrl class which provides such tabular information sroring
Knock out 't' from can't,
You can if you think you can
-- modified at 7:53 Friday 19th May, 2006
|
|
|
|
|
|
Ok,
Then you may use the CListCtrl by setting the style property to report
and after that insert the columns programatically
wrote:
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
kk.in wrote: s any tabulor data entry control is available VC?
TRY FlexGrid
"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
|
|
|
|
|
Hi,
What is the diference between following configuration modes
Release , Release Unicode , Unicode Static Release .
When these are used?
Regards.
|
|
|
|
|
|
Thanks but I have asked only about above given different Release modes
Regards.
|
|
|
|
|
Release : release mode without unicode support, linked with MFC in DLL.
Release Unicode : release mode with unicode support, linked with MFC in DLL.
Release Static Unicode : release mode with unicode support, with MFC statically linked in the app.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|