|
i didnot get what code should written in the function MouseMove().
shall u give that coding
thank u.
sree.
|
|
|
|
|
Is there a difference naming a static member variable of a class private??
how is a static public member variable different from a static public member variable??
|
|
|
|
|
|
I could guess your question. Static and private has totally different meanings. when you declare a variable private but not static, it means that it can be used within the same class. It cannot be accessed by other members(may be another class). and more importantly, every time an Object is instantiated, a new instance of the variable is created. But when you declare a varible private and also static. It's all the same but the last point, which when new objects are created, it's not instantiated anew, rather all objects share the variable. and when you want to access it, you cannot use the . or the -> operator, you should use the :: operator with the class name preceeding it. now you get it? note, you cannot put "static" in the private,protected,public list. it can coexist with all the three
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
I think i havent asked the question clearly
what i actually ment to ask is :
if a member is declared private then it implies, it cannot be accessed by any objects directly.
But in the case of static member varaibles, they can be accessed by using 'class name' followed by '::' operator.
So wouldnt a private menber varaible declared static loose its significance as private if it can be accessed by by the :: operator????
|
|
|
|
|
If it is private , it means it. No matter it is static or not. You cannot access even with a :: operator.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
thank u!
|
|
|
|
|
don't confuse !!!
static don't alter the visibility accessors (public , protected , private ).
it only tells the compiler that the member declared as static will exist once and will be shared between all the instances of the class...
do you get the difference then ?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
I think i havent asked the question clearly
what i actually ment to ask is :
if a member is declared private then it implies, it cannot be accessed by any objects directly.
But in the case of static member varaibles, they can be accessed by using 'class name' followed by '::' operator.
So wouldnt a private menber varaible declared static loose its significance as private if it can be accessed by by the :: operator????
|
|
|
|
|
The static-ness and access of a member variable aren't mutually exclusive. All static means is that there is only one copy of that member for all instances of the class. public/protected/private access all work the same as with non-static members.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I think i havent asked the question clearly
what i actually ment to ask is :
if a member is declared private then it implies, it cannot be accessed by any objects directly.
But in the case of static member varaibles, they can be accessed by using 'class name' followed by '::' operator.
So wouldnt a private menber varaible declared static loose its significance as private if it can be accessed by by the :: operator????
|
|
|
|
|
namaskaaram wrote: So wouldnt a private menber varaible declared static loose its significance as private if it can be accessed by by the :: operator????
Have you tried it to see?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
class test { private: static int foo; };
int test::foo = 1;
main()
{
int x = test::foo;
}
error C2248: 'foo' : cannot access private member declared in class 'test'
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
namaskaaram wrote: how is a static public member variable different from a static public member variable??
From my vantage point, they are identical.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
how to change the icon in title bar in sdi app.
|
|
|
|
|
WM_SETICON or if you're using MFC SetIcon()
|
|
|
|
|
|
If you're programming with MFC use SetIcon() in your Main Frame class:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
HICON hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_SITYPE));
SetIcon(hIcon, false);
...
}
|
|
|
|
|
|
AfxGetApp()->LoadIcon(IDR_MAINFRAME);
Replace IDR_MAINFRAME with our ICON ID.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
|
Can anyone tell me how to show the shell context menu for a file when all you have is the file name. I got a menu to show up but not with all the items and the ones that are there don't work right - when I click on properties the Properties dialog comes up, but with most of the info blank or 0. What I've done so far is get the PIDL for the file by using SHGetDesktopFolder() to get the desktop folder and calling ParseDisplayName which works fine. I think what is going wrong is I'm calling GetUIObjectOf() to get the IContextMenu interface with the desktop folder, when it needs the pidl's direct parent folder. If this is the case how do you get a pidl's parent folder?
- thanks
|
|
|
|
|
|
Thanks for the reply. Unfortunately it uses SHBindToParent() which requires Win2k+
|
|
|
|
|
We are simulating a web cache server using sockets,where
1.a client submits a url from his m/c
2.Request reaches server in the form of successive Http req headers.
3.Server processes each and sends corresp page to client..
The problem we encounter is this..
When the consecutive requests arrive on d same socket..we get a "debug assertion failed" message in sockcore.cpp
BOOL CAsyncSocket::Accept(CAsyncSocket& rConnectedSocket,
SOCKADDR* lpSockAddr, int* lpSockAddrLen)
{
ASSERT(rConnectedSocket.m_hSocket == INVALID_SOCKET);//the debugger points to dis line!!!!!
.....
......
}
We havent used multithreading!
Do we need to use it,or creating multiple sockets would help?
Do we need to post d code snippet?
|
|
|
|