From 8e7cd00b74e10747545507fe7b2e73e1e71aeec3 Mon Sep 17 00:00:00 2001 From: Bob Hodgetts Date: Thu, 1 May 2025 18:39:08 +0100 Subject: [PATCH] Some updates to the COM lib to attempt to get it to work on .net 8. Unfinished, porting all Access functions over to vs instead --- .../ILRepack.Config.props.old2 | 6 + src/bnhtrade.ComTypeLib/ILRepack.targets | 12 +- src/bnhtrade.ComTypeLib/README.md | 11 ++ .../bnhtrade.ComTypeLib.csproj | 20 +++- .../Properties/Settings.Designer.cs | 2 +- src/bnhtrade.Core/bnhtrade.Core.csproj | 39 ++++--- .../bnhtrade.ScheduledTasks.csproj | 3 +- src/bnhtrade.gui/Home.Designer.cs | 103 +++++++++++++----- src/bnhtrade.gui/Home.resx | 10 +- 9 files changed, 147 insertions(+), 59 deletions(-) create mode 100644 src/bnhtrade.ComTypeLib/ILRepack.Config.props.old2 create mode 100644 src/bnhtrade.ComTypeLib/README.md diff --git a/src/bnhtrade.ComTypeLib/ILRepack.Config.props.old2 b/src/bnhtrade.ComTypeLib/ILRepack.Config.props.old2 new file mode 100644 index 0000000..35e9ad5 --- /dev/null +++ b/src/bnhtrade.ComTypeLib/ILRepack.Config.props.old2 @@ -0,0 +1,6 @@ + + + + True + + \ No newline at end of file diff --git a/src/bnhtrade.ComTypeLib/ILRepack.targets b/src/bnhtrade.ComTypeLib/ILRepack.targets index 8bf0115..24ac6c2 100644 --- a/src/bnhtrade.ComTypeLib/ILRepack.targets +++ b/src/bnhtrade.ComTypeLib/ILRepack.targets @@ -1,8 +1,12 @@ + - + + + + + LibraryPath="$(OutputPath)" + /> - \ No newline at end of file + + \ No newline at end of file diff --git a/src/bnhtrade.ComTypeLib/README.md b/src/bnhtrade.ComTypeLib/README.md new file mode 100644 index 0000000..d78c968 --- /dev/null +++ b/src/bnhtrade.ComTypeLib/README.md @@ -0,0 +1,11 @@ +To setup on new computer: + +1. Add the app.local.config to the users ..\AppData\Local\bnhtrade\ folder (create the bnhtrade folder) + +2. CLone bnhtrade solution from the repo + +3. Build bnhtradeCOM project + +4. Register the COM host for COM. With an elevated prompt, navigate to the build directory and run "regsvr32 bnhtradeCOM.comhost.dll" + +5. \ No newline at end of file diff --git a/src/bnhtrade.ComTypeLib/bnhtrade.ComTypeLib.csproj b/src/bnhtrade.ComTypeLib/bnhtrade.ComTypeLib.csproj index 263137a..599052e 100644 --- a/src/bnhtrade.ComTypeLib/bnhtrade.ComTypeLib.csproj +++ b/src/bnhtrade.ComTypeLib/bnhtrade.ComTypeLib.csproj @@ -4,8 +4,17 @@ Library bnhtradeCOM false + + - + + + true + + + + + false @@ -24,15 +33,11 @@ - + - - copy "$(ProjectDir)_RegAsmInstall.bat" "$(TargetDir)" -copy "$(ProjectDir)_RegAsmRefresh.bat" "$(TargetDir)" -copy "$(ProjectDir)_RegAsmUninstall.bat" "$(TargetDir)" bnhtrade COM Type Library bnhtrade bnhtradeCOMAsm @@ -40,4 +45,7 @@ copy "$(ProjectDir)_RegAsmUninstall.bat" "$(TargetDir)" 1.0.0.0 1.0.0.0 + + + \ No newline at end of file diff --git a/src/bnhtrade.Core/Properties/Settings.Designer.cs b/src/bnhtrade.Core/Properties/Settings.Designer.cs index a3552dd..54f8522 100644 --- a/src/bnhtrade.Core/Properties/Settings.Designer.cs +++ b/src/bnhtrade.Core/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace bnhtrade.Core.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.13.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/bnhtrade.Core/bnhtrade.Core.csproj b/src/bnhtrade.Core/bnhtrade.Core.csproj index 55a9e13..806982c 100644 --- a/src/bnhtrade.Core/bnhtrade.Core.csproj +++ b/src/bnhtrade.Core/bnhtrade.Core.csproj @@ -5,6 +5,8 @@ false true true + + false @@ -30,28 +32,29 @@ - - - - - - - - - true - + - - - - true - - - - + + + + + + + + True + True + Settings.settings + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + \ No newline at end of file diff --git a/src/bnhtrade.ScheduledTasks/bnhtrade.ScheduledTasks.csproj b/src/bnhtrade.ScheduledTasks/bnhtrade.ScheduledTasks.csproj index 4b3c2a2..29c1d33 100644 --- a/src/bnhtrade.ScheduledTasks/bnhtrade.ScheduledTasks.csproj +++ b/src/bnhtrade.ScheduledTasks/bnhtrade.ScheduledTasks.csproj @@ -64,8 +64,7 @@ - - + bnhtrade Scheduled Tasks diff --git a/src/bnhtrade.gui/Home.Designer.cs b/src/bnhtrade.gui/Home.Designer.cs index ed278d1..45c1b74 100644 --- a/src/bnhtrade.gui/Home.Designer.cs +++ b/src/bnhtrade.gui/Home.Designer.cs @@ -48,11 +48,14 @@ dateTimeOrderSearch = new DateTimePicker(); label1 = new Label(); textboxOrderSearch = new TextBox(); + tabAccounts = new TabPage(); + btnExchangeRate = new Button(); tabControl1.SuspendLayout(); Receiving.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); ((System.ComponentModel.ISupportInitialize)bsReceivingLines).BeginInit(); ((System.ComponentModel.ISupportInitialize)purchaseLineStatusBindingSource).BeginInit(); + tabAccounts.SuspendLayout(); SuspendLayout(); // // tabControl1 @@ -61,19 +64,22 @@ tabControl1.Controls.Add(tabPage1); tabControl1.Controls.Add(tabPage2); tabControl1.Controls.Add(Receiving); - tabControl1.Location = new Point(12, 12); + tabControl1.Controls.Add(tabAccounts); + tabControl1.Location = new Point(14, 16); + tabControl1.Margin = new Padding(3, 4, 3, 4); tabControl1.Name = "tabControl1"; tabControl1.SelectedIndex = 0; - tabControl1.Size = new Size(1022, 533); + tabControl1.Size = new Size(1168, 711); tabControl1.TabIndex = 0; tabControl1.SelectedIndexChanged += tabControl1_SelectedIndexChanged; // // tabPage1 // - tabPage1.Location = new Point(4, 24); + tabPage1.Location = new Point(4, 29); + tabPage1.Margin = new Padding(3, 4, 3, 4); tabPage1.Name = "tabPage1"; - tabPage1.Padding = new Padding(3); - tabPage1.Size = new Size(1014, 505); + tabPage1.Padding = new Padding(3, 4, 3, 4); + tabPage1.Size = new Size(1160, 678); tabPage1.TabIndex = 0; tabPage1.Text = "Home"; tabPage1.UseVisualStyleBackColor = true; @@ -81,10 +87,11 @@ // tabPage2 // tabPage2.AccessibleName = ""; - tabPage2.Location = new Point(4, 24); + tabPage2.Location = new Point(4, 29); + tabPage2.Margin = new Padding(3, 4, 3, 4); tabPage2.Name = "tabPage2"; - tabPage2.Padding = new Padding(3); - tabPage2.Size = new Size(1014, 505); + tabPage2.Padding = new Padding(3, 4, 3, 4); + tabPage2.Size = new Size(1160, 678); tabPage2.TabIndex = 1; tabPage2.Text = "FBA Shipments"; tabPage2.UseVisualStyleBackColor = true; @@ -98,10 +105,11 @@ Receiving.Controls.Add(dateTimeOrderSearch); Receiving.Controls.Add(label1); Receiving.Controls.Add(textboxOrderSearch); - Receiving.Location = new Point(4, 24); + Receiving.Location = new Point(4, 29); + Receiving.Margin = new Padding(3, 4, 3, 4); Receiving.Name = "Receiving"; - Receiving.Padding = new Padding(3); - Receiving.Size = new Size(1014, 505); + Receiving.Padding = new Padding(3, 4, 3, 4); + Receiving.Size = new Size(1160, 678); Receiving.TabIndex = 2; Receiving.Text = "Receiving"; Receiving.UseVisualStyleBackColor = true; @@ -111,10 +119,10 @@ // labelDataGridCount.Anchor = AnchorStyles.Right; labelDataGridCount.ImageAlign = ContentAlignment.MiddleRight; - labelDataGridCount.Location = new Point(857, 70); + labelDataGridCount.Location = new Point(979, 93); labelDataGridCount.Name = "labelDataGridCount"; labelDataGridCount.RightToLeft = RightToLeft.Yes; - labelDataGridCount.Size = new Size(129, 21); + labelDataGridCount.Size = new Size(147, 28); labelDataGridCount.TabIndex = 6; labelDataGridCount.Text = "labelListCount"; labelDataGridCount.TextAlign = ContentAlignment.MiddleLeft; @@ -126,11 +134,13 @@ dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView1.Columns.AddRange(new DataGridViewColumn[] { purchaseNumberDataGridViewTextBoxColumn, purchaseDateDataGridViewTextBoxColumn, itemDescriptionDataGridViewTextBoxColumn, purchaseLineIdDataGridViewTextBoxColumn, lineStatusDataGridViewTextBoxColumn, purchaseIdDataGridViewTextBoxColumn }); dataGridView1.DataSource = bsReceivingLines; - dataGridView1.Location = new Point(31, 94); + dataGridView1.Location = new Point(35, 125); + dataGridView1.Margin = new Padding(3, 4, 3, 4); dataGridView1.MultiSelect = false; dataGridView1.Name = "dataGridView1"; + dataGridView1.RowHeadersWidth = 51; dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; - dataGridView1.Size = new Size(955, 396); + dataGridView1.Size = new Size(1091, 528); dataGridView1.TabIndex = 5; dataGridView1.DoubleClick += dataGridView1_DoubleClick; // @@ -138,18 +148,23 @@ // purchaseNumberDataGridViewTextBoxColumn.DataPropertyName = "PurchaseNumber"; purchaseNumberDataGridViewTextBoxColumn.HeaderText = "PurchaseNumber"; + purchaseNumberDataGridViewTextBoxColumn.MinimumWidth = 6; purchaseNumberDataGridViewTextBoxColumn.Name = "purchaseNumberDataGridViewTextBoxColumn"; + purchaseNumberDataGridViewTextBoxColumn.Width = 125; // // purchaseDateDataGridViewTextBoxColumn // purchaseDateDataGridViewTextBoxColumn.DataPropertyName = "PurchaseDate"; purchaseDateDataGridViewTextBoxColumn.HeaderText = "PurchaseDate"; + purchaseDateDataGridViewTextBoxColumn.MinimumWidth = 6; purchaseDateDataGridViewTextBoxColumn.Name = "purchaseDateDataGridViewTextBoxColumn"; + purchaseDateDataGridViewTextBoxColumn.Width = 125; // // itemDescriptionDataGridViewTextBoxColumn // itemDescriptionDataGridViewTextBoxColumn.DataPropertyName = "ItemDescription"; itemDescriptionDataGridViewTextBoxColumn.HeaderText = "ItemDescription"; + itemDescriptionDataGridViewTextBoxColumn.MinimumWidth = 6; itemDescriptionDataGridViewTextBoxColumn.Name = "itemDescriptionDataGridViewTextBoxColumn"; itemDescriptionDataGridViewTextBoxColumn.Width = 500; // @@ -157,19 +172,25 @@ // purchaseLineIdDataGridViewTextBoxColumn.DataPropertyName = "PurchaseLineId"; purchaseLineIdDataGridViewTextBoxColumn.HeaderText = "PurchaseLineId"; + purchaseLineIdDataGridViewTextBoxColumn.MinimumWidth = 6; purchaseLineIdDataGridViewTextBoxColumn.Name = "purchaseLineIdDataGridViewTextBoxColumn"; + purchaseLineIdDataGridViewTextBoxColumn.Width = 125; // // lineStatusDataGridViewTextBoxColumn // lineStatusDataGridViewTextBoxColumn.DataPropertyName = "LineStatus"; lineStatusDataGridViewTextBoxColumn.HeaderText = "LineStatus"; + lineStatusDataGridViewTextBoxColumn.MinimumWidth = 6; lineStatusDataGridViewTextBoxColumn.Name = "lineStatusDataGridViewTextBoxColumn"; + lineStatusDataGridViewTextBoxColumn.Width = 125; // // purchaseIdDataGridViewTextBoxColumn // purchaseIdDataGridViewTextBoxColumn.DataPropertyName = "PurchaseId"; purchaseIdDataGridViewTextBoxColumn.HeaderText = "PurchaseId"; + purchaseIdDataGridViewTextBoxColumn.MinimumWidth = 6; purchaseIdDataGridViewTextBoxColumn.Name = "purchaseIdDataGridViewTextBoxColumn"; + purchaseIdDataGridViewTextBoxColumn.Width = 125; // // bsReceivingLines // @@ -177,9 +198,10 @@ // // buttonSearch // - buttonSearch.Location = new Point(865, 37); + buttonSearch.Location = new Point(989, 49); + buttonSearch.Margin = new Padding(3, 4, 3, 4); buttonSearch.Name = "buttonSearch"; - buttonSearch.Size = new Size(109, 25); + buttonSearch.Size = new Size(125, 33); buttonSearch.TabIndex = 4; buttonSearch.Text = "Search"; buttonSearch.UseVisualStyleBackColor = true; @@ -190,9 +212,10 @@ comboBox1.DataSource = purchaseLineStatusBindingSource; comboBox1.DisplayMember = "PurchaseLineStatusName"; comboBox1.FormattingEnabled = true; - comboBox1.Location = new Point(195, 39); + comboBox1.Location = new Point(223, 52); + comboBox1.Margin = new Padding(3, 4, 3, 4); comboBox1.Name = "comboBox1"; - comboBox1.Size = new Size(189, 23); + comboBox1.Size = new Size(215, 28); comboBox1.TabIndex = 3; comboBox1.ValueMember = "PurchaseLineStatusId"; comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged; @@ -204,35 +227,58 @@ // // dateTimeOrderSearch // - dateTimeOrderSearch.Location = new Point(31, 39); + dateTimeOrderSearch.Location = new Point(35, 52); + dateTimeOrderSearch.Margin = new Padding(3, 4, 3, 4); dateTimeOrderSearch.Name = "dateTimeOrderSearch"; - dateTimeOrderSearch.Size = new Size(131, 23); + dateTimeOrderSearch.Size = new Size(149, 27); dateTimeOrderSearch.TabIndex = 2; dateTimeOrderSearch.ValueChanged += dateTimeOrderSearch_ValueChanged; // // label1 // label1.AutoSize = true; - label1.Location = new Point(31, 21); + label1.Location = new Point(35, 28); label1.Name = "label1"; - label1.Size = new Size(75, 15); + label1.Size = new Size(95, 20); label1.TabIndex = 1; label1.Text = "Order Search"; // // textboxOrderSearch // - textboxOrderSearch.Location = new Point(417, 39); + textboxOrderSearch.Location = new Point(477, 52); + textboxOrderSearch.Margin = new Padding(3, 4, 3, 4); textboxOrderSearch.Name = "textboxOrderSearch"; - textboxOrderSearch.Size = new Size(415, 23); + textboxOrderSearch.Size = new Size(474, 27); textboxOrderSearch.TabIndex = 0; textboxOrderSearch.KeyPress += textboxOrderSearch_KeyPress; // + // tabAccounts + // + tabAccounts.Controls.Add(btnExchangeRate); + tabAccounts.Location = new Point(4, 29); + tabAccounts.Name = "tabAccounts"; + tabAccounts.Padding = new Padding(3); + tabAccounts.Size = new Size(1160, 678); + tabAccounts.TabIndex = 3; + tabAccounts.Text = "Accounts"; + tabAccounts.UseVisualStyleBackColor = true; + // + // btnExchangeRate + // + btnExchangeRate.Location = new Point(48, 50); + btnExchangeRate.Name = "btnExchangeRate"; + btnExchangeRate.Size = new Size(237, 50); + btnExchangeRate.TabIndex = 0; + btnExchangeRate.Text = "Exchange rate input"; + btnExchangeRate.UseVisualStyleBackColor = true; + // // Home // - AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1046, 557); + ClientSize = new Size(1195, 743); Controls.Add(tabControl1); + Margin = new Padding(3, 4, 3, 4); Name = "Home"; Text = "Form1"; Load += Form1_Load; @@ -242,6 +288,7 @@ ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); ((System.ComponentModel.ISupportInitialize)bsReceivingLines).EndInit(); ((System.ComponentModel.ISupportInitialize)purchaseLineStatusBindingSource).EndInit(); + tabAccounts.ResumeLayout(false); ResumeLayout(false); } @@ -266,5 +313,7 @@ private DataGridViewTextBoxColumn lineStatusDataGridViewTextBoxColumn; private DataGridViewTextBoxColumn purchaseIdDataGridViewTextBoxColumn; private Label labelDataGridCount; + private TabPage tabAccounts; + private Button btnExchangeRate; } } diff --git a/src/bnhtrade.gui/Home.resx b/src/bnhtrade.gui/Home.resx index 70d97fa..80aeb14 100644 --- a/src/bnhtrade.gui/Home.resx +++ b/src/bnhtrade.gui/Home.resx @@ -1,7 +1,7 @@