SlideShare a Scribd company logo
C++.NET
Windows Forms Course
L01 - Introduction

Mohammad Shaker
mohammadshakergtr.wordpress.com
C++.NET Windows Forms Course
@ZGTRShaker
.NET  What will you learn?
•
•
•
•
•
•

OOP with .NET, Thinking OOP and The Concept of .NET
Peek on C++.NET console
Debugging in .NET
Windows Forms Controls (Tabs, ComboBox, Timers, ...etc)
Drawing with .NET
Collections
.NET  What will you learn?
•
•
•
•
•

Event Handling
Exception Handling
Files processing - Strings Manipulating
Dynamic Controls associated with Event Handling
The Concept of C#
What’s .NET?
• .NET Framework :
– A collection of technologies that …
• Unite isolated applications
• Make information available anytime, anywhere
• Simplify development and deployment
What’s .NET?
• .NET Framework :
– Common Language Runtime* – provides an abstraction layer over the
operating system
– Base Class Libraries
• pre-built code for common low-level programming tasks

– Development frameworks and technologies
• Reusable
• customizable solutions for larger programming tasks

_________________________________________________
*The Common Language Runtime (CLR) is the virtual machine component of the .NET Framework. All
.NET programs execute under the supervision of the CLR, guaranteeing certain properties and behaviors in
the areas of memory management, security, and exception handling.
Some .NET Base Class Libraries
System.Web
Services
Description

Discovery
Protocols

System.WinForms
UI

Design

ComponentModel

HtmlControls
WebControls

System.Drawing

Security

Caching
Configuration

Drawing2D

Printing

SessionState

Imaging

Text

System.Data

System.Xml

ADO

SQL

XSLT

Design

SQLTypes

Serialization

XPath

System
Collections

IO

Security

Configuration

Net

ServiceProcess

Runtime
InteropServices

Diagnostics

Reflection

Text

Remoting

Globalization

Resources

Threading

Serialization
Visual Studio® .NET

Manage
and Collaborate

Planning
Analysis
Design
Development
Testing
Deployment
.NET Platform
.NET Framework, Languages, Tools
VB

C++

C#

JScript

Web
Services

User
Interface
Data and XML

Base Class Library
Common Language Runtime

Visual Studio .NET

Common Language Specification

…
Common Language Runtime
Base Class Library Support
Thread Support

COM Marchaler

Type Checker

Exception Manager

Security Engine

Debug Engine

IL to Native
Compilers

Code
Manager
Class Loader

Garbage
Collector
.NET Framework Services
 ASP.NET
 Logical evolution of ASP (compiled)
 Web forms
 Manageable code (non spaghetti)
 Windows® forms
 Framework for building rich clients
 ADO.NET, evolution of ADO
 New objects (e.g., DataSets)
 XML Support Throughout
Introduction to .NET
Introduction to .NET
• The .NET Framework allows you to:
– Apply common skills across a variety of devices , application types ,
and programming tasks
– Integrate with other tools and technologies to build the right
solution with less work
– Build compelling applications faster

• .NET Framework releases :
– 1 , 1.1 , 2 , 3 , 3.5 , 4, 4.5
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
.NET IDE and Frameworks
• .NET With Visual Studio 2008  2010  2012  2013
• Framework 3.5  4.0  4.5
Resources for .NET
 http://www.w3.org/TR/SOAP/ - W3C standards for SOAP implementation

 http://www.uddi.org – UDDI standards for web services implementation
 http://www.microsoft.com/net - Microsoft .NET home
 http://msdn.microsoft.com/net - Microsoft .NET developers home
 http://msdn.microsoft.com/xml - Microsoft XML developers home
 http://msdn.microsoft.com/webservices – Microsoft Web Services developers home

 http://www.gotdotnet.com – Developers .NET resource
C++ Windows Forms L01 - Intro
Controls
•
•
•
•
•
•
•
•

Form
Button
CheckBox
CheckedListBox
ComboBox
Label
ListBox
PictureBox

•
•
•
•
•
•
•

ProgressBar
RadioButton
TextBox
Panel
TabControl
DataGridView
Timer
Con.sole
Console
C++ Windows Forms L01 - Intro
Console
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
return 0;
}
Console
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
What’s this?

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
What a “namespace” is?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
Why using another namespace?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
“main”
Why?

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
Why isn’t it just a void?!
#include "stdafx.h"
Why passing a string “args”
// CppdotNetConsoleCourseTest.cpp : main project file.

