diff options
18 files changed, 0 insertions, 1410 deletions
diff --git a/examples/activeqt/dotnet/walkthrough/Form1.cs b/examples/activeqt/dotnet/walkthrough/Form1.cs deleted file mode 100644 index 9fb572a..0000000 --- a/examples/activeqt/dotnet/walkthrough/Form1.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; - -namespace csharp -{ - /// <summary> - /// Summary description for Form1. - /// </summary> - public class Form1 : System.Windows.Forms.Form - { - private AxwrapperaxLib.AxQPushButton resetButton; - private AxmultipleaxLib.AxQAxWidget2 circleWidget; - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.Container components = null; - - public Form1() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - } - - /// <summary> - /// Clean up any resources being used. - /// </summary> - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #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> - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); - this.resetButton = new AxwrapperaxLib.AxQPushButton(); - this.circleWidget = new AxmultipleaxLib.AxQAxWidget2(); - ((System.ComponentModel.ISupportInitialize)(this.resetButton)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.circleWidget)).BeginInit(); - this.SuspendLayout(); - // - // resetButton - // - this.resetButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); - this.resetButton.Enabled = true; - this.resetButton.Location = new System.Drawing.Point(160, 296); - this.resetButton.Name = "resetButton"; - this.resetButton.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("resetButton.OcxState"))); - this.resetButton.Size = new System.Drawing.Size(168, 32); - this.resetButton.TabIndex = 1; - this.resetButton.clicked += new System.EventHandler(this.resetLineWidth); - // - // circleWidget - // - this.circleWidget.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right); - this.circleWidget.Enabled = true; - this.circleWidget.Location = new System.Drawing.Point(8, 8); - this.circleWidget.Name = "circleWidget"; - this.circleWidget.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("circleWidget.OcxState"))); - this.circleWidget.Size = new System.Drawing.Size(320, 264); - this.circleWidget.TabIndex = 2; - this.circleWidget.ClickEvent += new System.EventHandler(this.circleClicked); - // - // Form1 - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(336, 333); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.circleWidget, - this.resetButton}); - this.Name = "Form1"; - this.Text = "Form1"; - ((System.ComponentModel.ISupportInitialize)(this.resetButton)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.circleWidget)).EndInit(); - this.ResumeLayout(false); - - } - #endregion - - /// <summary> - /// The main entry point for the application. - /// </summary> - [STAThread] - static void Main() - { - Application.Run(new Form1()); - } - -//! [0] - private void circleClicked(object sender, System.EventArgs e) - { - this.circleWidget.lineWidth++; - } -//! [0] - -//! [1] - private void resetLineWidth(object sender, System.EventArgs e) - { - this.circleWidget.lineWidth = 1; - this.resetButton.setFocus(); - } -//! [1] - } -} diff --git a/examples/activeqt/dotnet/walkthrough/Form1.resx b/examples/activeqt/dotnet/walkthrough/Form1.resx deleted file mode 100644 index 6353f82..0000000 --- a/examples/activeqt/dotnet/walkthrough/Form1.resx +++ /dev/null @@ -1,131 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 1.3 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">1.3</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1">this is my long string</data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - [base64 mime encoded serialized .NET Framework object] - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - [base64 mime encoded string representing a byte array form of the .NET Framework object] - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>1.3</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="resetButton.OcxState" mimetype="application/x-microsoft.net.object.binary.base64"> - <value> - AAEAAAD/////AQAAAAAAAAAMAgAAAFpTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0xLjAuMzMw - MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFT - eXN0ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAGwMA - AAIBAAAAAQAAAAAAAAAAAAAAAAYDAAAAAAAFAAAACGVuYWJsZWQAAAAAEgEAAAACeAAAAAAQAAAAAAAA - AAJ5AAAAABAAAAAAAAAABndpZHRoAAAAABAAAACoAAAAB2hlaWdodAAAAAAQAAAAGgAAAA1taW5pbXVt - V2lkdGgAAAAAEAAAAAAAAAAObWluaW11bUhlaWdodAAAAAAQAAAAAAAAAA1tYXhpbXVtV2lkdGgAAAAA - EAAAf/8AAAAObWF4aW11bUhlaWdodAAAAAAQAAB//wAAAA9iYWNrZ3JvdW5kTW9kZQAAAAAQAAAABAAA - ABdwYWxldHRlRm9yZWdyb3VuZENvbG9yAAAAAAr/AAAAAAAAF3BhbGV0dGVCYWNrZ3JvdW5kQ29sb3IA - AAAACv/U0MgAAAARYmFja2dyb3VuZE9yaWdpbgAAAAAQAAAAAAAAAAVmb250AAAAAAUAAAAYAE0AUwAg - AFMAaABlAGwAbAAgAEQAbABnAFP//wUBADIAAAAACGNhcHRpb24AAAAAA/////8AAAAJaWNvblRleHQA - AAAAA/////8AAAAObW91c2VUcmFja2luZwAAAAASAAAAAAxmb2N1c1BvbGljeQAAAAAQAAAAAQAAAA91 - cGRhdGVzRW5hYmxlZAAAAAASAQAAAAptYXhpbWl6ZWQAAAAAEgAAAAALZnVsbFNjcmVlbgAAAAASAAAA - AAxhY2NlcHREcm9wcwAAAAASAAAAABNpbnB1dE1ldGhvZEVuYWJsZWQAAAAAEgAAAAAFdGV4dAAAAAAD - AAAADAAmAFIAZQBzAGUAdAAAAAt0b2dnbGVUeXBlAAAAABAAAAAAAAAABWRvd24AAAAAEgAAAAAMdG9n - Z2xlU3RhdGUAAAAAEAAAAAAAAAALYXV0b1Jlc2l6ZQAAAAASAAAAAAthdXRvUmVwZWF0AAAAABIAAAAA - EGV4Y2x1c2l2ZVRvZ2dsZQAAAAASAAAAAAxhdXRvRGVmYXVsdAAAAAASAQAAAAttZW51QnV0dG9uAAAA - ABIAAAAABWZsYXQAAAAAEgAL -</value> - </data> - <data name="circleWidget.OcxState" mimetype="application/x-microsoft.net.object.binary.base64"> - <value> - AAEAAAD/////AQAAAAAAAAAMAgAAAFpTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0xLjAuMzMw - MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFT - eXN0ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAALwAA - AAIBAAAAAQAAAAAAAAAAAAAAABoAAAAAAAAFAAAACmxpbmVXaWR0aAAAAAAQAAAAAAs= -</value> - </data> - <data name="$this.Name"> - <value>Form1</value> - </data> -</root>
\ No newline at end of file diff --git a/examples/activeqt/dotnet/walkthrough/Form1.vb b/examples/activeqt/dotnet/walkthrough/Form1.vb deleted file mode 100644 index f5f241b..0000000 --- a/examples/activeqt/dotnet/walkthrough/Form1.vb +++ /dev/null @@ -1,88 +0,0 @@ -Public Class Form1 - Inherits System.Windows.Forms.Form - -#Region " Windows Form Designer generated code " - - Public Sub New() - MyBase.New() - - 'This call is required by the Windows Form Designer. - InitializeComponent() - - 'Add any initialization after the InitializeComponent() call - - End Sub - - 'Form overrides dispose to clean up the component list. - Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing Then - If Not (components Is Nothing) Then - components.Dispose() - End If - End If - MyBase.Dispose(disposing) - End Sub - - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer - - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - Friend WithEvents circleWidget As AxmultipleaxLib.AxQAxWidget2 - Friend WithEvents resetButton As AxwrapperaxLib.AxQPushButton - <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() - Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1)) - Me.circleWidget = New AxmultipleaxLib.AxQAxWidget2() - Me.resetButton = New AxwrapperaxLib.AxQPushButton() - CType(Me.circleWidget, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.resetButton, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'circleWidget - ' - Me.circleWidget.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right) - Me.circleWidget.Enabled = True - Me.circleWidget.Location = New System.Drawing.Point(8, 8) - Me.circleWidget.Name = "circleWidget" - Me.circleWidget.OcxState = CType(resources.GetObject("circleWidget.OcxState"), System.Windows.Forms.AxHost.State) - Me.circleWidget.Size = New System.Drawing.Size(280, 216) - Me.circleWidget.TabIndex = 0 - ' - 'resetButton - ' - Me.resetButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right) - ' VB is case insensitive, but our C++ controls are not. - ' Me.resetButton.enabled = True - Me.resetButton.Location = New System.Drawing.Point(184, 240) - Me.resetButton.Name = "resetButton" - Me.resetButton.OcxState = CType(resources.GetObject("resetButton.OcxState"), System.Windows.Forms.AxHost.State) - Me.resetButton.Size = New System.Drawing.Size(104, 24) - Me.resetButton.TabIndex = 1 - ' - 'Form1 - ' - Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) - Me.ClientSize = New System.Drawing.Size(292, 273) - Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.resetButton, Me.circleWidget}) - Me.Name = "Form1" - Me.Text = "Form1" - CType(Me.circleWidget, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.resetButton, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - - End Sub - -#End Region - - Private Sub circleWidget_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles circleWidget.ClickEvent - Me.circleWidget.lineWidth = Me.circleWidget.lineWidth + 1 - End Sub - - Private Sub resetButton_clicked(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles resetButton.clicked - Me.circleWidget.lineWidth = 1 - Me.resetButton.setFocus() - End Sub -End Class diff --git a/examples/activeqt/dotnet/walkthrough/csharp.csproj b/examples/activeqt/dotnet/walkthrough/csharp.csproj deleted file mode 100644 index 4c5502b..0000000 --- a/examples/activeqt/dotnet/walkthrough/csharp.csproj +++ /dev/null @@ -1,143 +0,0 @@ -<VisualStudioProject> - <CSHARP - ProjectType = "Local" - ProductVersion = "7.0.9466" - SchemaVersion = "1.0" - ProjectGuid = "{F15600FD-7677-4C01-B98A-6776CE500617}" - > - <Build> - <Settings - ApplicationIcon = "" - AssemblyKeyContainerName = "" - AssemblyName = "csharp" - AssemblyOriginatorKeyFile = "" - DefaultClientScript = "JScript" - DefaultHTMLPageLayout = "Grid" - DefaultTargetSchema = "IE50" - DelaySign = "false" - OutputType = "WinExe" - RootNamespace = "csharp" - StartupObject = "" - > - <Config - Name = "Debug" - AllowUnsafeBlocks = "false" - BaseAddress = "285212672" - CheckForOverflowUnderflow = "false" - ConfigurationOverrideFile = "" - DefineConstants = "DEBUG;TRACE" - DocumentationFile = "" - DebugSymbols = "true" - FileAlignment = "4096" - IncrementalBuild = "true" - Optimize = "false" - OutputPath = "bin\Debug\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "4" - /> - <Config - Name = "Release" - AllowUnsafeBlocks = "false" - BaseAddress = "285212672" - CheckForOverflowUnderflow = "false" - ConfigurationOverrideFile = "" - DefineConstants = "TRACE" - DocumentationFile = "" - DebugSymbols = "false" - FileAlignment = "4096" - IncrementalBuild = "false" - Optimize = "true" - OutputPath = "bin\Release\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "4" - /> - </Settings> - <References> - <Reference - Name = "System" - AssemblyName = "System" - HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll" - /> - <Reference - Name = "System.Data" - AssemblyName = "System.Data" - HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll" - /> - <Reference - Name = "System.Drawing" - AssemblyName = "System.Drawing" - HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Drawing.dll" - /> - <Reference - Name = "System.Windows.Forms" - AssemblyName = "System.Windows.Forms" - HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Windows.Forms.dll" - /> - <Reference - Name = "System.XML" - AssemblyName = "System.Xml" - HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" - /> - <Reference - Name = "stdole" - Guid = "{00020430-0000-0000-C000-000000000046}" - VersionMajor = "2" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "primary" - /> - <Reference - Name = "wrapperaxLib" - Guid = "{3B756301-0075-4E40-8BE8-5A81DE2426B7}" - VersionMajor = "1" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "tlbimp" - /> - <Reference - Name = "AxwrapperaxLib" - Guid = "{3B756301-0075-4E40-8BE8-5A81DE2426B7}" - VersionMajor = "1" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "aximp" - /> - <Reference - Name = "multipleaxLib" - Guid = "{05828915-AD1C-47AB-AB96-D6AD1E25F0E2}" - VersionMajor = "1" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "tlbimp" - /> - <Reference - Name = "AxmultipleaxLib" - Guid = "{05828915-AD1C-47AB-AB96-D6AD1E25F0E2}" - VersionMajor = "1" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "aximp" - /> - </References> - </Build> - <Files> - <Include> - <File - RelPath = "Form1.cs" - SubType = "Form" - BuildAction = "Compile" - /> - <File - RelPath = "Form1.resx" - DependentUpon = "Form1.cs" - BuildAction = "EmbeddedResource" - /> - </Include> - </Files> - </CSHARP> -</VisualStudioProject> - diff --git a/examples/activeqt/dotnet/walkthrough/vb.vbproj b/examples/activeqt/dotnet/walkthrough/vb.vbproj deleted file mode 100644 index eb0a9d6..0000000 --- a/examples/activeqt/dotnet/walkthrough/vb.vbproj +++ /dev/null @@ -1,147 +0,0 @@ -<VisualStudioProject> - <VisualBasic - ProjectType = "Local" - ProductVersion = "7.0.9466" - SchemaVersion = "1.0" - ProjectGuid = "{BFF242A6-967C-4F73-BEBE-DED2D9C395C6}" - > - <Build> - <Settings - ApplicationIcon = "" - AssemblyKeyContainerName = "" - AssemblyName = "vb" - AssemblyOriginatorKeyFile = "" - AssemblyOriginatorKeyMode = "None" - DefaultClientScript = "JScript" - DefaultHTMLPageLayout = "Grid" - DefaultTargetSchema = "IE50" - DelaySign = "false" - OutputType = "WinExe" - OptionCompare = "Binary" - OptionExplicit = "On" - OptionStrict = "Off" - RootNamespace = "vb" - StartupObject = "vb.Form1" - > - <Config - Name = "Debug" - BaseAddress = "285212672" - ConfigurationOverrideFile = "" - DefineConstants = "" - DefineDebug = "true" - DefineTrace = "true" - DebugSymbols = "true" - IncrementalBuild = "true" - Optimize = "false" - OutputPath = "bin\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "1" - /> - <Config - Name = "Release" - BaseAddress = "285212672" - ConfigurationOverrideFile = "" - DefineConstants = "" - DefineDebug = "false" - DefineTrace = "true" - DebugSymbols = "false" - IncrementalBuild = "false" - Optimize = "true" - OutputPath = "bin\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "1" - /> - </Settings> - <References> - <Reference - Name = "System" - AssemblyName = "System" - /> - <Reference - Name = "System.Data" - AssemblyName = "System.Data" - /> - <Reference - Name = "System.Drawing" - AssemblyName = "System.Drawing" - /> - <Reference - Name = "System.Windows.Forms" - AssemblyName = "System.Windows.Forms" - /> - <Reference - Name = "System.XML" - AssemblyName = "System.Xml" - /> - <Reference - Name = "stdole" - Guid = "{00020430-0000-0000-C000-000000000046}" - VersionMajor = "2" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "primary" - /> - <Reference - Name = "wrapperaxLib" - Guid = "{3B756301-0075-4E40-8BE8-5A81DE2426B7}" - VersionMajor = "1" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "tlbimp" - /> - <Reference - Name = "multipleaxLib" - Guid = "{05828915-AD1C-47AB-AB96-D6AD1E25F0E2}" - VersionMajor = "1" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "tlbimp" - /> - <Reference - Name = "AxwrapperaxLib" - Guid = "{3B756301-0075-4E40-8BE8-5A81DE2426B7}" - VersionMajor = "1" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "aximp" - /> - <Reference - Name = "AxmultipleaxLib" - Guid = "{05828915-AD1C-47AB-AB96-D6AD1E25F0E2}" - VersionMajor = "1" - VersionMinor = "0" - Lcid = "0" - WrapperTool = "aximp" - /> - </References> - <Imports> - <Import Namespace = "Microsoft.VisualBasic" /> - <Import Namespace = "System" /> - <Import Namespace = "System.Collections" /> - <Import Namespace = "System.Data" /> - <Import Namespace = "System.Drawing" /> - <Import Namespace = "System.Diagnostics" /> - <Import Namespace = "System.Windows.Forms" /> - </Imports> - </Build> - <Files> - <Include> - <File - RelPath = "Form1.vb" - SubType = "Form" - BuildAction = "Compile" - /> - <File - RelPath = "Form1.resx" - DependentUpon = "Form1.vb" - BuildAction = "EmbeddedResource" - /> - </Include> - </Files> - </VisualBasic> -</VisualStudioProject> - diff --git a/examples/activeqt/dotnet/wrapper/app.csproj b/examples/activeqt/dotnet/wrapper/app.csproj deleted file mode 100644 index dce4bf0..0000000 --- a/examples/activeqt/dotnet/wrapper/app.csproj +++ /dev/null @@ -1,93 +0,0 @@ -<VisualStudioProject> - <CSHARP - ProjectType = "Local" - ProductVersion = "7.0.9466" - SchemaVersion = "1.0" - ProjectGuid = "{334C8F04-E034-4082-9380-43906DDE71AB}" - > - <Build> - <Settings - ApplicationIcon = "" - AssemblyKeyContainerName = "" - AssemblyName = "wrapper" - AssemblyOriginatorKeyFile = "" - DefaultClientScript = "JScript" - DefaultHTMLPageLayout = "Grid" - DefaultTargetSchema = "IE50" - DelaySign = "false" - OutputType = "Exe" - RootNamespace = "wrapper" - StartupObject = "" - > - <Config - Name = "Debug" - AllowUnsafeBlocks = "false" - BaseAddress = "285212672" - CheckForOverflowUnderflow = "false" - ConfigurationOverrideFile = "" - DefineConstants = "DEBUG;TRACE" - DocumentationFile = "" - DebugSymbols = "true" - FileAlignment = "4096" - IncrementalBuild = "true" - Optimize = "false" - OutputPath = "bin\Debug\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "4" - /> - <Config - Name = "Release" - AllowUnsafeBlocks = "false" - BaseAddress = "285212672" - CheckForOverflowUnderflow = "false" - ConfigurationOverrideFile = "" - DefineConstants = "TRACE" - DocumentationFile = "" - DebugSymbols = "false" - FileAlignment = "4096" - IncrementalBuild = "false" - Optimize = "true" - OutputPath = "bin\Release\" - RegisterForComInterop = "false" - RemoveIntegerChecks = "false" - TreatWarningsAsErrors = "false" - WarningLevel = "4" - /> - </Settings> - <References> - <Reference - Name = "System" - AssemblyName = "System" - HintPath = "D:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll" - /> - <Reference - Name = "System.Data" - AssemblyName = "System.Data" - HintPath = "D:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll" - /> - <Reference - Name = "System.XML" - AssemblyName = "System.Xml" - HintPath = "D:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" - /> - <Reference - Name = "lib" - AssemblyName = "lib" - HintPath = "lib\lib.dll" - /> - </References> - </Build> - <Files> - <Include> - <File - RelPath = "main.cs" - SubType = "Code" - BuildAction = "Compile" - /> - </Include> - </Files> - </CSHARP> -</VisualStudioProject> - diff --git a/examples/activeqt/dotnet/wrapper/lib/lib.vcproj b/examples/activeqt/dotnet/wrapper/lib/lib.vcproj deleted file mode 100644 index f49c35d..0000000 --- a/examples/activeqt/dotnet/wrapper/lib/lib.vcproj +++ /dev/null @@ -1,149 +0,0 @@ -<?xml version="1.0" encoding = "Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.00" - Name="lib" - ProjectGUID="{2E94A303-45A2-47AC-B87A-7C3519E9D6D8}" - Keyword="ManagedCProj"> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="Debug" - IntermediateDirectory="Debug" - ConfigurationType="2" - CharacterSet="2" - ManagedExtensions="TRUE"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(QTDIR)\include";"$(QTDIR)\include\QtCore"" - PreprocessorDefinitions="WIN32;_DEBUG" - IgnoreStandardIncludePath="FALSE" - MinimalRebuild="FALSE" - BasicRuntimeChecks="0" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - DebugInformationFormat="3"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="QtCored4.lib" - OutputFile="lib.dll" - LinkIncremental="2" - AdditionalLibraryDirectories="$(QTDIR)/lib" - GenerateDebugInformation="TRUE"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="Release" - IntermediateDirectory="Release" - ConfigurationType="2" - CharacterSet="2" - ManagedExtensions="TRUE"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories=""$(QTDIR)\include";"$(QTDIR)\include\QtCore"" - InlineFunctionExpansion="1" - PreprocessorDefinitions="WIN32;NDEBUG" - MinimalRebuild="FALSE" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="QtCore4.lib" - OutputFile="$(OutDir)/lib.dll" - LinkIncremental="1" - AdditionalLibraryDirectories="$(QTDIR)/lib" - GenerateDebugInformation="TRUE"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - </Configuration> - </Configurations> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> - <File - RelativePath="networker.cpp"> - </File> - <File - RelativePath="tools.cpp"> - </File> - <File - RelativePath="worker.cpp"> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc"> - <File - RelativePath="networker.h"> - </File> - <File - RelativePath="tools.h"> - </File> - <File - RelativePath="worker.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc.exe $(InputName).h -o moc_$(InputName).cpp" - Outputs="moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc.exe $(InputName).h -o moc_$(InputName).cpp" - Outputs="moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Generated MOC" - Filter=""> - <File - RelativePath="moc_worker.cpp"> - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/examples/activeqt/dotnet/wrapper/lib/networker.cpp b/examples/activeqt/dotnet/wrapper/lib/networker.cpp deleted file mode 100644 index ccbdf89..0000000 --- a/examples/activeqt/dotnet/wrapper/lib/networker.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2015 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -//! [0] -#include "networker.h" -#include "worker.h" -#include "tools.h" - -netWorker::netWorker() -{ - workerObject = new Worker(); -} -//! [0] //! [1] - -netWorker::~netWorker() -{ - delete workerObject; -} -//! [1] //! [2] - -String *netWorker::get_StatusString() -{ - return QStringToString(workerObject->statusString()); -} -//! [2] //! [3] - -void netWorker::set_StatusString(String *string) -{ - workerObject->setStatusString(StringToQString(string)); - __raise statusStringChanged(string); -} -//! [3] diff --git a/examples/activeqt/dotnet/wrapper/lib/networker.h b/examples/activeqt/dotnet/wrapper/lib/networker.h deleted file mode 100644 index 0c5babb..0000000 --- a/examples/activeqt/dotnet/wrapper/lib/networker.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2015 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -// lib.h - -#pragma once - -#using <mscorlib.dll> -using namespace System; - -//! [0] -class Worker; - -// .NET class -public __gc class netWorker -{ -public: - netWorker(); - ~netWorker(); - - __property String *get_StatusString(); - __property void set_StatusString(String *string); - - __event void statusStringChanged(String *args); - -private: - Worker *workerObject; -}; -//! [0] diff --git a/examples/activeqt/dotnet/wrapper/lib/tools.cpp b/examples/activeqt/dotnet/wrapper/lib/tools.cpp deleted file mode 100644 index eb6d009..0000000 --- a/examples/activeqt/dotnet/wrapper/lib/tools.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2015 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -//! [0] -#include <QString> - -#using <mscorlib.dll> -#include <vcclr.h> - -using namespace System; - -String *QStringToString(const QString &qstring) -{ - return new String((const wchar_t *)qstring.utf16()); -} -//! [0] //! [1] - -QString StringToQString(String *string) -{ - const wchar_t __pin *chars = PtrToStringChars(string); - return QString::fromWCharArray(chars); -} -//! [1] diff --git a/examples/activeqt/dotnet/wrapper/lib/tools.h b/examples/activeqt/dotnet/wrapper/lib/tools.h deleted file mode 100644 index cd34f82..0000000 --- a/examples/activeqt/dotnet/wrapper/lib/tools.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2015 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#ifndef TOOLS_H -#define TOOLS_H - -#using <mscorlib.dll> - -QT_BEGIN_NAMESPACE -class QString; -QT_END_NAMESPACE - -System::String *QStringToString(const QString &qstring); -QString StringToQString(System::String *string); - -#endif // TOOLS_H diff --git a/examples/activeqt/dotnet/wrapper/lib/worker.cpp b/examples/activeqt/dotnet/wrapper/lib/worker.cpp deleted file mode 100644 index b11c7e5..0000000 --- a/examples/activeqt/dotnet/wrapper/lib/worker.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2015 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include "worker.h" -#include "tools.h" - -Worker::Worker() -{ - status = "Idle"; -} - -void Worker::setStatusString(const QString &string) -{ - status = string; - emit statusStringChanged(status); -} - -QString Worker::statusString() const -{ - return status; -} diff --git a/examples/activeqt/dotnet/wrapper/lib/worker.h b/examples/activeqt/dotnet/wrapper/lib/worker.h deleted file mode 100644 index 5dc52a2..0000000 --- a/examples/activeqt/dotnet/wrapper/lib/worker.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2015 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#ifndef WORKER_H -#define WORKER_H - -#include <QObject> - -// native Qt/C++ class -//! [0] -class Worker : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString statusString READ statusString WRITE setStatusString) -public: - Worker(); - - QString statusString() const; - -public slots: - void setStatusString(const QString &string); - -signals: - void statusStringChanged(const QString &string); - -private: - QString status; -}; -//! [0] - -#endif // WORKER_H diff --git a/examples/activeqt/dotnet/wrapper/main.cs b/examples/activeqt/dotnet/wrapper/main.cs deleted file mode 100644 index 1d43029..0000000 --- a/examples/activeqt/dotnet/wrapper/main.cs +++ /dev/null @@ -1,40 +0,0 @@ -//! [0] -using System; - -namespace WrapperApp -{ - class App - { - void Run() - { - netWorker worker = new netWorker(); - - worker.statusStringChanged += new netWorker.__Delegate_statusStringChanged(onStatusStringChanged); - - System.Console.Out.WriteLine(worker.StatusString); - - System.Console.Out.WriteLine("Working cycle begins..."); - worker.StatusString = "Working"; - worker.StatusString = "Lunch Break"; - worker.StatusString = "Working"; - worker.StatusString = "Idle"; - System.Console.Out.WriteLine("Working cycle ends..."); - } - - private void onStatusStringChanged(string str) - { - System.Console.Out.WriteLine(str); - } - - [STAThread] -//! [0] //! [1] - static void Main(string[] args) - { - App app = new App(); - app.Run(); - } -//! [1] //! [2] - } -//! [2] //! [3] -} -//! [3] diff --git a/examples/activeqt/dotnet/wrapper/wrapper.sln b/examples/activeqt/dotnet/wrapper/wrapper.sln deleted file mode 100644 index e25e6bd..0000000 --- a/examples/activeqt/dotnet/wrapper/wrapper.sln +++ /dev/null @@ -1,28 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "app", "app.csproj", "{334C8F04-E034-4082-9380-43906DDE71AB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib", "lib\lib.vcproj", "{2E94A303-45A2-47AC-B87A-7C3519E9D6D8}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - {334C8F04-E034-4082-9380-43906DDE71AB}.0 = {2E94A303-45A2-47AC-B87A-7C3519E9D6D8} - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {334C8F04-E034-4082-9380-43906DDE71AB}.Debug.ActiveCfg = Debug|.NET - {334C8F04-E034-4082-9380-43906DDE71AB}.Debug.Build.0 = Debug|.NET - {334C8F04-E034-4082-9380-43906DDE71AB}.Release.ActiveCfg = Release|.NET - {334C8F04-E034-4082-9380-43906DDE71AB}.Release.Build.0 = Release|.NET - {2E94A303-45A2-47AC-B87A-7C3519E9D6D8}.Debug.ActiveCfg = Debug|Win32 - {2E94A303-45A2-47AC-B87A-7C3519E9D6D8}.Debug.Build.0 = Debug|Win32 - {2E94A303-45A2-47AC-B87A-7C3519E9D6D8}.Release.ActiveCfg = Release|Win32 - {2E94A303-45A2-47AC-B87A-7C3519E9D6D8}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/src/activeqt/doc/snippets/doc_src_examples_activeqt_dotnet.qdoc b/src/activeqt/doc/snippets/doc_src_examples_activeqt_dotnet.qdoc deleted file mode 100644 index f5e5659..0000000 --- a/src/activeqt/doc/snippets/doc_src_examples_activeqt_dotnet.qdoc +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (C) 2015 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -//! [0] -' VB is case insensitive, but our C++ controls are not. -' Me.resetButton.enabled = True -//! [0] diff --git a/src/activeqt/doc/src/activeqt-index.qdoc b/src/activeqt/doc/src/activeqt-index.qdoc index aee6a9b..6a5d503 100644 --- a/src/activeqt/doc/src/activeqt-index.qdoc +++ b/src/activeqt/doc/src/activeqt-index.qdoc @@ -85,7 +85,6 @@ \list \li \l{Qutlook Example (ActiveQt)} \li \l{COM App Example (ActiveQt)} - \li \l{Dot Net Example (ActiveQt)} \li \l{Wrapper Example (ActiveQt)} \li \l{Simple Example (ActiveQt)} \endlist diff --git a/src/activeqt/doc/src/examples/dotnet.qdoc b/src/activeqt/doc/src/examples/dotnet.qdoc deleted file mode 100644 index caef29e..0000000 --- a/src/activeqt/doc/src/examples/dotnet.qdoc +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \page activeqt-dotnet.html - \title Dot Net Example (ActiveQt) - \ingroup activeqt-examples - - \brief The Dot Net example demonstrates how Qt objects can be used in a - .NET environment, and how .NET objects can be used in a Qt - environment. - - Contents: - - \tableofcontents - - \section1 Qt vs. .NET - - Qt is a C++ library and is compiled into traditional, native - binaries that make full use of the performance provided by the - runtime environment. - - One of the key concepts of .NET is the idea of "intermediate language - code" - the source code is compiled into a bytecode format, and at - runtime, that bytecode is executed in a virtual machine - the \e - {Common Language Runtime} (CLR). - - Another key concept is that of \e {managed code}. This is essentially - intermediate language code written in such a way that the CLR can take - care of the memory management, i.e. the CLR will do automatic garbage - collection, so the application code does not need to explicitly free - the memory for unused objects. - - The MS compilers for C# and VB.NET will only produce managed - code. Such programs cannot directly call normal, native functions - or classes. \footnote The .NET framework provides Platform Invocation - Services - P/Invoke - that enable managed code to call native C (not - C++) functions located in DLLs directly. The resulting application - then becomes partially unmanaged.\endfootnote - - The MS C++ compiler for .NET on the other hand, can produce both - normal and managed code. To write a C++ class that can be compiled - into managed code, the developer must flag the class as managed using - the \c __gc keyword, and restrict the code to only use the subset of - C++ known as "Managed Extensions for C++", or MC++ for short. The - advantage is that MC++ code can freely call and use normal C++ - functions and classes. And it also works the other way around: normal - C++ code can call managed functions and use managed classes (e.g. the - entire .NET framework class library), including managed functions and - classes implemented in C# or VB.NET. This feature of mixing managed - and normal C++ code immensely eases the interoperability with .NET, - and is by Microsoft referred to as the "It Just Works" (IJW) feature. - - This document demonstrates two different ways of integrating normal - C++ code (that uses Qt) with managed .NET code. First, the manual way - is presented, which includes using a thin MC++ wrapper class around - the normal Qt/C++ class. Then, the automated way is presented, which - utilizes the ActiveQt framework as a generic bridge. The advantage of - the first method is that it gives the application developer full - control, while the second method requires less coding and relieves the - developer of dealing with the conversion between managed and normal - data objects. - - The impatient reader, who right away wants to see a QPushButton and a - custom Qt widget run in a .NET GUI application is referred to the example - directory of ActiveQt. It contains the result of this walkthrough using - both C# and VB.NET, created with Visual Studio .NET (not 2003). Load - \c {examples/dotnet/walkthrough/csharp.csproj}, \c {examples/dotnet/walkthrough/vb.vbproj}, - or \c {examples/dotnet/wrapper/wrapper.sln} into the IDE and run the solution. - - \b{Remark:} You will notice that in the generated code the following line is - commented out: - - \snippet doc_src_examples_activeqt_dotnet.qdoc 0 - - This line is regenerated without comment whenever you change the - dialog, in which case you have to comment it out again to be able - to run the project. This is a bug in the original version of - Visual Studio.NET, and is fixed in the 2003 edition. - - \section1 Walkthrough: .NET Interop with MC++ and IJW - - Normal C++ classes and functions can be used from managed .NET code by - providing thin wrapper classes written in MC++. The wrapper class will - take care of forwarding the calls to the normal C++ functions or - methods, and converting parameter data as necessary. Since the wrapper - class is a managed class, it can be used without further ado in any - managed .NET application, whether written in C#, VB.NET, MC++ or other - managed programming language. - - \snippet activeqt/dotnet/wrapper/lib/worker.h 0 - - The Qt class has nothing unusual for Qt users, and as even the Qt - specialities like \c Q_PROPERTY, \c slots and \c signals are - implemented with straight C++ they don't cause any trouble when - compiling this class with any C++ compiler. - - \snippet activeqt/dotnet/wrapper/lib/networker.h 0 - - The .NET wrapper class uses keywords that are part of MC++ to indicate - that the class is managed/garbage collected (\c {__gc}), and that \c - StatusString should be accessible as a property in languages that - support this concept (\c {__property}). We also declare an event - function \c statusStringChanged(String*) (\c {__event}), the - equivalent of the respective signal in the Qt class. - - Before we can start implementing the wrapper class we need a way to - convert Qt's datatypes (and potentionally your own) into .NET - datatypes, e.g. \c QString objects need to be converted into objects - of type \c {String*}. - - When operating on managed objects in normal C++ code, a little extra - care must be taken because of the CLR's garbage collection. A normal - pointer variable should not \footnote Indeed, the compiler will in - many cases disallow it. \endfootnote be used to refer to a managed - object. The reason is that the garbage collection can kick in at any - time and move the object to another place on the heap, leaving you - with an invalid pointer. - - However, two methods are provided that solves this problem easily. The - first is to use a \e pinned pointer, i.e. declare the pointer variable - with the \c __pin keyword. This guarantees that the object pointed to - will not be moved by the garbage collector. It is recommended that - this method not be used to keep a references to managed objects for a - long time, since it will decrease the efficiency of the garbage - collector. The second way is to use the \c gcroot smartpointer - template type. This lets you create safe pointers to managed - objects. E.g. a variable of type \c gcroot<String> will always point - to the String object, even if it has been moved by the garbage - collector, and it can be used just like a normal pointer. - - \snippet activeqt/dotnet/wrapper/lib/tools.cpp 0 - \codeline - \snippet activeqt/dotnet/wrapper/lib/tools.cpp 1 - - The convertor functions can then be used in the wrapper class - implementation to call the functions in the native C++ class. - - \snippet activeqt/dotnet/wrapper/lib/networker.cpp 0 - \codeline - \snippet activeqt/dotnet/wrapper/lib/networker.cpp 1 - - The constructor and destructor simply create and destroy the Qt - object wrapped using the C++ operators \c new and \c delete. - - \snippet activeqt/dotnet/wrapper/lib/networker.cpp 2 - - The netWorker class delegates calls from the .NET code to the native - code. Although the transition between those two worlds implies a small - performance hit for each function call, and for the type conversion, - this should be negligible since we are anyway going to run within the - CLR. - - \snippet activeqt/dotnet/wrapper/lib/networker.cpp 3 - - The property setter calls the native Qt class before firing the - event using the \c __raise keyword. - - This wrapper class can now be used in .NET code, e.g. using C++, C#, - Visual Basic or any other programming language available for .NET. - - \snippet activeqt/dotnet/wrapper/main.cs 0 - \snippet activeqt/dotnet/wrapper/main.cs 1 - \snippet activeqt/dotnet/wrapper/main.cs 2 - \snippet activeqt/dotnet/wrapper/main.cs 3 - - \section1 Walkthrough: .NET/COM Interop with ActiveQt - - Fortunately .NET provides a generic wrapper for COM objects, the - \e {Runtime Callable Wrapper} (RCW). This RCW is a proxy for the - COM object and is generated by the CLR when a .NET Framework client - activates a COM object. This provides a generic way to reuse COM - objects in a .NET Framework project. - - Making a QObject class into a COM object is easily achieved with - ActiveQt and demonstrated in the QAxServer examples (e.g., the - \l{activeqt/simple}{Simple} example). The walkthrough will use - the Qt classes implemented in those examples, so the first thing - to do is to make sure that those examples have been built - correctly. - - \section2 Starting a Project - - Start Visual Studio.NET, and create a new C# project for writing a - Windows application. This will present you with an empty form in - Visual Studio's dialog editor. You should see the toolbox, which - presents you with a number of available controls and objects in - different categories. If you right-click on the toolbox it allows - you to add new tabs. We will add the tab "Qt". - - \section2 Importing Qt Widgets - - The category only has a pointer tool by default, and we have to add - the Qt objects we want to use in our form. Right-click on the empty - space, and select "Customize". This opens a dialog that has two - tabs, "COM Components" and ".NET Framework Components". We used - ActiveQt to wrap \l {QWidget}s into COM objects, so we select the "COM - Components" page, and look for the classes we want to use, e.g. - "QPushButton" and "QAxWidget2". - - When we select those widgets and close the dialog the two widgets - will now be available from the toolbox as grey squares with their - name next to it \footnote Icons could be added by modifying the - way the controls register themselves. \endfootnote. - - \section2 Using Qt Widgets - - We can now add an instance of QAxWidget2 and a QPushButton to - the form. Visual Studio will automatically generate the RCW for the - object servers. The QAxWidget2 instance takes most of the upper - part of the form, with the QPushButton in the lower right corner. - - In the property editor of Visual Studio we can modify the properties - of our controls - QPushButton exposes the \c QWidget API and has many - properties, while QAxWidget2 has only the Visual Studio standard - properties in addition to its own property "lineWidth" in the - "Miscellaneous" category. The objects are named "axQPushButton1" and - "axQAxWidget21", and since especially the last name is a bit - confusing we rename the objects to "resetButton" and "circleWidget". - - We can also change the Qt properties, e.g. set the "text" property - of the \c resetButton to "Reset", and the "lineWidth" property of the - \c circleWidget to 5. We can also put those objects into the layout - system that Visual Studio's dialog editor provides, e.g. by setting - the anchors of the \c circleWidget to "Left, Top, Right, Bottom", and - the anchors of the \c resetButton to "Bottom, Right". - - Now we can compile and start the project, which will open a user - interface with our two Qt widgets. If we can resize the dialog, - the widgets will resize appropriately. - - \section2 Handling Qt Signals - - We will now implement event handlers for the widgets. Select the - \c circleWidget and select the "Events" page in the property - editor. The widget exposes events because the QAxWidget2 class has - the "StockEvents" attribute set in its class definition. We implement - the event handler \c circleClicked for the \c ClickEvent to increase - the line width by one for every click: - - \snippet activeqt/dotnet/walkthrough/Form1.cs 0 - - In general we can implement a default event handler by double - clicking on the widget in the form, but the default events for - our widgets are right now not defined. - - We will also implement an event handler for the \c clicked signal - emitted by QPushButton. Add the event handler \c resetLineWidth to - the \c clicked event, and implement the generated function: - - \snippet activeqt/dotnet/walkthrough/Form1.cs 1 - - We reset the property to 1, and also call the \c setFocus() slot - to simulate the user style on Windows, where a button grabs focus - when you click it (so that you can click it again with the spacebar). - - If we now compile and run the project we can click on the circle - widget to increase its line width, and press the reset button to - set the line width back to 1. - - \section1 Summary - - Using ActiveQt as a universal interoperability bridge between the - .NET world and the native world of Qt is very easy, and makes it - often unnecessary to implement a lot of handwritten wrapper classes. - Instead, the QAxFactory implementation in the otherwise completely - cross-platform Qt project provides the glue that .NET needs to to - generate the RCW. - - If this is not sufficient we can implement our own wrapper classes - thanks to the C++ extensions provided by Microsoft. - - \section2 Limitations - - All the limitations when using ActiveQt are implied when using this - technique to interoperate with .NET, e.g. the datatypes we can use - in the APIs can only be those supported by ActiveQt and COM. However, - since this includes subclasses of QObject and QWidget we can wrap - any of our datatypes into a QObject subclass to make its API - available to .NET. - - When using the "IJW" method, in principle the only limitation is the - time required to write the wrapper classes and data type conversion - functions. - - \section2 Performance Considerations - - Every call from CLR bytecode to native code implies a small - performance hit, and necessary type conversions introduce an - additional delay with every layer that exists between the two - frameworks. Consequently every approach to mix .NET and native - code should try to minimize the communication necessary between - the different worlds. - - As ActiveQt introduces three layers at once - the RCW, COM and finally - ActiveQt itself - the performance penalty when using the generic - Qt/ActiveQt/COM/RCW/.NET bridge is larger than when using a - hand-crafted IJW-wrapper class. The execution speed however is still - sufficient for connecting to and modifying interactive elements in a - user interface, and as soon as the benefit of using Qt and C++ to - implement and compile performance critical algorithms into native code - kicks in, ActiveQt becomes a valid choice for making even non-visual - parts of your application accessible to .NET. -*/ |