|
In fact I want to write a function so that using that fuction I can clear my debug window any time. I guess I need to get handle of the
|
|
|
|
|
Can any one please tell me about any open source project, a client application that connects to MSN or Yahoo servers and access these services.
If you know about any such open source project then please tell me, whether available from CodeProject, Codeguru or CVS(SourceForge.net),
Thanks
SattarSingh
|
|
|
|
|
try gaim or amsn (both linux) but open source.
|
|
|
|
|
: class Cat // begin declaration of the class
7: {
8: public: // begin public section
9: int GetAge(); // accessor function
10: void SetAge (int age); // accessor function
11: void Meow(); // general function
12: private: // begin private section
13: int itsAge; // member variable
14: };
//-------------
why we use itsage in private?why dont we use it in public:??whats the advanteges and disadvantages?
|
|
|
|
|
Its called encapsulation. With itsAge not visible outside of the class scope, people cannot change the itsAge variable like:
someCat.itsAge = 57 ;
If the itsAge is a variable upon which the internal state of the object depends, it could be possible for client code to put the object into an invalid state by bypassing the correct accessor functions.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Data and member functions kept in the private section of a class are only used internally by th objects of the class themselves. In your example, itsAge is kept private because the designer intnded the users of the class to manipulate this variable thru the member functions GetAge and SetAge . In other situations, you might want to kept a data private because the users do not have to be concerned about its existence.
I'd recommend you try some of the C++ tutorials on the net to get an overall understanding of this kind of issues.
Regards,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Information hiding is one of the beauties of object oriented programming. By making itsAge private the programmer is keeping the program from accidentally/erroniously changing data that it should not have access to. A basic breakdown is as follows
public- can be called from anywhere in the code where an instance of that class is defined. Example if itsAge was public then this would be allowed
Cat MyVariable;
MyVariable.itsAge = 10;
protected- only instances of the specified class can access the variable.
if itsAge was made protected then;
So if you had
Cat MyVariable;
Cat YourVariable;
then any function in MyVariable would be allowed to access the protected data member itsAge in YourVariable.
Private- only the specific instance of the class can access the variable.
if itsAge is made private then
Cat MyVariable;
Cat YourVariable;
only functions in MyVariable can access the private data member
MyVariable.SetAge(10);
this line will only be able to access itsAge for MyVariable and
YourVariable.SetAge(10);
needs to be called to change the other instance of itsAge.
You can further manipulate objects by making a class a friend of another class or by using inheritance but that would involve a much longer explanation and outside the scope of your question. Just keep in mind that its possible.
Gonna parrot Joaquín's suggestion and say look up a tutorial cause they can give a much better explanation then I can
Hope this helped
Eric
|
|
|
|
|
Another thing I might add to this is "(C++ class) interfaces should be minimal and complete". I can't claim credit for this, and I don't know who originally worded it, but I have been trying to live by it ever since. I think that if you care about your reputation as a C++ designer this is one of the things to look out for.
|
|
|
|
|
I do a program that can load image into a window. I use dialog box instead of using the Open Document to load the image. The problem is, when I load an image, I think the image appears but only after I minimize it and maximize it again or after other window covers my window program. I think this must be something to do with repaint the window. Is it true?..If it is about repaint the window, can anybody guide me on how to do it. If not, please guide me to overcome this problem.
|
|
|
|
|
Just call Invalidate after you load the file.
|
|
|
|
|
Thank you for the answer. I have tried to use Invalidate() but nothing happens.
Is there any other changes I need to make?
|
|
|
|
|
Hello,
I have been having some problems with using the OleLoadPicture from Win32API. I am trying to use it to upload textures to OpenGL.
When I debug my code it seems to be going allright (all functions return S_OK) but when I test for the retrieved pixels (bmdata in CTextureLoad::Create just before the call to CTexture::Create(..)) all the pixels are black (0) and that is not the case with the actual bitmap (which is a 8bpp .GIF).
Most of the code I'm using can be found here : http://www.daimi.au.dk/~kaae/CTextureLoad.h
The way it's supposed to be used is like :
void foo()
{
CTextureLoad loaded_texture(pointer_to_gif_image, size_of_gif_image_pointer);
// do something funny with the loaded_texture
}
---
Rasmus Christian Kaae, kaae@daimi.au.dk
http://www.rasmuskaae.net
http://www.3kings.dk
|
|
|
|
|
Hi,
I am trying to put some text into a multiple line edit box with the following code.
wsprintf(s, TEXT("%s\n%s\n%s"), TEXT("a"), TEXT("b"), TEXT("c"));
m_ed1.SetWindowText(s);
When I run it in the emulator, it appear something like 'a b c' in a single line. Anybody know what is wrong?
|
|
|
|
|
I think you need to use \r\n to delimit the lines correctly
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Hi,
My program need to run MSXML3 ( I have downloaded from Microsoft the MSXML3 MSI and CAB files), I install my program with Wise.
My question is, how can I make that first it install the MSXML3, and after my program ( if I try that it don´t works it tells me that there is an MSI already running and...).
Or how can I register the MSXML Dll's manually ( regsvr32... is not the solution )
Thank's in advance, greetings
Braulio
|
|
|
|
|
Hello,
i use Icon's in the SubItems of the ListControl.
But i can't suppress the appearing of the Icon in the first column.
I tried :
LVITEM lvi= {0};
lvi.mask = LVIF_TEXT;
...
lvi.iImage = -1; -> Then i get free space in the first column.
or
//lvi.iImage = -1; Then i get the first Bitmap.
Please help !!!
Marco
|
|
|
|
|
As far as I know (i posted a thread about this here a few weeks ago), it is surprisingly _not_ possible to do that (that´s what I was told in the preceding answers. So you´ll have to put a picture everywhere, or nowhere.).
If someone has a counter example, I´ll be very happy ...
~RaGE();
|
|
|
|
|
Why not have a blank entry in your image list and use that for the image?
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Hi,
because it seems that the empty Space is defined by the ImageList Settings,
not by the bitmap.
pImageList->Create(15, 15, ILC_MASK, 6, 4);
Best regards
Marco
Marco
|
|
|
|
|
Pick your choice: use icon or don't. If you do, it is in the first columne (because so has Microsoft said, and since they are allmighty and never publishes any source code that never has any bugs, you are basically f_cked).
Perhaps some of the extended listboxes here at CP (in combination with a listcontrol) could do the trick?
|
|
|
|
|
I'm in need to transfer files from a driver to server(s) somewhere on the network.
The servers are discovered through AD service connection points.
The question is now, what could I use to adhere to the AD replication rules when the driver needs to transfer files to the server?
BITS is out of question, since its a COM only service and has not much with AD. Synchronization manager might be a solution but I am not sure of. A pretty ugly solution would be creating silently a GPO, attach the file to it, assign it to the target server and hope for the best, but again this involves lots of COM.
What else? (besides of manually reading AD settings)
Any ideas?
Vote against software patents in europe
|
|
|
|
|
Andreas Saurwein wrote:
I'm in need to transfer files from a driver to server(s) somewhere on the network.
You need to transfer data from a (inherently kernel-mode) driver to a "server"? I don't think so.
I'm sorry that I haven't got an answer for you (or even anywhere to point you except to Microsoft), but it seems you are really barking up the wring tree here.
|
|
|
|
|
Mike Nordell wrote:
You need to transfer data from a (inherently kernel-mode) driver to a "server"? I don't think so.
Never mind. I know that I need to transfer data from a kernel mode driver to a server located somewhere on the network. And I really would like to improve the currently used mechanism.
And telling that you have no clue, isnt of much help.
Thanks anyway.
Vote against software patents in europe
|
|
|
|
|
Hi all,
I need to write a dialog based MFC application that has multiple modal dialogs. One of the dialog will be the main dialog and always appear first. For the other dialogs, each may invoke some of the other dialogs for multiple levels based on the input of the user, though no dialog will appear more than once in any instance.
In the application I need a static object that almost all dialogs will access it. How can i do it? Simply speaking, I don't even know how to store a global variable in a dialog based application
Any help would be appreciate.
|
|
|
|
|
Any variable declaration made in your cpp files 'outside' any class implementation will be treated as global.
I usually declare global variables in the App implementation file, just after its declaration.
If you open the implementation file of your CWinApp derived class. This should be called something like <projectname>.cpp (C<projectname>App), towards the beginning you should see the app declaration. Just declare your variable there as you would any other.
/////////////////////////////////////////////////////////////////////////////
// The one and only CMyApp object
CMyApp theApp;
bool global_variable; // this now a global variable
|
|
|
|