using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
Easy, right?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
What’s that?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
Object/Class

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
“::” ?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

Console::WriteLine

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

Console::WriteLine

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console ^myConsole=gcew Console();
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console ^myConsole=gcew Console();
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
Console
Creating an instance of class “Console”

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console ^myConsole=gcew Console();
Console::WriteLine(L"Hello World");
Console::ReadKey();
return 0;
}
C++ Windows Forms L01 - Intro
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::Write("Hi, again!");
Console::WriteLine("n Hi, again!");
Console::Write("Hi, again!");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Console::Write("Hi, again!");
Console::WriteLine("n Hi, again!");
Console::Write("Hi, again!");
Console::ReadKey();
return 0;
}

Hello World
Hi, again!
Hi, again!
Hi, again!
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str1=gcnew String("Hi Hi Hi, first time.");
String ^str2="Hi Hi Hi, second time.";
String ^str3;
Console::Write("Enter your name plz: ");
str3=Console::ReadLine();
Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

Everything is dynamically allocated through pointer!

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str1=gcnew String("Hi Hi Hi, first time.");
String ^str2="Hi Hi Hi, second time.";
String ^str3;
Console::Write("Enter your name plz: ");
str3=Console::ReadLine();
Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

Why no gcnew here?!

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str1=gcnew String("Hi Hi Hi, first time.");
String ^str2="Hi Hi Hi, second time.";
String ^str3;
Console::Write("Enter your name plz: ");
str3=Console::ReadLine();
Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

Why no gcnew here?!

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str1=gcnew String("Hi Hi Hi, first time.");
String ^str2="Hi Hi Hi, second time.";
String ^str3;
Console::Write("Enter your name plz: ");
str3=Console::ReadLine();
Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str1=gcnew String("Hi Hi Hi, first time.");
String ^str2="Hi Hi Hi, second time.";
String ^str3;
Console::Write("Enter your name plz: ");
str3=Console::ReadLine();
Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str1=gcnew String("Hi Hi Hi, first time.");
String ^str2="Hi Hi Hi, second time.";
String ^str3;
Console::Write("Enter your name plz: ");
str3=Console::ReadLine();
Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

Returns the string that’s read from the input buffer

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str1=gcnew String("Hi Hi Hi, first time.");
String ^str2="Hi Hi Hi, second time.";
String ^str3;
Console::Write("Enter your name plz: ");
str3=Console::ReadLine();
Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.

Returns the string that’s read from the input buffer

#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str1=gcnew String("Hi Hi Hi, first time.");
String ^str2="Hi Hi Hi, second time.";
String ^str3;
Console::Write("Enter your name plz: ");
str3=Console::ReadLine();
Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!");
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i.ToString() + f.ToString());
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i.ToString() + f.ToString());
Console::ReadKey();
return 0;
}

It’s not a “->”
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i.ToString() + f.ToString());
Console::ReadKey();
return 0;
}

Where this method “ToString()” comes from?!
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i.ToString() + f.ToString());
Console::ReadKey();
return 0;
}
10
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
No “ToString()” method!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
How compiler works?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
How compiler works?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
How compiler works?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
How compiler works?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
How compiler works?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
How compiler works?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
How compiler works?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
How compiler works?!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
Arithmetic “Sum”!

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
Results a “float”

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
Results a “float”
in a “String” context

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
Results a “float”
in a “String” context

// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
float f=0;
Console::WriteLine(i + f);
Console::ReadKey();
return 0;
}

1
Console (Types Conversion)
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
String ^str=i.ToString();
Console::WriteLine(str);
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int i=1;
String ^str=i.ToString();
Console::WriteLine(str);
Console::ReadKey();
return 0;
}
1
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str="1123";
int i=Int32::Parse(str);
i++;
Console::WriteLine(i);
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str="1123";
int i=Int32::Parse(str);
i++;
Console::WriteLine(i);
Console::ReadKey();
return 0;
}
1124
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str="1123";
int i=0;
Int32::TryParse(str,i);
i++;
Console::WriteLine(i);
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str="1123";
int i=0;
Int32::TryParse(str,i);
i++;
Console::WriteLine(i);
Console::ReadKey();
return 0;
}
1124
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str="1123ccccc";
int i=0;
Int32::TryParse(str,i);
i++;
Console::WriteLine(i);
Console::ReadKey();
return 0;
}
Console
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
String ^str="1123ccccc";
int i=0;
Int32::TryParse(str,i);
i++;
Console::WriteLine(i);
Console::ReadKey();
return 0;
}
1
Arrays
C++ Windows Forms L01 - Intro
Arrays
• Defining an array of string with dimension of 3
public : array <String^ , 3 > ^MyArr;
Arrays
• Defining an array of string with dimension of 3
public : array <String^ , 3 > ^MyArr;

