|
in OOP speech 'sending messages' usually translates to 'calling methods'. Hence your classes might provide public methods for 'sending messages'.
If you meant something else, please let us know (that is: "be more specific!").
Veni, vidi, vici.
|
|
|
|
|
In MFC speech however, it has a very specific meaning, and this is a C/C++/MFC forum. So just need clarification on what he's done and whether he's using MFC.
|
|
|
|
|
thank you all i got it ..
and sorry for the improper information
thanks
|
|
|
|
|
If you're talking about sending messages within the Windows environment, it's relatively simple given that you've subclassed from the proper MFC classes. You can use a number of them so share a bit of code and we'll let you know what's your best option.
|
|
|
|
|
1>c:\msw_give_out\void_effect_no_input_msw_shotplus_i_format\blast_vib_procdlg.cpp(1908): error C2666: 'pow' : 6 overloads have similar conversions
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(583): could be 'long double pow(long double,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(581): or 'long double pow(long double,long double)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(535): or 'float pow(float,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(533): or 'float pow(float,float)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(497): or 'double pow(double,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(122): or 'double pow(double,double)'
1> while trying to match the argument list '(float, double)'
1>c:\msw_give_out\void_effect_no_input_msw_shotplus_i_format\blast_vib_procdlg.cpp(1909): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
1>c:\msw_give_out\void_effect_no_input_msw_shotplus_i_format\blast_vib_procdlg.cpp(1923): error C2666: 'pow' : 6 overloads have similar conversions
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(583): could be 'long double pow(long double,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(581): or 'long double pow(long double,long double)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(535): or 'float pow(float,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(533): or 'float pow(float,float)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(497): or 'double pow(double,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(122): or 'double pow(double,double)'
1> while trying to match the argument list '(float, double)'
How to fix the error?
Thanks
|
|
|
|
|
A good help would be if you have posted the line where the error occurs.
However, the error states that you are calling the pow function with the first argument being a float , and the second one being a double . But there is no overload of the pow function for these argument types. You should cast one value to the type of the other:
float f1 = 2.0;
double f2 = 3.0;
double f3 = pow(static_cast<double>(f1), f2);
A general note:
If you did not need the float type for a specific reason (usually memory), you should consider to always use double .
|
|
|
|
|
Thank you for your helpful correction. If I change all 'float' type to double, my program would be too large.
How about change all types to 'float' ?
Thanks
|
|
|
|
|
Changing all float to double in a program would not increase the size too much. Only the size of static and initialized floating point values is doubled. During runtime, the size of dynamically allocated values (arrays) is doubled.
You may use float if you are sure that the precision is sufficient. This depends on the operations performed and the required accuracy.
I added the note to better use double because you are using the pow() function. If you add the return value to other values like in polynomial functions, there may be inexact results when using float .
|
|
|
|
|
thank you, really helped me.
|
|
|
|
|
i have IDD_mainmenu as default created by VS2010 . When I click a File in mainmenu with handle click and call another Dialog . It is alright . But when I create a button and create class for that dialog to handle click button event . When I click , no thing happen ! . I have try and Ask many but rare people know
http://www.mediafire.com/?2gwt06lg3sd794m
When run , click on HERE and then Button1 . After click no thing happen even when program handler event to show the message .
I test and find no error but it does not do .
Thank you .
hi world
|
|
|
|
|
Step 1. Cut lines 154 - 177 (inc) from 2.cpp
Step 2. Paste to bottom of 2.h
Step 3. Copy lines 175 and 176 from 2.cpp
Step 4. Replace lines 134 and 135 in 2View.cpp with the text copied in step 3
In a nutshell:
When the Help->About menu option was selected, a variable of type CAboutDlg was instanced and then had the DoModal member function called.
However, when the Here->1.1 menu option was selected, you were loading a CDialog with the appearance of the About dialog - that is to say, the resource was not hooked up to a class object of the correct type, so it could not fire the handler for the Button1 button.
Step 1&2: Move class definition for CAboutDlg to 2.h
Step 3&4: Instance correct object (CAboutDlg, not CDialog)
|
|
|
|
|
Hi
I have done like you had showed .
http://www.mediafire.com/?tra9l1xoh04qwah[^]
And still nothing done ! .
Thank you
Can you show me basically the way to make it work ? . Thank you a lot . Have nice day .
hi world
|
|
|
|
|
Not quite there yet...
You didn't replace the code for CMyView::OnHere1
Copy the code from CMy2App::OnAppAbout and replace the code for CMyView::OnHere1 with it.
|
|
|
|
|
|
why the code of game is not show
|
|
|
|
|
rucha warade wrote: why the code of game is not show
What does this mean; please explain your problem clearly?
[edit]As this is your first question on this site, I suggest you read HOW-TO-ASK-A-QUESTION[^].
[/edit]
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
You've lost the game[^].
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Mystical Superpowers, I believe.
It is the same magic we should use to guess your scenario, I suppose.
Veni, vidi, vici.
|
|
|
|
|
Hi all,
Cant we hide a CLabelControl after declaring a variable..???
I am getting a run time error for this.
Test.h
CLabelControl m_Test;
Test.cpp
DDX_Control(pDX, IDC_LABEL_TEST, m_Test);
BOOL CExampleDlg::OnInitDialog()
{
CLabelControl* lTest;
lTest=(CLabelControl*)GetDlgItem(IDC_LABEL_TEST);
lTest->ShowWindow(SW_HIDE);
return true;
}
If i comment
//CLabelControl m_Test; in Test.h
//DDX_Control(pDX, IDC_LABEL_TEST, m_Test); in Test.pp
Then it runs without any error.
Can anyone have any idea
Thanks in Advance
Sharan
|
|
|
|
|
Your label control does not exist at the point you are trying to hide it.
You need to call CDialog::OnInitDialog in your OnInitDialog method before the control exists.
BOOL CExampleDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CLabelControl* lTest;
lTest=(CLabelControl*)GetDlgItem(IDC_LABEL_TEST);
lTest->ShowWindow(SW_HIDE);
return true;
}
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Dear all,
can any one provide me the "C source code for A* algorithm"
|
|
|
|
|
|
Dear Friend,
From my PC, I have to read the text file from another PC(server PC).
After that i have to invoke one "EXE" (application) present in that same PC(Server PC).
Then i have to send the information what i have read from that file to this application.
Kindly help me.
|
|
|
|
|
Are both PCs on the same network and able to share disks? If so you can just read the file and execute the program from the server's shared disk.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|