Saturday, February 19, 2011

How To create edit box using vc++

Overview

An edit box is a control used to either display text, to request text, or to do both. It it provided as a rectangular control with a sunken white background and 3-D borders.
To add an edit box and click the desired area on a form or a dialog box. To add a new edit box programmatically, declare a variable or a pointer to CEdit using its constructor. To initialize it, call its Create() method. Here is an example:
BOOL CLabelDlg::OnInitDialog() 
{
 CDialog::OnInitDialog();
 
 // TODO: Add extra initialization here
 CEdit *Musician = new CEdit;

 Musician->Create(WS_CHILD | WS_VISIBLE,
               CRect(10, 50, 150, 70), this, 0x1552);
 return TRUE;  // return TRUE unless you set the focus to a control
               // EXCEPTION: OCX Property Pages should return FALSE
}
To change the text of the control, a user can click it and start typing. This is possible if allowed it, which is the default behavior. If you don't want the user to be able to change the text of an edit box, at design time, check its Read Only check box or set it to True. To dynamically set an edit box to read-only, add the ES_READONLY style to it.
The text of an edit box displays its characters at they are set in the alphabet. If you want to hide the characters of an edit box, check its Password check box at design time. In this case, the characters would appear as x. If you prefer a different character, call the SendMessage() function with the EM_SETPASSWORDCHAR as the message. Here is an example:
BOOL CLabelDlg::OnInitDialog() 
{
 CDialog::OnInitDialog();
 
 // TODO: Add extra initialization here
 m_AccountPassword.SendMessage(EM_SETPASSWORDCHAR, '&', 0);

 return TRUE;  // return TRUE unless you set the focus to a control
               // EXCEPTION: OCX Property Pages should return FALSE
}
Multiline Edit Boxes

By default, an edit box is used to display a single line of text. An edit box is referred to as multiline when it can display its text on more than one line.
To create a multiline edit box, use the same Edit control as the above single line Edit box. To make this a multiline edit box, set its Multiline property to True. To do this at run time, add the ES_MULTILINE style to the CEdit. At design time, to make it obvious that the control can display more than one line of text, heighten it:
Edit Box
If the user is typing text in an edit control and press Enter, the control, usually a button, that is the default would be activated. This feature is valuable for a single line edit box. If you are creating a multiline edit box, you should allow the user to press Enter while entering text into the control. This would prevent the default button from being activated and would transfer the caret to the next line. To provide this functionality, add the ES_WANTRETURN style or, at design time, set the Want Return property to True.
If the text of the edit control is longer than the edit control can display at one time, you should equip it with scroll bars. To do this, at design time, set the Horizontal and/or the Vertical Scroll properties to True. At run time, add the WS_HSCROLL and/or the WS_VSCROLL properties.
Edit Box Methods

The edit box of Visual C++ does not allow you to set its text at design time but this can easily be done at run time. You can programmatically change the text of an edit box control. If you had Added a Value Control to the edit box and you had set the type to CString, to specify its text, call the CString::Format() method and make sure you update its value with the dialog box by calling UpdateData(FALSE). Here is an example:
BOOL CLabelDlg::OnInitDialog() 
{
 CDialog::OnInitDialog();
 
 // TODO: Add extra initialization here
 m_Display.Format("On s'en fout");

 UpdateData(FALSE);
 return TRUE;  // return TRUE unless you set the focus to a control
               // EXCEPTION: OCX Property Pages should return FALSE
}
If you had added a Control Variable of type CEdit, Visual C++ would initialize it with an empty string in the constructor. You then use the constructor to initialize the control. Here is an example:
CLabelDlg::CLabelDlg(CWnd* pParent /*=NULL*/)
 : CDialog(CLabelDlg::IDD, pParent)
{
 //{{AFX_DATA_INIT(CLabelDlg)
 m_Display = _T("Kassav' - Nou La");
 //}}AFX_DATA_INIT
}
At any time, you can call the CWnd::SetWindowText() method to change the text of the edit box. If you did not add the control variable, you can get its pointer using CWnd::GetDlgItem(). Here is an example:
BOOL CLabelDlg::OnInitDialog() 
{
 CDialog::OnInitDialog();
 
 // TODO: Add extra initialization here
 CEdit *Display;

 Display = reinterpret_cast<CEdit *>(GetDlgItem(IDC_DISPLAY));
 Display->SetWindowText("Word Processing");

 return TRUE;  // return TRUE unless you set the focus to a control
               // EXCEPTION: OCX Property Pages should return FALSE
}
Like the static text control, the edit box starts displaying its text from the left side of the allocated rectangle. This alignment is controlled by the Align Text property. At design time, you can set it to Left, Center, or Right. If you are programmatically creating the control, you can change its text alignment with the following styles: ES_LEFT, ES_CENTER, or ES_RIGHT respectively.
Edit Control Messages