• Everything okay?
public : array <String^ , 3 > MyArr;
public : array <String , 3 > ^MyArr;

Both are Compiler Errors!
Arrays
• Sth wrong?
array <String ^ , 1 > ^MyArr;
MyArr[0][0]="1";
Compiler error
array <String ^ , 1 > ^MyArr;
MyArr[0]=1;

Compiler error
array <String ^ , 2> ^MyArr;
MyArr=gcnew array <String^ , 2 > (100,50);
MyArr[0,0]="1";

Everything is good
Arrays
• Sth wrong?
array <String ^ , 2> ^MyArr;
MyArr=gcnew array <String^ > (100,50);
MyArr[0,0]="1";
Compiler error

array <String ^ , 2> ^MyArr;
MyArr=gcnew array <String^ , 2 > (100,50);
MyArr[0][0]="1";
Compiler error
array <String ^ , 2> ^MyArr;
MyArr=gcnew array <String^ , 2 > (100)(50);
MyArr[0,0]="1";
Compiler error
Arrays
• Sth wrong?
array <String ^> ^MyArr;
MyArr=gcnew array <String^ > (50);
MyArr[0]="1";

Everything is good
Arrays
Arrays
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
array <String ^ , 1 > ^MyArr;
MyArr[0]="1";

Console::ReadKey();
return 0;

}
Arrays
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
array <String ^ , 1 > ^MyArr;
MyArr[0]="1";

Console::ReadKey();
return 0;

}
Ntn wrong!
Arrays
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
array <String ^ , 1 > ^MyArr;
MyArr[0]="1";

Console::ReadKey();
return 0;

}
Ntn wrong!
Arrays
// CppdotNetConsoleCourseTest.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
array <String ^ , 1 > ^MyArr;
MyArr[0]="1";

Console::ReadKey();
return 0;

}
Ntn wrong!
Arrays
• Considering that we have a class named “CELL”
array <CELL^ , 2> ^MyArr;
MyArr=gcnew array <CELL^ , 2 > (100,50);
CELL ^MyCell=gcnew CELL;
MyArr[0,0]=MyCell;
Arrays
• Considering that we have a class named “CELL”
array <CELL^ , 2> ^MyArr;
MyArr=gcnew array <CELL^ , 2 > (100,50);
CELL ^MyCell=gcnew CELL;
MyArr[0,0]=MyCell;
That’s it for today!

More Related Content

PDF
XNA L01–Introduction
Mohammad Shaker
 
PDF
Delphi L01 Intro
Mohammad Shaker
 
PPT
Powershell Seminar @ ITWorx CuttingEdge Club
Essam Salah
 
PPTX
OpenNTF Domino API - Overview Introduction
Paul Withers
 
PPTX
SUTOL 2015 - Utilizing the OpenNTF Domino API
Oliver Busse
 
PPTX
Professional Help for PowerShell Modules
June Blender
 
PDF
DanNotes 2013: OpenNTF Domino API
Paul Withers
 
PDF
A la découverte de TypeScript
Denis Voituron
 
XNA L01–Introduction
Mohammad Shaker
 
Delphi L01 Intro
Mohammad Shaker
 
Powershell Seminar @ ITWorx CuttingEdge Club
Essam Salah
 
OpenNTF Domino API - Overview Introduction
Paul Withers
 
SUTOL 2015 - Utilizing the OpenNTF Domino API
Oliver Busse
 
Professional Help for PowerShell Modules
June Blender
 
DanNotes 2013: OpenNTF Domino API
Paul Withers
 
A la découverte de TypeScript
Denis Voituron
 

What's hot (20)

PPTX
PowerShell - Be A Cool Blue Kid
Matthew Johnson
 
PDF
Pharo Status ESUG 2014
Marcus Denker
 
PDF
Go for Rubyists
tchandy
 
PDF
C# and vb
Enanin Saltarin
 
PDF
Reflection in Pharo5
Marcus Denker
 
PDF
Engage 2014 OpenNTF Domino API Slides
Paul Withers
 
PDF
#Pharo Days 2016 Data Formats and Protocols
Philippe Back
 
