mirror of
https://github.com/soukoku/ntwain.git
synced 2025-07-16 22:18:33 +08:00
Add 64bit tester and fixed version # in builds by switching to v6 sdk.
This commit is contained in:
parent
f48c731aad
commit
9d0770a2ef
@ -1,3 +1,4 @@
|
|||||||
@echo off
|
@echo off
|
||||||
cls
|
cls
|
||||||
dotnet pack src\NTwain -c Release -o build
|
dotnet pack src\NTwain -c Release -o build
|
||||||
|
pause
|
@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_common", "_common", "{4CE0
|
|||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
Build.cmd = Build.cmd
|
Build.cmd = Build.cmd
|
||||||
src\Directory.Build.props = src\Directory.Build.props
|
src\Directory.Build.props = src\Directory.Build.props
|
||||||
|
global.json = global.json
|
||||||
LICENSE.txt = LICENSE.txt
|
LICENSE.txt = LICENSE.txt
|
||||||
README.md = README.md
|
README.md = README.md
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
@ -26,6 +27,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NTwain-temp", "src\NTwain-t
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForm32", "samples\WinForm32\WinForm32.csproj", "{7792A94E-D0B4-440D-8BD5-CA1CA548782C}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForm32", "samples\WinForm32\WinForm32.csproj", "{7792A94E-D0B4-440D-8BD5-CA1CA548782C}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinForm64", "samples\WinForm64\WinForm64.csproj", "{C9666CB2-C9A6-48C8-AB51-D616A48058A7}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -43,12 +46,17 @@ Global
|
|||||||
{7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Release|Any CPU.Build.0 = Release|Any CPU
|
{7792A94E-D0B4-440D-8BD5-CA1CA548782C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{C9666CB2-C9A6-48C8-AB51-D616A48058A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C9666CB2-C9A6-48C8-AB51-D616A48058A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C9666CB2-C9A6-48C8-AB51-D616A48058A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C9666CB2-C9A6-48C8-AB51-D616A48058A7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{7792A94E-D0B4-440D-8BD5-CA1CA548782C} = {707B4313-8EF8-4D0F-A95E-590783422187}
|
{7792A94E-D0B4-440D-8BD5-CA1CA548782C} = {707B4313-8EF8-4D0F-A95E-590783422187}
|
||||||
|
{C9666CB2-C9A6-48C8-AB51-D616A48058A7} = {707B4313-8EF8-4D0F-A95E-590783422187}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {7459323B-44F6-4E07-8574-E1B4B525086B}
|
SolutionGuid = {7459323B-44F6-4E07-8574-E1B4B525086B}
|
||||||
|
7
global.json
Normal file
7
global.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
// have to use v6 since v7 doesn't generate correct version attributes
|
||||||
|
// for -windows variant
|
||||||
|
"sdk": {
|
||||||
|
"version": "6.0"
|
||||||
|
}
|
||||||
|
}
|
2
samples/WinForm32/Form1.Designer.cs
generated
2
samples/WinForm32/Form1.Designer.cs
generated
@ -1,4 +1,4 @@
|
|||||||
namespace WinForm32
|
namespace WinFormSample
|
||||||
{
|
{
|
||||||
partial class Form1
|
partial class Form1
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,7 @@ using System.Diagnostics;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace WinForm32
|
namespace WinFormSample
|
||||||
{
|
{
|
||||||
public partial class Form1 : Form
|
public partial class Form1 : Form
|
||||||
{
|
{
|
||||||
@ -15,7 +15,9 @@ namespace WinForm32
|
|||||||
public Form1()
|
public Form1()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Text += TwainPlatform.Is32bit ? " 32bit" : " 64bit";
|
var libVer = FileVersionInfo.GetVersionInfo(typeof(TwainAppSession).Assembly.Location).FileVersion;
|
||||||
|
Text += $"{(TwainPlatform.Is32bit ? " 32bit" : " 64bit")} on NTwain {libVer}";
|
||||||
|
|
||||||
TwainPlatform.PreferLegacyDSM = false;
|
TwainPlatform.PreferLegacyDSM = false;
|
||||||
|
|
||||||
twain = new TwainAppSession(new WinformMarshaller(this), Assembly.GetExecutingAssembly().Location);
|
twain = new TwainAppSession(new WinformMarshaller(this), Assembly.GetExecutingAssembly().Location);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace WinForm32
|
namespace WinFormSample
|
||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
|
@ -6,10 +6,17 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<RootNamespace>WinFormSample</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\NTwain\NTwain.csproj" />
|
<ProjectReference Include="..\..\src\NTwain\NTwain.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="platforms\qwindows.dll">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
BIN
samples/WinForm32/platforms/qwindows.dll
Normal file
BIN
samples/WinForm32/platforms/qwindows.dll
Normal file
Binary file not shown.
30
samples/WinForm64/WinForm64.csproj
Normal file
30
samples/WinForm64/WinForm64.csproj
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<RootNamespace>WinFormSample</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\src\NTwain\NTwain.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\WinForm32\**\*.cs" Exclude="..\WinForm32\**\obj\**;..\WinForm32\**\bin\**">
|
||||||
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="..\WinForm32\**\*.resx" Exclude="..\WinForm32\**\obj\**;..\WinForm32\**\bin\**">
|
||||||
|
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="platforms\qwindows.dll">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
BIN
samples/WinForm64/platforms/qwindows.dll
Normal file
BIN
samples/WinForm64/platforms/qwindows.dll
Normal file
Binary file not shown.
@ -1,24 +1,24 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!--change in each release-->
|
<!--change these in each release-->
|
||||||
<PackageVersion>4.0.0-alpha.1</PackageVersion>
|
<VersionPrefix>4.0.0.0</VersionPrefix>
|
||||||
|
<VersionSuffix>alpha.1</VersionSuffix>
|
||||||
|
|
||||||
<!--keep it the same until major # changes-->
|
<!--keep it the same until major # changes-->
|
||||||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||||||
|
|
||||||
|
<!--even more unlikely to change-->
|
||||||
|
<FileVersion>$(VersionPrefix)</FileVersion>
|
||||||
<PackageProjectUrl>https://github.com/soukoku/ntwain</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/soukoku/ntwain</PackageProjectUrl>
|
||||||
<PackageTags>twain scan</PackageTags>
|
<PackageTags>twain scan</PackageTags>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<PackageIcon>Scanner-Icon.png</PackageIcon>
|
<PackageIcon>Scanner-Icon.png</PackageIcon>
|
||||||
<!--<PackageIconUrl>https://github.com/soukoku/ntwain/blob/master/Scanner-Icon.png?raw=true</PackageIconUrl>-->
|
|
||||||
<RepositoryUrl>https://github.com/soukoku/ntwain</RepositoryUrl>
|
<RepositoryUrl>https://github.com/soukoku/ntwain</RepositoryUrl>
|
||||||
<RepositoryType>GIT</RepositoryType>
|
<RepositoryType>GIT</RepositoryType>
|
||||||
<NeutralLanguage>en-US</NeutralLanguage>
|
<NeutralLanguage>en-US</NeutralLanguage>
|
||||||
<!--<Copyright>Eugene Wang 2012</Copyright>-->
|
<Copyright>Eugene Wang 2012-2023</Copyright>
|
||||||
<Authors>Eugene Wang</Authors>
|
<Authors>Eugene Wang</Authors>
|
||||||
|
|
||||||
<Version>$(PkgVersion)</Version>
|
|
||||||
<FileVersion>$(PkgVersion)</FileVersion>
|
|
||||||
<LangVersion>11</LangVersion>
|
<LangVersion>11</LangVersion>
|
||||||
<!--don't warn missing xml docs, naming conventions, and suppressions-->
|
<!--don't warn missing xml docs, naming conventions, and suppressions-->
|
||||||
<NoWarn>1591,IDE1006,IDE0079</NoWarn>
|
<NoWarn>1591,IDE1006,IDE0079</NoWarn>
|
||||||
|
@ -3,7 +3,7 @@ This is the lowest API level of the lib and should not
|
|||||||
be used directly unless you know what you're doing.
|
be used directly unless you know what you're doing.
|
||||||
|
|
||||||
A higher level abstraction such as the ones in the
|
A higher level abstraction such as the ones in the
|
||||||
`Triplets` namespace or the `TwainSession` object
|
`Triplets` namespace or the `TwainAppSession` object
|
||||||
would be easier to use.
|
would be easier to use.
|
||||||
|
|
||||||
The individual classes are generated by the
|
The individual classes are generated by the
|
||||||
|
@ -9,7 +9,7 @@ namespace NTwain
|
|||||||
|
|
||||||
partial class TwainAppSession : IMemoryManager
|
partial class TwainAppSession : IMemoryManager
|
||||||
{
|
{
|
||||||
internal TW_ENTRYPOINT_DELEGATES _entryPoint;
|
TW_ENTRYPOINT_DELEGATES _entryPoint;
|
||||||
|
|
||||||
public IntPtr Alloc(uint size)
|
public IntPtr Alloc(uint size)
|
||||||
{
|
{
|
||||||
|
@ -72,11 +72,11 @@ namespace NTwain
|
|||||||
|
|
||||||
private bool CheckIfTwainMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam)
|
private bool CheckIfTwainMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam)
|
||||||
{
|
{
|
||||||
// this handles the message from a typical WndProc message loop and check if it's from the TWAIN source.
|
// this handles the message from a typical WndProc message loop and checks if it's for the TWAIN source.
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
if (_state >= STATE.S5)
|
if (_state >= STATE.S5)
|
||||||
{
|
{
|
||||||
var winMsg = new WIN_MESSAGE
|
WIN_MESSAGE winMsg = new()
|
||||||
{
|
{
|
||||||
hwnd = hWnd,
|
hwnd = hWnd,
|
||||||
message = (uint)msg,
|
message = (uint)msg,
|
||||||
|
Loading…
Reference in New Issue
Block a user