To manage its role on a form or dialog box, an edit control is equipped with some messages known as notifications. These notifications messages are:
ON_EN_SETFOCUS: The event name for this notification is called OnSetFocus. It is sent when an edit box receives focus. This happens when the user clicks the edit box or after previously pressing Tab, to give focus to the control:
BEGIN_MESSAGE_MAP(CDialog3aDlg, CDialog)
 //{{AFX_MSG_MAP(CDialog3aDlg)
 ON_WM_SYSCOMMAND()
 ON_WM_PAINT()
 ON_WM_QUERYDRAGICON()
 ON_EN_SETFOCUS(IDC_LAST_NAME, OnSetFocusLastName)
 //}}AFX_MSG_MAP
END_MESSAGE_MAP()

...

void CDialog3aDlg::OnSetFocusLastName() 
{
 // TODO: Add your control notification handler code here
 m_Message.SetWindowText("The First Name has focus");
}
ON_EN_CHANGE: The OnChange event of this notification occurs as the user is typing text in the edit control. This happens as the user is changing the content of an edit control, which sends a message that the content of the edit box has changed. You can use this event to check, live, what the user is doing in the edit box. For example, if you create a dialog box or a form with a first and last names edit boxes, you can use another edit box to display the full name. You can implement the OnChange events of the edit boxes as follows:
BEGIN_MESSAGE_MAP(CDialog3aDlg, CDialog)
 //{{AFX_MSG_MAP(CDialog3aDlg)
 ON_WM_SYSCOMMAND()
 ON_WM_PAINT()
 ON_WM_QUERYDRAGICON()
 ON_EN_SETFOCUS(IDC_LAST_NAME, OnSetFocusLastName)
 ON_EN_CHANGE(IDC_FIRST_NAME, OnChangeFirstName)
 ON_EN_CHANGE(IDC_LAST_NAME, OnChangeLastName)
 //}}AFX_MSG_MAP
END_MESSAGE_MAP()

...

void CDialog3aDlg::OnChangeFirstName() 
{
 // TODO: Add your control notification handler code here
 m_FirstName.GetWindowText(m_strFirstName);
 m_LastName.GetWindowText(m_strLastName);
 CString FullName  = m_strFirstName + " " + m_strLastName;

 m_FullName.SetWindowText(FullName);
}

void CDialog3aDlg::OnChangeLastName() 
{
 // TODO: Add your control notification handler code here
 m_FirstName.GetWindowText(m_strFirstName);
 m_LastName.GetWindowText(m_strLastName);
 CString FullName  = m_strFirstName + " " + m_strLastName;

 m_FullName.SetWindowText(FullName);
}
ON_EN_UPDATE: The OnUpdate event is sent after the content of an edit box has changed but before the text is formally displayed.
ON_EN_MAXTTEXT: When adding a variable for the edit control, you can specify the maximum allowable number of characters the user can enter. If the user attempts exceeding this maximum, an OnMaxtext() event fires. You can catch this event to let the user know about the problem. If you set up the Maximum Characters fine, you do not need to perform any "if" or "while" checking. The edit control would do it itself.
ON_EN_ERRSPACE: The OnErrSpace event is event is sent if the compiler encountered a problem when attempting to allocate memory space to the control.
ON_EN_KILLFOCUS: The OnExit event occurs when the control loses focus. In the case of an edit box, this could happen if the control has focus and the user presses Tab; the edit box would lose focus.