PPTX
Async programming and python
Chetan Giridhar
 
PDF
Awesome Concurrency with Elixir Tasks
Jonathan Magen
 
PDF
Docker and Fluentd
N Masahiro
 
PDF
Python, do you even async?
Saúl Ibarra Corretgé
 
PPTX
Utilizing the open ntf domino api
Oliver Busse
 
PDF
The Ring programming language version 1.5.4 book - Part 180 of 185
Mahmoud Samir Fayed
 
PPTX
C# 6 and 7 and Futures 20180607
Kevin Hazzard
 
PPTX
Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...
DevClub_lv
 
PPTX
Invoke-Obfuscation nullcon 2017
Daniel Bohannon
 
PDF
Introduction to Elm
Rogerio Chaves
 
PDF
#Pharo Days 2016 Reflectivity
Philippe Back
 
PDF
Dexador Rises
fukamachi
 
PPTX
Getting Started With PowerShell Scripting
Ravikanth Chaganti
 
PowerShell - Be A Cool Blue Kid
Matthew Johnson
 
Pharo Status ESUG 2014
Marcus Denker
 
Go for Rubyists
tchandy
 
C# and vb
Enanin Saltarin
 
Reflection in Pharo5
Marcus Denker
 
Engage 2014 OpenNTF Domino API Slides
Paul Withers
 
#Pharo Days 2016 Data Formats and Protocols
Philippe Back
 
Async programming and python
Chetan Giridhar
 
Awesome Concurrency with Elixir Tasks
Jonathan Magen
 
Docker and Fluentd
N Masahiro
 
Python, do you even async?
Saúl Ibarra Corretgé
 
Utilizing the open ntf domino api
Oliver Busse
 
The Ring programming language version 1.5.4 book - Part 180 of 185
Mahmoud Samir Fayed
 
C# 6 and 7 and Futures 20180607
Kevin Hazzard
 
Building .NET Core tools using the Roslyn API by Arthur Tabatchnic at .Net fo...
DevClub_lv
 
Invoke-Obfuscation nullcon 2017
Daniel Bohannon
 
Introduction to Elm
Rogerio Chaves
 
#Pharo Days 2016 Reflectivity
Philippe Back
 
Dexador Rises
fukamachi
 
Getting Started With PowerShell Scripting
Ravikanth Chaganti
 
Ad

Viewers also liked (8)

PDF
C# Starter L01-Intro and Warm-up
Mohammad Shaker
 
PDF
C++ Windows Forms L04 - Controls P3
Mohammad Shaker
 
PDF
C++ Windows Forms L09 - GDI P2
Mohammad Shaker
 
PDF
C++ Windows Forms L03 - Controls P2
Mohammad Shaker
 
PDF
C++ Windows Forms L11 - Inheritance
Mohammad Shaker
 
PDF
C++ Windows Forms L05 - Controls P4
Mohammad Shaker
 
PDF
C++ Windows Forms L06 - Utlitity and Strings
Mohammad Shaker
 
PDF
C++ Windows Forms L02 - Controls P1
Mohammad Shaker
 
C# Starter L01-Intro and Warm-up
Mohammad Shaker
 
C++ Windows Forms L04 - Controls P3
Mohammad Shaker
 
C++ Windows Forms L09 - GDI P2
Mohammad Shaker
 
C++ Windows Forms L03 - Controls P2
Mohammad Shaker
 
C++ Windows Forms L11 - Inheritance
Mohammad Shaker
 
C++ Windows Forms L05 - Controls P4
Mohammad Shaker
 
C++ Windows Forms L06 - Utlitity and Strings
Mohammad Shaker
 
C++ Windows Forms L02 - Controls P1
Mohammad Shaker
 
Ad

Similar to C++ Windows Forms L01 - Intro (20)

PDF
.NET Core, ASP.NET Core Course, Session 2
Amin Mesbahi
 
PPTX
Learn Electron for Web Developers
Kyle Cearley
 
PPTX
Tamir Dresher - Demystifying the Core of .NET Core
Tamir Dresher
 
PDF
Intro to .NET and Core C#
Jussi Pohjolainen
 
PDF
DevOPS training - Day 2/2
Vincent Mercier
 
PPTX
Next .NET and C#
Bertrand Le Roy
 
PPT
Dotnetintroduce 100324201546-phpapp02
Wei Sun
 
PPTX
(WPF + WinForms) * .NET Core = Modern Desktop
Claire Novotny
 
