|
Like David Crow states:
incapsulation is one of the pilers of O-O programming.
declaring variables public is generally a bad idea.
No hurries, no worries.
|
|
|
|
|
Friend!
But here problem is about two classes accessing each other variable.
for that Why can't we use pointer approach which i have stated above.
I am Sorry,if you angry with my above quote.I am just asking you to respect a decent man who help every body here!!!..
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
ThatsAlok wrote:
if you angry with my above quote
Angry? it will take a lot more to get me angry, it was only an expression of surprise. (besides if I'm angry you'll see this icon: )
respect for trying to help, always, but in my opinion this time you made a mistake (like everybody does btw), I only pointed that out.
ThatsAlok wrote:
But here problem is about two classes accessing each other variable
getters, setters, properties. Why? Suppose your variable changes value unexpectedly, where start looking? When using a setter for example. You only have to set your breakpoint there, wait for the change and follow the stack trace.
so do something like this as good practice:
class something{<br />
private int number = 0;<br />
<br />
public SetNumber(int num){<br />
number = num;<br />
}<br />
public GetNumber(){<br />
return number<br />
}<br />
}
in C# getters and setters are equal to properties.
Please don't be agitaded so quickly, nobody's attacking you.
No hurries, no worries.
|
|
|
|
|
|
Hi,
I have problems to refresh my application when it is recovered by another window. In fact, I display images, (.ppm format), in CStatic controls, and everything is refreshed, except the images. I display the images in the OnPaint() function, so that is OK when I move the window on the edges of the screen. But when the window is hidden and then sets visible, the images disappear...I have tried to add UpdateWindow, UpdateData, Invalidate, etc... in OnPaint()... but it failed.
Can someone help me please?
Thanks
Isabelle
|
|
|
|
|
Perhaps you're overriding OnShowWindow() , causing the default behavior (that would eventually cause OnPaint() to be called) to not occur? Try overriding OnShowWindow() in the following manner:
CMyDialog::OnShowWindow (BOOL bShow, UINT nStatus)
{
CWnd::OnShowWindow (bShow, nStatus);
Invalidate();
UpdateWindow();
}
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks for your answer Ravi!
In fact I had already tried that, unsuccesfully...
I don't know exactly when this function is called, but I thought it is only when the application is opened for the first time... no??
Thanks again
Isabelle
|
|
|
|
|
pl-isa wrote:
but I thought it is only when the application is opened for the first time... no??
Actually, WM_SHOWWINDOW is sent whenever the window is shown, hidden, minimized, maximized or restored, not only at startup. But you're right - what I should have said is, add these lines to your OnPaint() handler:
CMyDialog::OnPaint (...)
{
m_myPicStaticCtrl.Invalidate();
m_myPicStaticCtrl.UpdateWindow();
}
This should force an immediate repaint of the static control. If this doesn't work, I'd put TRACE() statements in your static control's OnPaint() handler to see if it's doing anything funky. It might be getting called, but not painting after the first invocation.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
Did you tried the RedrawWindow() of your CStatic control in your OnPaint()?
Regards,
Eli
|
|
|
|
|
Hi Eli,
I had also already tried the RedrawWindow(), but unsuccesfully...
Are threads use for that kind of things??
If you have any other ideas... don't hesitate!
Thanks a lot for your answer!
Isabelle
|
|
|
|
|
Hello All,
I am planning to design my help system for my application. I want to use CHM file format. I am new to this format and I have a basic queries:
Can any body please help me out in this.
As per my understanding CHM is compressed form of HTML. My query is "When I will decompress the contents of CHM format will i get my out put in HTML format".
Any suggestion about how a help system should be designed are most welcome.
Thanks,
Ritu
Anukrati
|
|
|
|
|
|
|
You can decompile the CHM file to a set of files in the CHM file.
I use PowerCHM to decompile and compile it.
|
|
|
|
|
Hi,
I would search a library / activex o SDK tools for developer a program in Visual C++ that permit cut and paste and write of result of mp3 audio file.
For example. i take a song and extract from 10th second to 30th second and write a new file in specific format.
Who i can make ?
Thanks
Hi.
I'm new developers
|
|
|
|
|
|
I am getting an error message, tried hard to come out of this. anybody can help????????????????????
Please Treat it as urgent
sysInfo :- is a class which is calling 'getIPAddress()' which is of type 'std::string'
in sysInfo class the result is returned in the form of std::string,
this is being called in main() function.
os.m_IP_Address = sysInfo.getIPAddress();'
'os' is a object of class which inherits the Recordset class and
'm_IP_Address' is of type CString which is the column name in which the value of "sysInfo.getIPAddress()" should be placed
(os.m_IP_Address = sysInfo.getIPAddress();)
But ,I get the error message as shown below.
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' (or there is no acceptable conversion)
Language:- VC++ and the data base is MSAccess
Please give me tthe solution for this with the code example.
|
|
|
|
|
|
i cant seem to center text in a text box. there doesn't appear to be an option for this in the toolbar. Im usin borland c++.
I don't know what to write here!!!!
|
|
|
|
|
|
How do I go about doing this?
I don't know what to write here!!!!
|
|
|
|
|
I doubt Borland C++ has such a class.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
It's been almost 15 years since I've used a Borland compiler, but can you do something like:
SetWindowLong(hwndEdit, GWL_STYLE, GetWindowLong() | ES_CENTER);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have two splitter in my window.one splitter contais treeview.another split contains property sheet with pages.based on the selection in tree i would like to change th epages in property sheets.if any body know this requirement please let me know.
|
|
|
|
|
rgchezhian wrote:
...i would like to change th epages in property sheets.
What do you mean by "change the pages?"
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|