 |
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
Hello, my name is Dor, and I'm the marketing manager of Miranor, a software company that develops products and services for programmers.
We would like to invite the members of the "codeproject" community to beta-test our new "Live Widget" service (http://miranor.co.il/livewidget/?src=158446), which can improve the productivity of programmers, freelancers in particular.
Thanks, Dor.
|
|
|
|
 |
Here is my Program
In the line int GCD(num1,num2) I get the warning
" warning: parameter names (without types) in function declaration [enabled by default]| "
But if I use int GCD(int a,int b) the warning is not there.
NOTE - In both cases the program runs perfectly.
I am a newbie, so I would appreciate if someone helps me regarding this....
/* I am using mingw with code blocks */
#include<math.h>
#include<stdio.h>
#include<conio.h>
int GCD(num1,num2);
main()
{
int num1,num2;
printf("\n\tEnter the two numbers whose GCD is to be found : ");
scanf("%d %d",&num1,&num2);
printf("\n\tGCD of %d & %d is %d",num1,num2,GCD(num1,num2));
getch();
}
int GCD(int a ,int b)
{
if (b>a)
return GCD(b,a);
if(b==0)
return a;
else
return GCD(b,a%b);
}
#include<math.h>
#include<stdio.h>
#include<conio.h>
int GCD(num1,num2);
main()
{
int num1,num2;
printf("\n\tEnter the two numbers whose GCD is to be found : ");
scanf("%d %d",&num1,&num2);
printf("\n\tGCD of %d & %d is %d",num1,num2,GCD(num1,num2));
getch();
}
int GCD(int a ,int b)
{
if (b>a)
return GCD(b,a);
if(b==0)
return a;
else
return GCD(b,a%b);
}
#include<math.h>
#include<stdio.h>
#include<conio.h>
int GCD(num1,num2);
main()
{
int num1,num2;
printf("\n\tEnter the two numbers whose GCD is to be found : ");
scanf("%d %d",&num1,&num2);
printf("\n\tGCD of %d & %d is %d",num1,num2,GCD(num1,num2));
getch();
}
int GCD(int a ,int b)
{
if (b>a)
return GCD(b,a);
if(b==0)
return a;
else
return GCD(b,a%b);
}
|
|
|
|
 |
You should always declare the parameter types to avoid confusion.
|
|
|
|
 |
So i need to specify that they are integers, right ?
|
|
|
|
|
 |
Quote: Is it possible of getting same answer for inverse of matrix 100*100 dimension using gsl lib and matlab
|
|
|
|
 |
Of course you must get the same answer (within rounding effects), otherwise one (or both) libraries would have been broken.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
 |
It depends what you mean by 'extract'. You would need to know the structure of the data on the disk, and design a structure for the system you want to store it on. The issue is a matter of design rather than programming.
|
|
|
|
 |
Could you please tell me how to get Google's PageRank for a desired web page using C++ language? Thank you!
|
|
|
|
 |
You might start here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
 |
Hi,
I have a dialog form inside a pane that has a popup menu which messages are handled in the CMainFrame. I am doing this because the same menu exists also in another pane.
In this case, the acceleratos of the Dialog's popupmenu are hidden since the MFC framework does not "see" any message handlers inside the dialog. The messages as I said before, are handled in the CMainFrame. The accelerators itself works just fine, the only problem is that does not show up in the screen to inform the user.
So, how to force MFC framework to show the dialog's accelerator keys ? I tried to add message handlers in the dialog class but it didn't worked.
sdancer75
|
|
|
|
 |
Going on a screen-shot in this article: An examination of menus from a beginner's point of view[^]
Particularly, this image: http://www.codeproject.com/KB/menus/MenusForBeginners/MenuItemEdit.jpg[^]
You can see that adding a tab character and then the text to indicate the accelerator is the way it's done.
So, to make a menu item that says "Bold" and indicates the functionality can be achieved by hitting Ctrl-B, I'd use the text "Bold\tCtrl-B". Unlike the use of the & character to underline the following letter _and_ make the folowing letter actually work, with accelerators, you have to add the text and the accelerator yourself in 2 steps. One as I mentioned, by adding a tab separator between the main text and the accelerator text and the other, by adding an accelerator table,as you've already done.
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
|
|
|
|
 |
Hi,
You may did not understand the problem. The menus are created dynamically and they have their accelerators shortcut keys as declared below.
VERIFY(popmenu.CreatePopupMenu());
popmenu.AppendMenu(MF_STRING, ID_MENU_STRETCH_NORMAL, _T("&Option 1\tAlt+1"));
popmenu.AppendMenu(MF_STRING, ID_MENU_STRETCH_MAX, _T("&Option 2\tAlt+2"));
The problem is that when the popup is showning up to the screen, the acceleratos keys are hidden for the reason I explained in my first post.
Regards,
sdancer75
|
|
|
|
 |
sdancer75 wrote: Hi,
You may did not understand the problem.
Hi,
Yes, I think that is true.
If I understand correctly, the accelerator 'hints' on the popup menu are fine. However, when the popup is displayed, the accelerator hints of the dialog are hidden.
If so, I'm still not sure I understand what the issue is - i.e, a popup menu has the keyboard and mouse focus until it dissapears. It is the WindowProc of the popup that receives all input, so in that case it seems to me, that displaying the accelerators of the dialog would not be useful.
However, you've already mentioned that the accelerators are working correctly. This, combined with the thread title and your last post leaves me confused as to what your intentions and problem are.
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
|
|
|
|
 |
enhzflep wrote: If I understand correctly, the accelerator 'hints' on the popup menu are fine. However, when the popup is displayed, the accelerator hints of the dialog are hidden.
That's correct.
By default if you start a new MFC app and you create a menu that have some acceleration keys, if you are not handling in some way their messages ie loading the accel table, then it automatically disables them.
The problem is that I handle the accel keys not in the dialog but in the MainFrame where the same menu also exists !!!
Regards,
sdancer75
|
|
|
|
 |
Hi,
Microsoft has pulled the carpet from underneath me too often. I am now seriously considering going to Linux. Windows 8.XX is entirely incompatible with providing software for a cash register program. WinXP SP1 was perfect for same, As is MFC42 and VC5.00.
Are there equivalents for the same environment for Linux.
Managed Code is an un acceptable alternative. Internet access by the end product is not required.
What is the closest development environment in Linux, to VC 5.00
Regards,
Bram
Bram van Kampen
|
|
|
|
 |
Netbeans or Eclipse
.'\ /`.
.'.-.`-'.-.`.
..._: .-. .-. :_...
.' '-.(o ) (o ).-' `.
: _ _ _`~(_)~`_ _ _ :
: /: ' .-=_ _=-. ` ;\ :
: :|-.._ ' ` _..-|: :
: `:| |`:-:-.-:-:'| |:' :
`. `.| | | | | | |.' .'
`. `-:_| | |_:-' .'
`-._ ```` _.-'
``-------'/xml>
|
|
|
|
 |
You may also consider Codelite[^] and even passing to Java programming language.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
 |
Thanks,
Java is something I would never consider. The suite is leased by customers under an annual licence. Distributing Java Code would jeopardise revenue collection because of easy decompilation. CodeLite merits further investigation though.
However, The entire project consists of 1100 Files, roughly 900 of these relate to MFC, the remaining 200 relate to Non MFC CPP Classes, or, to plain 'C' Code. Hence, I am looking for File Conversion(and not of the video type) This can range from a set of suitable and crafty '#define'S to the writing of a parser and code generator.
The project started in earnest in 2001 on Win98 Architecture. The existing Code Base is considered 'Bug Free' since 2005.
Bram van Kampen
modified 2 days ago.
|
|
|
|
 |
If you have a lot of existing MFC code, wxWidgets is really modeled to be similar (actually not sure if it was modeled on MFC or it just sort of evolved similarly).
|
|
|
|
 |
Wx would have been my suggestion, too.
A gui I have with custom controls and drawing works equally well under XP, Vista, Win7 and linux. On hardware as varied as a q8400, i3, i7 and a raspberry pi. Simply build for the appropriate platform and voila! Portable, consistent code/gui.
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
|
|
|
|
 |
Bram van Kampen wrote: Windows 8.XX is entirely incompatible with providing software for a cash register program.
(just curious)
In what way? it does not make sense; usually, hardware like that have their own "OS" (and it is usually not Windows)
AFAIL, MFC has not changed since the 2008 feature pack.
Are you using a proprietary SDK/OS for the cash register machine ?
I'd rather be phishing!
|
|
|
|
 |
|