PPTX
TypeScript and SharePoint Framework
Bob German
 
PDF
Introduction-to-C-Part-1.pdf
AnassElHousni
 
PPT
DotNet Introduction
Wei Sun
 
PPTX
.NET Core: a new .NET Platform
Alex Thissen
 
PPTX
C++Basics2022.pptx
Danielle780357
 
PPTX
01. introduction to-programming
Stoian Kirov
 
PPTX
SOLID Programming with Portable Class Libraries
Vagif Abilov
 
PPTX
Deploying windows containers with kubernetes
Ben Hall
 
PPT
.NET Recommended Resources
Greg Sohl
 
PPTX
Mini .net conf 2020
Marco Parenzan
 
PPTX
Introduction to asp
Madhuri Kavade
 
PPTX
Asp.net and .Net Framework ppt presentation
abhishek singh
 
.NET Core, ASP.NET Core Course, Session 2
Amin Mesbahi
 
Learn Electron for Web Developers
Kyle Cearley
 
Tamir Dresher - Demystifying the Core of .NET Core
Tamir Dresher
 
Intro to .NET and Core C#
Jussi Pohjolainen
 
DevOPS training - Day 2/2
Vincent Mercier
 
Next .NET and C#
Bertrand Le Roy
 
Dotnetintroduce 100324201546-phpapp02
Wei Sun
 
(WPF + WinForms) * .NET Core = Modern Desktop
Claire Novotny
 
TypeScript and SharePoint Framework
Bob German
 
Introduction-to-C-Part-1.pdf
AnassElHousni
 
DotNet Introduction
Wei Sun
 
.NET Core: a new .NET Platform
Alex Thissen
 
C++Basics2022.pptx
Danielle780357
 
01. introduction to-programming
Stoian Kirov
 
SOLID Programming with Portable Class Libraries
Vagif Abilov
 
Deploying windows containers with kubernetes
Ben Hall
 
.NET Recommended Resources
Greg Sohl
 
Mini .net conf 2020
Marco Parenzan
 
Introduction to asp
Madhuri Kavade
 
Asp.net and .Net Framework ppt presentation
abhishek singh
 

More from Mohammad Shaker (20)

PDF
12 Rules You Should to Know as a Syrian Graduate
Mohammad Shaker
 
PDF
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Mohammad Shaker
 
PDF
Interaction Design L06 - Tricks with Psychology
Mohammad Shaker
 
PDF
Short, Matters, Love - Passioneers Event 2015
Mohammad Shaker
 
PDF
Unity L01 - Game Development
Mohammad Shaker
 
PDF
Android L07 - Touch, Screen and Wearables
Mohammad Shaker
 
PDF
Interaction Design L03 - Color
Mohammad Shaker
 
PDF
Interaction Design L05 - Typography
Mohammad Shaker
 
PDF
Interaction Design L04 - Materialise and Coupling
Mohammad Shaker
 
PDF
Android L05 - Storage
Mohammad Shaker
 
PDF
Android L04 - Notifications and Threading
Mohammad Shaker
 
PDF
Android L09 - Windows Phone and iOS
Mohammad Shaker
 
PDF
Interaction Design L01 - Mobile Constraints
Mohammad Shaker
 
PDF
Interaction Design L02 - Pragnanz and Grids
Mohammad Shaker
 
PDF
Android L10 - Stores and Gaming
Mohammad Shaker
 
PDF
Android L06 - Cloud / Parse
Mohammad Shaker
 
PDF
Android L08 - Google Maps and Utilities
Mohammad Shaker
 
PDF
Android L03 - Styles and Themes
Mohammad Shaker
 
PDF
Android L02 - Activities and Adapters
Mohammad Shaker
 
PDF
Android L01 - Warm Up
Mohammad Shaker
 
12 Rules You Should to Know as a Syrian Graduate
Mohammad Shaker
 
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Mohammad Shaker
 
Interaction Design L06 - Tricks with Psychology
Mohammad Shaker
 
Short, Matters, Love - Passioneers Event 2015
Mohammad Shaker
 
Unity L01 - Game Development
Mohammad Shaker
 
Android L07 - Touch, Screen and Wearables
Mohammad Shaker
 
Interaction Design L03 - Color
Mohammad Shaker
 
Interaction Design L05 - Typography
Mohammad Shaker
 
Interaction Design L04 - Materialise and Coupling
Mohammad Shaker
 
Android L05 - Storage
Mohammad Shaker
 
