|
Hi
Ok it does not only ask you if you want to add a new class but to select an existing one.
Chances are you may have a screwed up dsp file. so relink you class and all will be well.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Hi BaldwinMartin,
Thanks for your kind reply. Yes, I just relink the class by typing in the same class name in the MCF Class Wizard, but when I clicked ok, it gave me "Object 'CMy' already exists" error message.
Anything I am missing here?
thanks again
|
|
|
|
|
Hi what version of VC are you working with please?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
|
Sorry over my head I am still on 6 and never plan to switch.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
You might want to check out the .net forum instead.
The fourth law of robotics states that if you cannot find and any reconciliation between the fisrt three laws - go on a killing rampage
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
Ok guys,
thanks for the help. I will try there now.
|
|
|
|
|
I made a client application (dialog based) with automation support and when i try to use AtlAdvice or AfxConnectionAdvice the compiler cries.
where am i going wroung please help. Do i need to include some header file,
I thought AfxXXXX are global functions of MFC
Regards
Prakash.
The World is getting smaller and so are the people.
|
|
|
|
|
Is is possible to color the inside/background of a slider control? (trackbar)
|
|
|
|
|
Yes look at http://www.codeproject.com/miscctrl/roundsliderctrl.asp?target=subclass%7Cslider
note only how he changes the bg color.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Hello
I have been working on a program and been getting some good help from everyone thank you
well i am back again with another question like i have said before i am still new to this.
i am trying to add a dialog to my program so that when i click on a button it will bring up a new dialog box with buttons and stuff on it. i have been searching tutorials but i might have over looked it
so if anyone knows of tutorials that would be great
thank you for you time
nate
"Effort within the mind further limits the mind, because effort implies struggle towards a goal and when you have a goal, a purpose, an end in view, you have placed a limit on the mind"
|
|
|
|
|
Hi
OK bring up your project and click on the resource view tab.
Expand the resources +
right click on the dialog folder
select insert dialog
right click on the dialog and select properties
Name the dialog something like IDD_MYDIALOG
right click on the dialog and select class wizard
Add a class dlg appears
select create a new class
call the new class something like CMyDialog
Alway start your classes with the capital C (it does not have to be this way but it will help later)
Select the base class as CDialog
select OK
If your project is a sdi or mdi select mainframe or view class
If you project is a dialog select the maindlg class
Select the cpp of the main class and at the top among the other #include statements insert the following
#include "MyDialog.h"
Note with left the C off the include statement.
Now put a button on your main dialog and right click and change the properties to IDC_MYBUTTON
double click on the button and add a handler
it will look like this
void MyMainClass::OnMybutton()
{
// TODO: Add your control notification handler code here
}
now add the follow code to the OnMyButton handler
CMyDialog dlg;
if(dlg.DoModal() == IDOK){
AfxMessageBox("We are back in the main class and you selected OK in the child dialog MyDialog");
}
So the button handler should look like this
void MyMainClass::OnMybutton()
{
CMyDialog dlg;
if(dlg.DoModal() == IDOK){
AfxMessageBox("We are back in the main class and you selected OK in the child dialog MyDialog");
}
}
compile and run
So what you have done is:
1. insert a new resource MyDialog
2. created a new class based on CDialog
3. Added a include statement to the class you wish to call the dialog from
4. added a button
5. created a handler for the button
6. added the code to call the button
7. returned to the calling class.
good luck and keep up the good work!
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Are you using MFC or the Win32 API?
Well... I am a beginner ...
|
|
|
|
|
is there any way to pass a variable argument list on to another function (I'm trying to make a wrapper for sprintf). for example:
void myfunc(char* format, .../*args*/)
{
//some code...
//how do i pass the argument list to sprintf???
sprintf(acharbuffer, format, ?HOW_DO_I_PASS_THE_ARGS?);
}
-thanks
|
|
|
|
|
BOOL MyAppDlg::SamplePassArgs(CString *pstr, int dVar, UINT uVar, CString strvar)
Now you may also overload the function
BOOL MyAppDlg::SamplePassArgs(int dvar)
or
BOOL MyAppDlg::SamplePassArgs(CString strvaar)
or
BOOL MyAppDlg::SamplePassArgs()
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Hi BaldwinMartin,
I'm sorry, I don't understand your reply at all. I'm not using MFC, and I think my function definition was ok, I just didn't know how to call sprintf inside myfunc with the argument list that was passed into myfunc. For example, I want to call myfunc like
myfunc("2 ints: %i, %i\n", 100, 200);
and then inside myfunc call sprintf with the var list. Sorry if I'm not explaining it right...
Thanks for your reply though!
|
|
|
|
|
You need to use va_*() functions.
e.g. :
Format( const char *F, ... )
{
if( !F ) return;
char buff[1024] = '\0';
va_list l;
va_start(l, F);
_vsnprintf(buff, 1020, F, l);
va_end(l);
}
... or you could use the other va_*() functions to walk the argument list and do your own parsing.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
|
Hello all! I'm trying to make a instant messaging app for my home network, and I am using RTF controls for text input and conversation display. I am currently having a problem, though, appending (for testing and later implementation) the string I enter in the text input RTF control to the conversation RTF control preserving all the RTF formatting information. Any ideas on how I would go about doing this?
Sean Payne
|
|
|
|
|
What derived view are you using?
CBL
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
Actually, I'm not using a view. The conversation dialog has two CRichEditCtrl controls (I've extended the class for easier RTF information extraction to CString using a function called "CString GetText(bool bGetRTF)" (the bool parameter tells me to get plaintext or RTF formatted info)). So basically, I used Visual C++'s dialog editor and added two Rich Edit controls to the dialog. That's basically my setup. Thanx!
Sean Payne
|
|
|
|
|
If i want to hook a rich text box on a window, what msg's should i be looking for.
I.E. when a rich text box gets data set to it, what kind of WM_ msgs (or EM_) are processed by the system? what should my hook look for?
|
|
|
|
|
Anyone knows how to?
Thanks
~Mike
|
|
|
|
|
Are you looking for the function atoi? this is an old but much maligned function. If it is you you only have to say "Thanks masked man - you have saved my life"
go cobol young man - go cobol
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|