Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
| Search | Today's Posts | Mark Forums Read
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 17th, 2007, 09:08 PM
Registered User
 
Join Date: Mar 2007
Location: Athens, Attiki, Greece.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default New to VC++ .Things to clear out

Hello to everyone.
I am new to VC++ environment.I have download and use the vc++ 2005 Express Edition. Please some help to clear out some things:

1.With vc++ 2005 Express Edition I don't have the MFC , is that true?
So what do I loose (for graphics , classes e.t.c.), what is that I cannot do?What should+can I download , for free, to have full functionality?
2.What is the difference between : Microsoft Platform SDK ,Visual Studio and .NET ?
3. In a window form, created with the WindowForm project generator of VC++ 2005 EXPRESS, I want to add an array, as property, to keep track of the coordinates, x and y, of some (about 20 )user's clicks on my form , and so to be able to redraw the form on a paint message.I add the property as a two dimension array and I get errors.Can I , and how should, add array in my form properties?Here is the code:
#pragma once


namespace Mammos3 {

    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;

    /// <summary>
    /// Summary for Form1
    ///
    /// WARNING: If you change the name of this class, you will need to change the
    /// 'Resource File Name' property for the managed resource compiler tool
    /// associated with all .resx files this class depends on. Otherwise,
    /// the designers will not be able to interact properly with localized
    /// resources associated with this form.
    /// </summary>
    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
        int QuantumsNumber;
           int points[20][1];

        Form1(void)
        {
            InitializeComponent();
            //
            //TODO: Add the constructor code here
            //
            QuantumsNumber=0;

        }

    protected:.....................................
.................................................. .....

4.How could I open another form2 from a button in a form1?
5.In order not to ask you all the time, where can I find info about the classes,their properties and member functions (for graphics,database manipulation e.t.c.) ?
(I have Ivor Horton's Visual C++ 2005 but I whant more...)

Thanks in advance.


  #2 (permalink)  
Old March 18th, 2007, 12:54 AM
Authorized User
 
Join Date: Mar 2007
Location: , , USA.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:
1.With vc++ 2005 Express Edition I don't have the MFC, is that true?
So what do I loose (for graphics, classes e.t.c.), what is that I cannot do? What should+can I download, for free, to have full functionality?
2.What is the difference between : Microsoft Platform SDK ,Visual Studio and .NET ?
Well if you download Platform SDK, you get afx libraries in the MFC folder. I haven't tried to compile MFC source in the VC++ express so I can't personally tell you if it works. But I know that the wizards for MFC aren't there.

The .NET framework can be programmed in any language that supports it: C++ (at least microsoft's version), J# (the ms version of java), C#, and VB are the primary languages.

Quote:
quote:
3. In a window form, created with the WindowForm project generator of VC++ 2005 EXPRESS, I want to add an array, as property, to keep track of the coordinates, x and y, of some (about 20 )user's clicks on my form , and so to be able to redraw the form on a paint message.I add the property as a two dimension array and I get errors.Can I , and how should, add array in my form properties?Here is the code:
http://msdn2.microsoft.com/en-us/library/xhfb39es.aspx
I suppose that your best bet is to use a List, I suppose
Code:
   using namespace System::Collections::Generic;
   // .......

   public ref class Form1 : public System::Windows::Forms::Form
   {
   public:
      List<Point> ^points;

      Form1(void)
      {
         InitializeComponent();
         points = gcnew List<Point> ();
      }
      // .......
Then, whenever you need to add a new point:
Code:
points->Add(Point(x, y));
The thing about .NET is that all the rules you learned about memory management goes strait out the window. Although you still need to delete points in the destructor. .NET uses managed code, which you'll have to look up (it's a whole separate topic).

Quote:
quote:
4.How could I open another form2 from a button in a form1?
In the form design, drag a button into the form and when you're ready double click on the button. VS will write a new method for you, for example:
Code:
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
}
You'll have to write the code into this method:
Code:
{
   OtherForm form2 = new OtherForm();
   form2.Show(this);
}
This assumes that you've already created another form using the the Add New Item button.

Quote:
quote:
5.In order not to ask you all the time, where can I find info about the classes,their properties and member functions (for graphics,database manipulation e.t.c.) ?
MSDN of course.. and usually google will link directory to MSDN if you search for the method name. http://msdn2.microsoft.com/en-us/library/default.aspx

For reference, in VS you can also get information on the classes you use by pressing F1 on the selected text.



Similar Threads
Thread Thread Starter Forum Replies Last Post
All things Blobs and Strings Morrislgn Pro Visual Basic 2005 0 January 18th, 2006 12:56 PM
convert VC++ 5.0 project to VC++ 6.0 MIDL ERR mdahd90943 Visual C++ 0 May 26th, 2005 08:57 AM
Other things to try Martyn JSP Basics 0 August 29th, 2003 09:44 AM
Things that bug you about ASP David Cameron Classic ASP Professional 4 July 13th, 2003 09:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.