Click Here to watch Live Cricket
ICC’s Cricket World Cups are the most prestigious and most widely followed event in India. . Reliance Mobile also kicked off a series of promotional activities for ICC CWC 2011 as part of the partnership for the 2011 edition of the tournament scheduled to begin in February 2011. Cricketing legend and key member of Indian Cricket team which won the World Cup in 1983, Syed Kirmani was present at the occasion.
This marked the beginning of the Reliance Mobile’s Trophy Preview across India before the tournament kicks off in Dhaka, Bangladesh on February 19, 2011. The ICC CWC 2011 Trophy will be handed over to the winning team of this tournament which is the 10th edition.
Reliance Communications has a long standing association with Cricket having sponsored prestigious events like the ICC Champions Trophy and all the editions of the ICC World T20. The company received overwhelming response to its Value Added Services (VAS) offerings from cricket loving fans during the ICC World T20 tournaments. Encouraged by this,Reliance Mobile is all set to launch a host of services that provides exciting audio and video content on both 3G and 2G platforms during the ICC CWC 2011. The company has bagged the license to offer 3G services in 13 key circles including Mumbai, Delhi and Kolkata.Reliance Mobile also offers pan-India CDMA and GSM Services across 24000 towns and 6 lakh Indian villages serving over 115 million customers.
Reliance Mobile will go LIVE with all ICC CWC 2011 matches through its already live specially created ICC zone on R-World VAS platform. Reliance Mobile customers will be able to keep a track of the 49 ICC CWC 2011 matches via WAP and SMS Alerts. They will be able to watch live stream of match highlights videos, watch previews and match round-ups, and download wallpapers and ringtones, anytime anywhere, with their handsets on both GSM and CDMA networks.
For cricket buffs, Reliance Mobile will provide access to ICC rankings, archived content of previous tournaments, news & analysis of match/tournament/players, ball-by-ball score updates on Wireless Application Protocol (WAP) and Data protocol. Customers will have the choice of downloading video clips and receiving video alerts over SMS.
Reliance Mobile customers will have a range of services to choose from including video clippings of all matches India plays with live audio commentary and moment-by-moment text commentary on their handsets. Customers can capture the action and rare moments of the championship and set them as wallpapers. They can also set the ICC World Cup theme song as their caller ring back tune and download the video of the theme song.
Commenting on Reliance Mobile’s association with ICC Cricket World Cup 2011, Akshay Kumar, CEO & Regional Head, South West, Reliance Communications said, “The key market drivers will be the increasing availability of 3G services and support for high quality video, the globalization of sport personalities and club support, and the improvement of digital sports rights for mobile distribution.”
He added, “These drivers apply to many types of leisure and information content, but none more so than sports content. There is a great opportunity for content owners, application service providers and operators to exploit sport content over the mobile channel in multiple innovative ways”
Mobile sports information and entertainment services are expected to take an increasing share of global mobile sports, leisure and information content (infotainment) market over the next five years. Juniper Research forecasts that the global market for mobile sports content and service will grow at an average growth rate of 27 percent.
Reliance Mobile will offer this world class application for iPhone, iTouch devices, Blackberry, Android & Symbian enabled devices, Nokia Ovi Store, Java devices and Samsung app store handsets.
ICC Chief Executive Haroon Lorgat said: “As we prepare for what will be a great celebration of the game at our flagship event next year, we are fortunate to have a group of top-class partners whose commitment to the game is unquestioned. Without that commitment we would not be in a position to help our 105 Members grow the game as they do around the world. Through its commitment to and passion for the game,Reliance Mobile is helping to make our great sport even greater.”
ICC Cricket World Cup 2011:
The ICC CWC 2011 will be played in the 50 over a side or ODI format. The top 14 cricketing nations will participate to vie for the prestigious top spot. The event opener hasIndia taking on Bangladesh at the Dhaka on February 19th, 2011 post an elaborately planned opening ceremony and the final will take place at Wankhade Stadium, Mumbai on April 2nd, 2011. Bangladesh, India and Sri Lanka are host nations and the matches are being played across 13 stadia spread across these three countries.
The 14 teams have been placed into two Groups, which are as follows:
Group A: Australia, Pakistan, New Zealand, Sri Lanka, Zimbabwe, Canada & Kenya
Group B: India, South Africa, England, West Indies, Bangladesh, Ireland & the Netherlands
The tournament comprising of 49 matches will be played across a span of 42 days with India hosting 29 matches across eight venues including the finals and one semi-final. Sri Lanka will host 12 matches at three venues across the island nation; Bangladesh will host eight matches at two venues including the inaugural game and one quarter final, both to be played at Dhaka.
The 10th edition of the ICC CWC is expected to be an intensely gruelling and fiercely competitive tournament between the 14 teams who will battle for a record prize pool of US $ 10 million. All the matches will be aired live on ESPN Star Sports.

