|
hello am very interested in programing in visual c++ but am a bit confuse
can you give me so help.... especiall on functoins and classes
if you got an thn on visual C++ could you send me the link or send me a copy of yoour tutorials
please
cause i really neeed it
my email is clivestewart@hotmail.com
S.C
|
|
|
|
|
I think you'll find that everyone's tutorials are here, by default. What is confusing you ? At this point I'd urge you not to even consider writing any windows programs - if you're at a stage of understanding classes you need to be writing console programs in order to learn these basics.
A class is defined like this:
class MyClass
{
}
and can contain public, private and protected members. A member can be a variable or a function, so you might have this:
class MyClass
{
public:
int GetValue();
void SetValue(int val);
private:
int m_Value;
}
This is in your header file, the actual functions go into your cpp file like this:
int MyClass::GetValue()
{
return m_Value;
}
void MyClass::SetValue(int val)
{
m_Value = val;
}
The example is a little contrived, but I really have no idea where your area of difficulty is. Please ellucidate, on a new thread where it belongs, and I'm sure that others as well as myself would be glad to help.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I have a dialog based app that docks to the edge of the screen and auto-hides itself like the taskbar and I need to be able to tell when the mouse cursor hits the edge of the screen so I can restore my dialog. I've looked on MSDN but couldn't really find anything great, I know I can hack it and leave a corner of the dialog out and then show when the mouse enters (WM_MOUSEMOVE) but that isn't really what I want. Any help is greatly appreciated.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I believe you're looking for
GetMouseMovePointsEx and GetLastInputInfo
These are the key API calls that you will need; and of course, you'll need knowledge of the screen size using GetSystemMetrics.
CodeGuy
http://groups.yahoo.com/group/wtl
|
|
|
|
|
Yeah, I've seen those functions but I need to continually monitor the mouse while my program is running, would that require another thread that only watches the mouse movements and what function would be a good place for these functions? Thanks for your response.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I don't think I would bother with a thread. I'd investigate just using a timer function (i.e. handling WM_TIMER), since nothing is time critical about checking for mouse movements.
Best regards,
CodeGuy
The WTL newsgroup: 860 members and growing ... http://groups.yahoo.com/group/wtl
|
|
|
|
|
Thanks, sounds good to me.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
One problem, for some reason there is no such thing as MOUSEMOVEPOINT structure in my header files. Any ideas? I did a find in files search and got nothing.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Bret,
I steered you wrong. The reason MOUSEMOVEPOINT is not available is because GetMouseMovePointsEx is a Win2000/Me API call. You would have to get the latest Platform SDK, but I suspect you would not want a solution for just those 2 operating systems.
OK, well, this is more complicated, but you will have to do a Windows system hook to capture the mouse messages sent to the desktop. Take a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmgmt/html/msdn_hooks32.asp
CodeGuy
The WTL newsgroup: 860 members and growing ... http://groups.yahoo.com/group/wtl
|
|
|
|
|
Thanks for your help.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Does anybody know any free RIFF file parser?
Not for any special RIFF sub-format, but one that can make the job of loading different RIFF files easier - in C++ preferrably
Thanks,
Erik
|
|
|
|
|
I have tried to mail Dundas because they have disruptet Hyperview Studio information from their web site. Actually I bought life time support and updates to this product a years ago. I cant even get access to the FAQ they provided before
I mailed twice to hear what happened, but not even a reply.
One thing is to sell life time upgrades a year before the product dies, not to answer questions about it seems for me to be bad bad.
I also used to buy Ultimate Toolkit with updates every 14 days. But without any notice they stopped this service. Today I cant even get any information about errors ... updates ..
Is it only me, a fault or .....
Jørgen Granborg Denmark
|
|
|
|
|
How can I change the text color in a cedit depending on what was entered.
i do have an onctlcolor function that inits the color when the dialog opens but i can not seem to call the function after the load of the dialog? I did create a sendmessage but i am not sure what the params should be. I have found quite abit of info on the onctlcolor function but nothing on how to call it.
|
|
|
|
|
How can I change the text color in a cedit depending on what was entered.
i do have an onctlcolor function that inits the color when the dialog opens but i can not seem to call the function after the load of the dialog? I did create a sendmessage but i am not sure what the params should be. I have found quite abit of info on the onctlcolor function but nothing on how to call it.
|
|
|
|
|
How can I change the text color in a cedit depending on what was entered.
i do have an onctlcolor function that inits the color when the dialog opens but i can not seem to call the function after the load of the dialog? I did create a sendmessage but i am not sure what the params should be. I have found quite abit of info on the onctlcolor function but nothing on how to call it.
|
|
|
|
|
OnCtlColor is one of a series of calls that will get made in response to a WM_PAINT event being fired. So how would you programmatically send an WM_PAINT to your CEdit? Call the Invalidate member function; this is available since CEdit derives from CWnd. This will force your edit control to be redrawn.
CodeGuy
http://groups.yahoo.com/group/wtl
|
|
|
|
|
very nice and easy. thankyou
|
|
|
|
|
I have created an object of my own class which is derived from the class "CToolBarCtrl". But I do not know how to show the object as a new toolbar in the frame window and how to attach a resource to my object. Please help. Thanks.
Maer.
|
|
|
|
|
You should derive your class from CToolBar, not from CToolBarCtrl. CToolBar is designed to integrate into frame window architecture (docking/floating stuff).
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for your reply.
I find your reply very useful. I follow your methods, but still have a trouble.
Here is my codes:
//newtoolbar is a class member of the View class
//based on a MDI program
//"IDR_TOOLBAR1" is the resource id of the newtoolbar.
newtoolbar.Create(WS_CHILD|WS_VISIBLE|CCS_TOP,CRect(0,0,100,100),(CMainFrame*)(AfxGetApp()->GetMainWnd()),IDR_TOOLBAR1);
newtoolbar.ShowWindow(SW_SHOW);
When running the program, the origin toolbar disappears and nothing is diaplayed in the origin toolbar position.
How to resolve the porblem?
Thanks.
Maer
|
|
|
|
|
What happens if you change the 'newtoolbar' variable type to CToolBar?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for your reply.
Your method really works well. Here is my source codes:
//my program is based on MDI
newtoolbar.Create((CMainFrame*)(AfxGetApp()->GetMainWnd()),WS_CHILD | WS_VISIBLE | CBRS_TOP,NEWTOOLBAR);
newtoolbar.LoadToolBar(IDR_TOOLBAR1);
((CMainFrame*)(AfxGetApp()->GetMainWnd()))->RecalcLayout();
//where NEWTOOLBAR is the ID of the toolbar window,
//newtoolbar is a data class member of the "View" class,
//"IDR_TOOLBAR1 is" the resource id of the toolbar resource
Thanks again.
Maer
|
|
|
|
|
Ive been wanting to start becomming a better coder.
THere is so much out there and even on this site, im confused as to where even to start!
Ive bought books one C and read tutorials, and I am fairly familiar to c/c++, but when it comes to actually making something worthwhile, other than those stupid printf("hello world!\n");
things then i dont know where to start.
...
|
|
|
|
|
There are so many places you can go - are you wanting to write console programs rather than Windows ones ? If not, then you need to get a good book on MFC. What you probably need to do is decide what sort of program you will write, choose something simple and then learn whatever you need to get it done.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
How to show a window in full screen?
Thanks.
|
|
|
|