CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Managed C++ and C++/CLI
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Managed C++ and C++/CLI Discuss Managed C++ and .NET-specific questions related to C++.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old July 20th, 2005, 02:56 AM
    Markus1982 Markus1982 is offline
    Junior Member
     
    Join Date: Jul 2005
    Posts: 24
    Markus1982 is an unknown quantity at this point (<10)
    Unhappy Graphics decleration???

    Hello together!

    I have the following problem.

    I want to draw and I cannot create Graphics and Pens

    Graphics* graph
    Pen* pen

    The mistake message:

    Indirektion with * not possible.

    What can I do to draw?
    Reply With Quote
      #2    
    Old July 20th, 2005, 03:09 AM
    Darka Darka is offline
    Member
     
    Join Date: Jan 2005
    Location: Brighton, England
    Posts: 241
    Darka will become famous soon enough (65+)
    Re: Graphics decleration???

    Please post your code.
    Reply With Quote
      #3    
    Old July 20th, 2005, 03:12 AM
    Markus1982 Markus1982 is offline
    Junior Member
     
    Join Date: Jul 2005
    Posts: 24
    Markus1982 is an unknown quantity at this point (<10)
    Re: Graphics decleration???

    I don't have my code here now I will post it later.
    Reply With Quote
      #4    
    Old July 20th, 2005, 03:15 AM
    Markus1982 Markus1982 is offline
    Junior Member
     
    Join Date: Jul 2005
    Posts: 24
    Markus1982 is an unknown quantity at this point (<10)
    Re: Graphics decleration???

    But I just created a new C++ Project and then wanted to declerate a Graphics object with * (indirect).

    And that doesn't work
    Reply With Quote
      #5    
    Old July 21st, 2005, 02:01 PM
    Markus1982 Markus1982 is offline
    Junior Member
     
    Join Date: Jul 2005
    Posts: 24
    Markus1982 is an unknown quantity at this point (<10)
    Re: Graphics decleration???

    Code:
    #pragma once
    
    
    namespace TicTacToe
    {
    	using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Data;
    	using namespace System::Drawing;
    
    	public ref class Form1 : public System::Windows::Forms::Form
    	{
    	private: 
    		Graphics* graph;
    		Pen* pen;
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    			graph=this->CreateGraphics();
    			pen=gcnew Pen(Color::Black);
    			graph->DrawLine(pen, 20,20, 100, 200);
    		}
    
    	protected:
    		/// <summary>
    		/// Clean up any resources being used.
    		/// </summary>
    		/// <param name="disposing">"description of the parameter"</param>
    		virtual void Dispose(Boolean disposing) override
    		{
    			if (disposing && components)
    			{
    				delete components;
    			}
    			__super::Dispose(disposing);
    		}
    
    	private:
    		/// <summary>
    		/// Required designer variable.
    		/// </summary>
    		System::ComponentModel::Container ^components;
    
    #pragma region Windows Form Designer generated code
    		/// <summary>
    		/// Required method for Designer support - do not modify
    		/// the contents of this method with the code editor.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			this->components = gcnew System::ComponentModel::Container();
    			this->Size = System::Drawing::Size(300,300);
    			this->Text = L"Form1";
    			this->Padding = System::Windows::Forms::Padding(0);
    			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    		}
    #pragma endregion
    	};
    }
    Pls let me know if you have an idea how to prevent that mistake

    Last edited by Andy Tacker; July 22nd, 2005 at 05:37 AM.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Managed C++ and C++/CLI


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 03:43 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009