Friday, February 18, 2011

How To Lose Belly Fat

How to lose belly fat is one of very common question these days among many of us reason being our unhealthy and sedentary lifestyles. Belly fat is positioned very deep the body skin and may cause many diseases at times including diabetes, heart diseases and cholesterol level. Thus belly fat not only raises visual problems but functional problems as well. Here I am outlining some simple tips on how to lose belly fat:

How To Lose Belly Fat With Help Of A Diet:

Diet is of utmost importance where belly fat is concerned. Eating fat-friendly diet would not only stop enlargement of belly but would also help body to fight fat. You must start eating 5-6 mini meals in a day rather than 3 main and larger meals. It would help lose belly fat as we will be eating less during main meals. Small and regular interval meals also boost metabolism as body requires more energy in order to do frequent digestions. Losing belly fat would be a breeze. We recommend starting day with rich breakfast and ending it with poor dinner. Apart from frequency of meals, type of meal is also important. Some foods help lose belly fat like fish/ vegetables/ fruits/ black chocolates etc. Contrary to this, few foods destroy the efforts to lose belly fat. Foods high in saturated fats/ sugar must not be included in our diet.If you are looking on tips on how to lose belly fat, also look to drinking correct drink; best drink being water. Water is essential and vital for our body as it helps liver proper function and that accelerates fat burning process as liver has the ability to burn fat stored in reserves and convert it to energy. So drink lots and lots of water avoiding full dairy drinks like milk shakes or chocolate drinks and soft drinks. Better alternative is Fresh fruit juice but eating fruits is even better. Learn about the truth about six pack abs program.

How To Lose Belly Fat By Doing Some Exercise

Another way to lose belly fat apart from diet is exercise. Some forms of exercise are:
Resistance training exercises: It includes various Weight lifting exercises that help body to fight fat along with building muscles. There are not any of specific or particular exercises to lose belly fat particularly without losing fat from other area. Working with abdominal exercises, stomach muscles may get tighter as well as stronger. Other weight lifting exercises include squats/ dumbbell rows/ chest presses etc.
Cardio exercises: These are also very beneficial if you plan to lose belly fat. Cardio exercises also accelerate heart rate making us breathe faster thus body spending more energy. Find out about the best way to lose belly fat fast. While exercising, it is important to feel increasing heart rate and faster breathing. In case you are exercising without feeling any pressure, results won’t be that good. Exercising must be done regularly (at least 3-4 times/ week). Exercising only once and not doing it for a month is more like nothing done at all.
Losing belly fat is not a simple thing and lots of effort must be put in the process. I am trying to key in important information on how to lose belly fat. People keep on trying many things and don’t get success in the first attempt itself. You must have also heard about various machine based equipment to lose weight but I definitely do not recommend them at all. Other option you would come across when searching on tips on how to lose belly weight would be various types of belts (Sauna belt, Abs Belt) that promise to give you slimmer belly in specific time. But I assure that nothing would be good enough or better than exercising right and eating right. Perhaps you should do exercises to lose belly fat. Slimming belts would not be producing satisfactory results and even if it does, these are temporary. As soon as you stop using these, fat would pile up back on belly. These activities also reduce metabolism levels of or body thus causing more harm in long run than doing any good.
Next available thing in market is what we call the Morning Walkers, which claims to burn belly fat just by laying down on floor for 10- 15 minutes twice a day. It is for you to believe or not but I would be very judgmental in this and believe that even if your body is working, your mind is relaxing which may cause conflict between function of your body and mind.
How to lose belly fat is a tough to answer whereas gaining that fat is simplest thing. Moreover the lifestyle of today also force us to sit for long hours for work, comfort of cars that don’t allow us to walk and moreover life is so busy that we don’t find time for our self.

