|
After using MFC to create an SDI the first thing I do is add a class "CLine" and then 2 member variables m_pfFrom and m_ptTo. I then try adding a function to my class to initialize the from and to points.
Return type blank: and a function name of
CLine(CPoint ptFrom, CPoint ptTo)
I think either I am doing somehting wrong in the wizard or there is a different procedure for this. Like I said, I am quite new to this. In VS6 I have no problems adding functions like this, in .Net I do. I'd really like to start using .Net, so if someone would please advise me on this I would really appreciate it a lot.
Thanks
|
|
|
|
|
After using MFC to create an SDI the first thing I do is add a class "CLine" and then 2 member variables m_pfFrom and m_ptTo. I then try adding a function to my class to initialize the from and to points.
Return type blank: and a function name of
CLine(CPoint ptFrom, CPoint ptTo)
I think either I am doing somehting wrong in the wizard or there is a different procedure for this. Like I said, I am quite new to this. In VS6 I have no problems adding functions like this, in .Net I do. I'd really like to start using .Net, so if someone would please advise me on this I would really appreciate it a lot.
Thanks
|
|
|
|
|
G. White wrote:
CLine(CPoint ptFrom, CPoint ptTo)
I presume you are entering the whole prototype into the edit box. In VS 7 you do it different. Just enter the name of the function into the edit box. You enter the arguments into the list separately.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Thanks a lot! I would never have figured it out!
|
|
|
|
|
Hello White
Could you please change your CP email ID. Seems as if your CP id is an old one you don't use anymore. I just got a bounce of the mail notification. Or could you at least turn off notification as otherwise everyone who replies to you would get bounced notify mails.
----- Original Message -----
From: <zenix1@mailcity.com>
To: "Nishant S" <nish@in.inapp.com>
Sent: Wednesday, August 07, 2002 8:54 PM
Subject: Re: [CodeProject] Re: Help? I'm new.
> I no longer use this email. Get lost!
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
I shut off the auto reply feature, I'm sorry. I was getting a lot of spam and it really irritated me.
Thanks
|
|
|
|
|
The sooner you wean yourself off the wizards and add things by hand, the better off you will be.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
How do i make a pointer to point to a function.
and i hope to have this pointer to be able to point to several type of functions?
like
CString getDate();
CString getMonth(int i);
how can make a pointer to point either to these two functions??
thanxs in advance
|
|
|
|
|
aldeba wrote:
how can make a pointer to point either to these two functions??
You can't. The signatures of functions are different - getDate doesn't have arguments, while getMonth takes one integer argument.
Why would you like to have one pointer which can point to either of these functions?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
you can use a void * pointer to point at either function:
void *p = getDate;
p = getMonth;
-c
WWJD? JWRTFM. found on /.
|
|
|
|
|
just tak ein to a void pointer .after that cast them in to appropriate funtion type..
Renjith-CPian.
|
|
|
|
|
Hi,
On the dialog-based application, I put the Hide Dialog button, and the code for : OnHideDialog() is like:
ModifyStyle(WS_SHOWWINDOW, 0,0);
When I click the Hide Dialog button, it seems like the dialog is like a ghost, it's there but the window behind it receives the focus.
Can anyone explain me why and how to fix it ?
Thanks
|
|
|
|
|
Try with ShowWindow(SW_HIDE) instead.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Like someone else said you should use ShowWindow. But, to be precise, it's the WS_VISIBLE style you'd want to remove: ModifyStyle( WS_VISIBLE, 0, 0 );
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
I keep receiving an error when i am working with my .rc and resource.h saying that they have been modified outside of visual studio, and asking if i want to reload them.. i am the only person using the software, or editing the files, and it just asked me the same thing and reloaded them a few minutes ago.. i keep getting this error about reloading the resource, what could cause this? i think this may somehow be related to my other main problem i posted last night.
which can be found here:
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&fr=26#xx252677xx[^]
any ideas on either thing? .net is actin real screwy..
-dz
|
|
|
|
|
Chances are it is your AV software getting in the way. This has been a problem long before .NET.
Tim Smith
"Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
Hoare - 1980 ACM Turing Award Lecture
|
|
|
|
|
welp i've disabled it, but how could this cause the problem? does NAV actually scan .h or .rc files?
thanks for the suggestion, hopefully thats it..
-dz
|
|
|
|
|
I get this in VS.NET occasionally and I don't run AV software... I'll see if I can dupe it.
I'd tell all my friends
But they'd never believe me
They'd think that I'd finally lost it completely.
|
|
|
|
|
I try to scroll a MFC rich edit control to the last line but it seems that i don't understand the LineScroll method's behaviour.
Do you know how to properly use it?
rechi
|
|
|
|
|
Hi,
I have a class
class CTestDlg : public CDialog , public D360::CController
{
which I want to respond to messages like
BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
ON_MESSAGE(OLDA_WM_BUFFER_DONE, OnBufferDone)
END_MESSAGE_MAP()
This worked when the CTestDlg class only inherited from CDialog, but now I get the following compilation error
error C2440: 'type cast' : cannot convert from 'int (__thiscall CTestDlg::*)(unsigned int,long)' to 'long (__thiscall CWnd::*)(unsigned int,long)'
Pointers to members have different representations; cannot cast between them
I don't know much about the D360::CController class, it was supplied with some hardware.
Any suggestions would be appreciated.
Will
|
|
|
|
|
Do you really have to derive from D360::CController? Are there any CController virtual functions you are overriding?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
As far as I can tell, yes I do have to derive from D360::CController - it is doing something I don't understand with ATL to interface with the hardware. The only example code the company sent me used multiple inheritance.
Is this a general problem with ON_MESSAGE and multiple inheritance, or just a strange quirk of the classes I am trying to inherit from?
Will
|
|
|
|
|
Will Woods wrote:
Is this a general problem with ON_MESSAGE and multiple inheritance, or just a strange quirk of the classes I am trying to inherit from?
Well, the MFC wasn't designed with multiple inheritance in mind. This means that you can't have your object derived from CCoolWnd and COtherWnd. OTOH, you can derive your object from CWnd (or CView, CDialog, or any other MFC window class) and non-MFC class[es]. In such case you just have to make sure that MFC class is first in the base classes list. I've used this approach in many MFC-based projects.
So one possible reason for your problems would be CController deriving from some MFC class. Can you have a look on the D360 docs?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Problem solved - I had declared the callback functions to return bool (as 'required' by some other hardware drivers) - changing the return type to LRESULT fixed the problem.
I wonder why this compiled ok (I just checked it, it does) before I added the second inheritance??
Thanks for your help.
Will
|
|
|
|
|
I am reading a book on the GDI and have noticed that the author deletes an object before reusing it but do not delete it before restoring the 'Old Object'. Why is this? Is it good practise to delete the object anyway, after reselecting the 'Old Object'?
|
|
|
|