Android L04 - Notifications and Threading
Mohammad Shaker
 
Android L09 - Windows Phone and iOS
Mohammad Shaker
 
Interaction Design L01 - Mobile Constraints
Mohammad Shaker
 
Interaction Design L02 - Pragnanz and Grids
Mohammad Shaker
 
Android L10 - Stores and Gaming
Mohammad Shaker
 
Android L06 - Cloud / Parse
Mohammad Shaker
 
Android L08 - Google Maps and Utilities
Mohammad Shaker
 
Android L03 - Styles and Themes
Mohammad Shaker
 
Android L02 - Activities and Adapters
Mohammad Shaker
 
Android L01 - Warm Up
Mohammad Shaker
 

Recently uploaded (20)

PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
This slide provides an overview Technology
mineshkharadi333
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Doc9.....................................
SofiaCollazos
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 

C++ Windows Forms L01 - Intro

  • 1. C++.NET Windows Forms Course L01 - Introduction Mohammad Shaker mohammadshakergtr.wordpress.com C++.NET Windows Forms Course @ZGTRShaker
  • 2. .NET What will you learn? • • • • • • OOP with .NET, Thinking OOP and The Concept of .NET Peek on C++.NET console Debugging in .NET Windows Forms Controls (Tabs, ComboBox, Timers, ...etc) Drawing with .NET Collections
  • 3. .NET What will you learn? • • • • • Event Handling Exception Handling Files processing - Strings Manipulating Dynamic Controls associated with Event Handling The Concept of C#
  • 4. What’s .NET? • .NET Framework : – A collection of technologies that … • Unite isolated applications • Make information available anytime, anywhere • Simplify development and deployment
  • 5. What’s .NET? • .NET Framework : – Common Language Runtime* – provides an abstraction layer over the operating system – Base Class Libraries • pre-built code for common low-level programming tasks – Development frameworks and technologies • Reusable • customizable solutions for larger programming tasks _________________________________________________ *The Common Language Runtime (CLR) is the virtual machine component of the .NET Framework. All .NET programs execute under the supervision of the CLR, guaranteeing certain properties and behaviors in the areas of memory management, security, and exception handling.
  • 6. Some .NET Base Class Libraries System.Web Services Description Discovery Protocols System.WinForms UI Design ComponentModel HtmlControls WebControls System.Drawing Security Caching Configuration Drawing2D Printing SessionState Imaging Text System.Data System.Xml ADO SQL XSLT Design SQLTypes Serialization XPath System Collections IO Security Configuration Net ServiceProcess Runtime InteropServices Diagnostics Reflection Text Remoting Globalization Resources Threading Serialization
  • 7. Visual Studio® .NET Manage and Collaborate Planning Analysis Design Development Testing Deployment .NET Platform
  • 8. .NET Framework, Languages, Tools VB C++ C# JScript Web Services User Interface Data and XML Base Class Library Common Language Runtime Visual Studio .NET Common Language Specification …
  • 9. Common Language Runtime Base Class Library Support Thread Support COM Marchaler Type Checker Exception Manager Security Engine Debug Engine IL to Native Compilers Code Manager Class Loader Garbage Collector
  • 10. .NET Framework Services  ASP.NET  Logical evolution of ASP (compiled)  Web forms  Manageable code (non spaghetti)  Windows® forms  Framework for building rich clients  ADO.NET, evolution of ADO  New objects (e.g., DataSets)  XML Support Throughout
  • 12. Introduction to .NET • The .NET Framework allows you to: – Apply common skills across a variety of devices , application types , and programming tasks – Integrate with other tools and technologies to build the right solution with less work – Build compelling applications faster • .NET Framework releases : – 1 , 1.1 , 2 , 3 , 3.5 , 4, 4.5
  • 15. .NET IDE and Frameworks • .NET With Visual Studio 2008 2010 2012 2013 • Framework 3.5 4.0 4.5
  • 16. Resources for .NET  http://www.w3.org/TR/SOAP/ - W3C standards for SOAP implementation  http://www.uddi.org – UDDI standards for web services implementation  http://www.microsoft.com/net - Microsoft .NET home  http://msdn.microsoft.com/net - Microsoft .NET developers home  http://msdn.microsoft.com/xml - Microsoft XML developers home  http://msdn.microsoft.com/webservices – Microsoft Web Services developers home  http://www.gotdotnet.com – Developers .NET resource
  • 23. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); return 0; }
  • 25. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 26. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 27. Console What’s this? // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 28. Console What a “namespace” is?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 29. Console Why using another namespace?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 30. Console “main” Why? // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 31. Console Why isn’t it just a void?! #include "stdafx.h" Why passing a string “args” // CppdotNetConsoleCourseTest.cpp : main project file. using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 32. Console Easy, right?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 33. Console What’s that?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 34. Console Object/Class // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 35. Console “::” ?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 36. Console // CppdotNetConsoleCourseTest.cpp : main project file. Console::WriteLine #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 37. Console // CppdotNetConsoleCourseTest.cpp : main project file. Console::WriteLine #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 38. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console ^myConsole=gcew Console(); Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 39. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console ^myConsole=gcew Console(); Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 40. Console Creating an instance of class “Console” // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console ^myConsole=gcew Console(); Console::WriteLine(L"Hello World"); Console::ReadKey(); return 0; }
  • 42. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::Write("Hi, again!"); Console::WriteLine("n Hi, again!"); Console::Write("Hi, again!"); Console::ReadKey(); return 0; }
  • 43. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); Console::Write("Hi, again!"); Console::WriteLine("n Hi, again!"); Console::Write("Hi, again!"); Console::ReadKey(); return 0; } Hello World Hi, again! Hi, again! Hi, again!
  • 44. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str1=gcnew String("Hi Hi Hi, first time."); String ^str2="Hi Hi Hi, second time."; String ^str3; Console::Write("Enter your name plz: "); str3=Console::ReadLine(); Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!"); Console::ReadKey(); return 0; }
  • 45. Console // CppdotNetConsoleCourseTest.cpp : main project file. Everything is dynamically allocated through pointer! #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str1=gcnew String("Hi Hi Hi, first time."); String ^str2="Hi Hi Hi, second time."; String ^str3; Console::Write("Enter your name plz: "); str3=Console::ReadLine(); Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!"); Console::ReadKey(); return 0; }
  • 46. Console // CppdotNetConsoleCourseTest.cpp : main project file. Why no gcnew here?! #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str1=gcnew String("Hi Hi Hi, first time."); String ^str2="Hi Hi Hi, second time."; String ^str3; Console::Write("Enter your name plz: "); str3=Console::ReadLine(); Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!"); Console::ReadKey(); return 0; }
  • 47. Console // CppdotNetConsoleCourseTest.cpp : main project file. Why no gcnew here?! #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str1=gcnew String("Hi Hi Hi, first time."); String ^str2="Hi Hi Hi, second time."; String ^str3; Console::Write("Enter your name plz: "); str3=Console::ReadLine(); Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!"); Console::ReadKey(); return 0; }
  • 48. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str1=gcnew String("Hi Hi Hi, first time."); String ^str2="Hi Hi Hi, second time."; String ^str3; Console::Write("Enter your name plz: "); str3=Console::ReadLine(); Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!"); Console::ReadKey(); return 0; }
  • 49. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str1=gcnew String("Hi Hi Hi, first time."); String ^str2="Hi Hi Hi, second time."; String ^str3; Console::Write("Enter your name plz: "); str3=Console::ReadLine(); Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!"); Console::ReadKey(); return 0; }
  • 50. Console // CppdotNetConsoleCourseTest.cpp : main project file. Returns the string that’s read from the input buffer #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str1=gcnew String("Hi Hi Hi, first time."); String ^str2="Hi Hi Hi, second time."; String ^str3; Console::Write("Enter your name plz: "); str3=Console::ReadLine(); Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!"); Console::ReadKey(); return 0; }
  • 51. Console // CppdotNetConsoleCourseTest.cpp : main project file. Returns the string that’s read from the input buffer #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str1=gcnew String("Hi Hi Hi, first time."); String ^str2="Hi Hi Hi, second time."; String ^str3; Console::Write("Enter your name plz: "); str3=Console::ReadLine(); Console::WriteLine(str1 + " " + str2 + " Hi " + str3 + "!"); Console::ReadKey(); return 0; }
  • 52. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i.ToString() + f.ToString()); Console::ReadKey(); return 0; }
  • 53. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i.ToString() + f.ToString()); Console::ReadKey(); return 0; } It’s not a “->”
  • 54. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i.ToString() + f.ToString()); Console::ReadKey(); return 0; } Where this method “ToString()” comes from?!
  • 55. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i.ToString() + f.ToString()); Console::ReadKey(); return 0; } 10
  • 56. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 57. Console No “ToString()” method! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 58. Console How compiler works?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 59. Console How compiler works?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 60. Console How compiler works?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 61. Console How compiler works?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 62. Console How compiler works?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 63. Console How compiler works?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 64. Console How compiler works?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 65. Console How compiler works?! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 66. Console Arithmetic “Sum”! // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 67. Console Results a “float” // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 68. Console Results a “float” in a “String” context // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 69. Console Results a “float” in a “String” context // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; }
  • 70. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; float f=0; Console::WriteLine(i + f); Console::ReadKey(); return 0; } 1
  • 71. Console (Types Conversion) // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; String ^str=i.ToString(); Console::WriteLine(str); Console::ReadKey(); return 0; }
  • 72. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { int i=1; String ^str=i.ToString(); Console::WriteLine(str); Console::ReadKey(); return 0; } 1
  • 73. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str="1123"; int i=Int32::Parse(str); i++; Console::WriteLine(i); Console::ReadKey(); return 0; }
  • 74. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str="1123"; int i=Int32::Parse(str); i++; Console::WriteLine(i); Console::ReadKey(); return 0; } 1124
  • 75. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str="1123"; int i=0; Int32::TryParse(str,i); i++; Console::WriteLine(i); Console::ReadKey(); return 0; }
  • 76. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str="1123"; int i=0; Int32::TryParse(str,i); i++; Console::WriteLine(i); Console::ReadKey(); return 0; } 1124
  • 77. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str="1123ccccc"; int i=0; Int32::TryParse(str,i); i++; Console::WriteLine(i); Console::ReadKey(); return 0; }
  • 78. Console // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { String ^str="1123ccccc"; int i=0; Int32::TryParse(str,i); i++; Console::WriteLine(i); Console::ReadKey(); return 0; } 1
  • 81. Arrays • Defining an array of string with dimension of 3 public : array <String^ , 3 > ^MyArr;
  • 82. Arrays • Defining an array of string with dimension of 3 public : array <String^ , 3 > ^MyArr; • Everything okay? public : array <String^ , 3 > MyArr; public : array <String , 3 > ^MyArr; Both are Compiler Errors!
  • 83. Arrays • Sth wrong? array <String ^ , 1 > ^MyArr; MyArr[0][0]="1"; Compiler error array <String ^ , 1 > ^MyArr; MyArr[0]=1; Compiler error array <String ^ , 2> ^MyArr; MyArr=gcnew array <String^ , 2 > (100,50); MyArr[0,0]="1"; Everything is good
  • 84. Arrays • Sth wrong? array <String ^ , 2> ^MyArr; MyArr=gcnew array <String^ > (100,50); MyArr[0,0]="1"; Compiler error array <String ^ , 2> ^MyArr; MyArr=gcnew array <String^ , 2 > (100,50); MyArr[0][0]="1"; Compiler error array <String ^ , 2> ^MyArr; MyArr=gcnew array <String^ , 2 > (100)(50); MyArr[0,0]="1"; Compiler error
  • 85. Arrays • Sth wrong? array <String ^> ^MyArr; MyArr=gcnew array <String^ > (50); MyArr[0]="1"; Everything is good
  • 87. Arrays // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { array <String ^ , 1 > ^MyArr; MyArr[0]="1"; Console::ReadKey(); return 0; }
  • 88. Arrays // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { array <String ^ , 1 > ^MyArr; MyArr[0]="1"; Console::ReadKey(); return 0; } Ntn wrong!
  • 89. Arrays // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { array <String ^ , 1 > ^MyArr; MyArr[0]="1"; Console::ReadKey(); return 0; } Ntn wrong!
  • 90. Arrays // CppdotNetConsoleCourseTest.cpp : main project file. #include "stdafx.h" using namespace System; int main(array<System::String ^> ^args) { array <String ^ , 1 > ^MyArr; MyArr[0]="1"; Console::ReadKey(); return 0; } Ntn wrong!
  • 91. Arrays • Considering that we have a class named “CELL” array <CELL^ , 2> ^MyArr; MyArr=gcnew array <CELL^ , 2 > (100,50); CELL ^MyCell=gcnew CELL; MyArr[0,0]=MyCell;
  • 92. Arrays • Considering that we have a class named “CELL” array <CELL^ , 2> ^MyArr; MyArr=gcnew array <CELL^ , 2 > (100,50); CELL ^MyCell=gcnew CELL; MyArr[0,0]=MyCell;
  • 93. That’s it for today!