How To Open a Rar file

How To: Open a Rar file

How can you open a Rar file downloaded from a web site or received in an email? What is a Rar file anyway? This article will answer your questions and provide links to free downloads of the best Windows and Mac software to open Rar files.

What is a Rar file?

Rar files are compressed archives. The term "Archive" means that the file may contain not just one, but several files. It may even contain folders full of files, much like folders on your hard disk. "Compressed" means that mathematical techniques have been used to reduce the space needed to store the files, so that the size of the archive may be much smaller than the total size of the files it contains. In short, Rar files are a space-saving way of storing single files or groups of related files.
There are many different compression techniques in use today. "Rar" is a development of the Zip compression method invented by a Russian programmer Eugene Roshal (hence the name, Roshal Archive.) The Rar format uses advanced compression algorithms that can create some of the smallest archives - typically 8 to 30 per cent smaller than Zip archives - but the penalty is that compression may take a long time.
Other benefits of the Rar file format include redundancy, which can enable damaged archives to be repaired, and support for international character sets, allowing files with non-English filenames to be stored. For this last reason, Rar files are often used by computer users in Russia and other countries that use different alphabets.
Files stored in a Rar archive will decompress to exactly their original state. This is called "lossless compression." By contrast, the compression methods used to create JPG photo image files or MP3 music files are called "lossy compression" because some of the quality of the original image or sound is lost during the compression process.
Rar files occupy less storage space and take less time to send or download. They also provide a convenient way to package and send groups of related files. However, you can't run a program directly from a Rar file. The contents of the archive must be extracted to a folder on your hard drive before they can be used.
No computer operating system has built-in support for the Rar archive format. So if you have received a Rar file you will need to download and install some third party software to open it. There are several programs that can open Rar files on both Windows and Mac OS.

Open Rar files in Microsoft Windows

ssIf you want to open Rar files on a Windows PC, Tech-Pro.net recommends BitZipper 2010. We believe that BitZipper 2010 is the best Windows archive manager available. It can open Rar files, Zip files and just about any other compressed or encoded file format you are ever likely to come across in the future.
As well as allowing you to open all these file types, BitZipper 2010 lets you create archives using many of these formats. It's also a fast and flexible backup tool. So it's something you'll find useful for a lot more tasks than opening the occasional Rar archive!
BitZipper 2010 has a Wizard interface that makes it easy to use even if you have never seen a Rar file before. More experienced users can benefit from the a Classic interface, shown on the right, which provides menu and toolbar access to all the product's functions. BitZipper 2010 is a solid and stable archive manager that can handle the largest archives without crashing.
BitZipper 2010 runs on Windows 2000, Windows XP, Windows Vista and new Windows 7.

Open Rar files in Mac OS X

Stuffit lets you open Rar files on a MacIf you use an Apple Mac computer then we recommend Stuffit Deluxe to open Rar files. Stuffit is one of the classic Mac utilities that have been around since the first Apple Macs, and contains a complete set of tools for opening and creating the various types of compressed archive that you find on the Web.
Stuffit has a handy "Quick Look" feature which saves time by letting you peek inside archives without opening them. It can also be used as a powerful backup program, which can create encrypted archives that can be saved directly to iDisk, CDs, DVDs or an FTP server. Stuffit Deluxe also has some great tools that make it really easy to send large files (up to 2GB) to your friends and coworkers,

Creating Rar files

