|
Hi..
actually what the thing is i have a project in console application working properly.
Now i want to make it windows application. I have copied all the file of the console
application to new Window application. now main is in call_main.cc file. I want to call the main
and replace the console.writeline() by messagebox::show. Can i do this.
Else give me suggetion to make console application to windows application simply.
Thanks in Advanced
Rahul Kulkarni
|
|
|
|
|
|
how to move bitmap using mouse cursor. when the bitmap is larger than a dialog box i create a scrollbars.but i now we should move the bitmap by using mouse cursor when we click the mouse and move bitmap also should move.when we release it should stay at waht position we release.
thank u in advance.
sree
|
|
|
|
|
A possible scenario. First you need to process the WM_LBUTTONDOWN notification message, sent to your butmap’s window. Within the handler, store a true value in a boolean variable, and save the position of the cursor and the scroll position (GetScrollPos ). In addition, take the possession of the mouse using SetCapture function.
Then, in WM_MOUSEMOVE handler, if the boolean variable is true , scroll the bitmap window according to the current cursor position and stored values.
In WM_LBUTTONUP handler, set the boolean flag to false , and release the mouse possession using ::ReleaseCapture . The same actions must be done in WM_CAPTURECHANGED handler.
In addition, you can handle the WM_SETCURSOR message in order to change the mouse cursor shape while the bitmap is scrolled.
|
|
|
|
|
thank u.
do u ahve any sample code.
|
|
|
|
|
|
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);
...
}
|
|
|
|
|