The programs described above will enable you to open Rar files that you receive or download from the web. The only products that can create Rar files are those developed by the owners of the Rar format, RARLAB: WinRAR for Windows and RAR for Mac OS X.
The use of uncommon compression formats such as Rar causes problems for others who do not have the software to open them. Tech-Pro.net's advice is to use only the standard Zip format when creating archives that are intended to be opened by other people, as support for Zip archives is now built in to most computer operating systems.

How to Set Background Picture for a PowerPoint File?

What is PowerPoint? As we know, PowerPoint is really amazing software from Microsoft. Microsoft PowerPoint is an application for creating presentations, A PowerPoint presentation is formatted like a slide show, and accordingly, the basic unit of the PowerPoint presentation is called a "slide". As you make an oral presentation, you can click through the slides to reinforce your ideas. PowerPoint presentations can also be presented without accompanying oral discussion or printed out as briefing books for a meeting.
Therefore, more and more people learn and seek to design a good PowerPoint file day by day. So then to meet more and more people's requirement, here I also would like to join in to share some knowledge with you!
Refer to how to design a attractive PowerPoint, there is a function you must use. That is how to set background picture for a PowerPoint file.
Set Background Picture for a PowerPoint file in PowerPoint 2003
  • Open/Create a PowerPoint file
  • Choose one slide, Right Click, and then click Background.

  • Click on Pull-Down Menu, Choose the Fill Effects... .

  • Choose the Picture tab at the top of the Fill Effects dialog box. Click on the Select Picture...button to locate the photo saved on your computer.
  • Click on OK to add the picture to the slide background.
  • Click on Apply to All or Apply button
Set Background Picture for a PowerPoint file in PowerPoint 2007
  • Select the slide that you want to add a background picture to. To select multiple slides, click a slide, and then press and hold CTRL while you click the other slides.
  • On the Design tab, in the Background group, click Background Styles, and then click Format Background. Design tab
  • Click Fill, and then click Picture or texture fill.
  • Do one of the following:
    • To insert a picture from a file, click File, and then locate and double-click the picture that you want to insert.
    • To paste a picture that you copied, click Clipboard.
    • To use clip art (clip art: A single piece of ready-made art, often appearing as a bitmap or a combination of drawn shapes.) as a background picture, click Clip Art, and then in the Search text box, type a word or phrase that describes the clip (clip: A single media file, including art, sound, animation, or movies.) that you want, or type all or part of the file name of the clip. To include clip art that is available on Microsoft Office Online in your search, select the Include content from Office Online check box, click Go, and then click the clip to insert it.
  • Do one of the following:
    • To use the picture as a background for the slides that you selected, click Close.
    • To use the picture as a background for all of the slides in your presentation, click Apply to All.

How To get Live Cricket Score

A passion! A mania! A thing divine! In India, this is what cricket is synonymous with.This land of 1 billion people has adopted cricket as if the game has been a part of its identity since ages. Everything else comes to a stand still for cricket freaks when any cricket match is being played.Keeping a track of cricket score becomes the most important task on hand. India is a country where the game of cricket and cricket players give inspiration to thousand of people.

MapsofIndia takes you through the annals of the Indian cricket. Along with detailed articles on India cricket, we also bring you live cricket scores of all the matches being played by the Indian cricket team.To get the live cricket score of India match Click here.

Thursday, February 17, 2011

How to export data’s directly in excel format from tally 7.2 and Tally 8

Tally 9 allow you to export data’s directly in excel format. But you can’t do it in tally 7.2 and tally 8.
Here is a small tutorial for you exporting tally data’s from version 7.2 in excel file.
Consider exporting daybook.Go to day book press export button or use shot cut key Alt+E. Exporting screen will displayed.
tally export screen
Press Back space on your keyboard. And select Format as ASCII (comma delimited). Now give output File Name as Daybook.csv, now select some other option you want to export from the bottom of the screen.
tally export ready screen
Press enter to accept screen. Day book is exported in to tally program folder. Check program folder for file daybook.csv,
csv file
Double click on it, the file will open in excel program. If you want it in excel work sheet file, use the option Saveas, and save it in Microsoft excel workbook (*.xls) format.