NTPort Library works under Windows 7 x64 version 
Some users asked whether NTPort Library would work under Windows 7. Under our test, NTPort Library will work under Windows 7 both x86 version and x64 version. The kernel driver model of Windows 7 is same as Windows Vista, so the NTPort Library version 2.8 is compatible with Windows 7 family.

A screen shot of Speaker sample running in Windows 7 SP1 x64 version is shown below.



After NTPort Library driver is installed properly, you can view it in Device Manager under the Non-Plug and Play Drivers category if you check Show hidden devices under the View menu.



But only 32-bit applications can call ntport.dll, we will provide 64-bit ntport.dll soon.

[ add comment ] ( 377 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 2.9 / 439 )
How to support higher address than 32767 in C# 
If you use following statement in your C# program:

MessageBox.Show(NTPort.Inp(0xfc00).ToString());

You will get two errors:

Error 1 The best overloaded method match for 'NTPort.Inp(short)' has some invalid arguments
Error 2 Argument '1': cannot convert from 'int' to 'short'


Both errors are caused by incorrect declaration in NTPort.cs. In NTPort.cs, all port addresses are declared as short. We need change them from short to ushort. We only change the data type of port addresses, not other parameters, to keep backwards compatible.

The latest version of NTPort.cs is as follows,


using System;
using System.Runtime.InteropServices;
using System.Text;

/// <summary>
/// C# Class for NTPort Library
/// Copyright (c) 1997-2008 Hai Li, Zeal SoftStudio.
/// E-Mail: support@zealsoft.com
/// Web: http://www.zealsoft.com
/// </summary>
public class NTPort
{
// Returns a value indicating the last operation is successful or not.
// int WINAPI GetLastState(char *s);
[ DllImport( "Ntport.dll", EntryPoint="GetLastState", CharSet=CharSet.Auto )]
public static extern int GetLastState(
[MarshalAs(UnmanagedType.LPStr)] StringBuilder sError );

// Enable your application to read or write specific ports.
// void WINAPI EnablePorts(WORD PortStart, WORD PortStop);
[ DllImport( "Ntport.dll", EntryPoint="EnablePorts", CharSet=CharSet.Auto )]
public static extern void EnablePorts(ushort nPortStart, ushort nPortStop);

// Disable your application to read or write specific ports.
// void WINAPI DisablePorts(WORD PortStart, WORD PortStop);
[ DllImport( "Ntport.dll", EntryPoint="DisablePorts", CharSet=CharSet.Auto )]
public static extern void DisablePorts(ushort nPortStart, ushort nPortStop);

// Returns a value indicates whether the application is running under Windows NT/2000/XP/Server 2003 system.
// BOOL WINAPI IsWinNT();
[ DllImport( "Ntport.dll", EntryPoint="IsWinNT", CharSet=CharSet.Auto )]
public static extern bool IsWinNT();

// Returns a value indicates whether the application is running under 64-bit Windows system.
// BOOL WINAPI IsWin64();
[ DllImport( "Ntport.dll", EntryPoint="IsWin64", CharSet=CharSet.Auto )]
public static extern bool IsWin64();

// Returns a value from specific ports.
// WORD WINAPI Inport(WORD PortNum);
[ DllImport( "Ntport.dll", EntryPoint="Inport", CharSet=CharSet.Auto )]
public static extern byte Inport( ushort nPortAddress );
// WORD WINAPI Inp(WORD PortNum);
[ DllImport( "Ntport.dll", EntryPoint="Inp", CharSet=CharSet.Auto )]
public static extern byte Inp( ushort nPortAddress );
// WORD WINAPI Inpw(WORD PortNum);
[ DllImport( "Ntport.dll", EntryPoint="Inpw", CharSet=CharSet.Auto )]
public static extern short Inpw( ushort nPortAddress );
// WORD WINAPI InportW(WORD PortNum);
[ DllImport( "Ntport.dll", EntryPoint="InportW", CharSet=CharSet.Auto )]
public static extern short InportW( ushort nPortAddress );
// DWORD WINAPI Inpd(WORD PortNum);
[ DllImport( "Ntport.dll", EntryPoint="Inpd", CharSet=CharSet.Auto )]
public static extern short Inpd( ushort nPortAddress );
//DWORD WINAPI InportD(WORD PortNum);
[ DllImport( "Ntport.dll", EntryPoint="InportD", CharSet=CharSet.Auto )]
public static extern int InportD( ushort nPortAddress );

// Write a value to specific ports.
// void WINAPI Outp(WORD PortNum, WORD Data);
[ DllImport( "Ntport.dll", EntryPoint="Outp", CharSet=CharSet.Auto )]
public static extern void Outp( ushort nPortAddress, short nData);
// void WINAPI Outport(WORD PortNum, WORD Data);
[ DllImport( "Ntport.dll", EntryPoint="Outport", CharSet=CharSet.Auto )]
public static extern void Outport( ushort nPortAddress, short nData);
// void WINAPI Outpw(WORD PortNum, WORD Data);
[ DllImport( "Ntport.dll", EntryPoint="Outpw", CharSet=CharSet.Auto )]
public static extern void Outpw( ushort nPortAddress, short nData);
// void WINAPI OutportW(WORD PortNum, WORD Data);
[ DllImport( "Ntport.dll", EntryPoint="OutportW", CharSet=CharSet.Auto )]
public static extern void OutportW( ushort nPortAddress, short nData);
// void WINAPI Outpd(WORD PortNum, DWORD Data);
[ DllImport( "Ntport.dll", EntryPoint="Outpd", CharSet=CharSet.Auto )]
public static extern void Outpd( ushort nPortAddress, int nData);
// void WINAPI OutportD(WORD PortNum, DWORD Data);
[ DllImport( "Ntport.dll", EntryPoint="OutportD", CharSet=CharSet.Auto )]
public static extern void OutportD( ushort nPortAddress, int nData);

// Set the registration information.
// void WINAPI LicenseInfo(LPSTR sUserName, DWORD dwKey);
[ DllImport( "Ntport.dll", EntryPoint="LicenseInfo", CharSet=CharSet.Auto )]
public static extern void LicenseInfo(
[MarshalAs(UnmanagedType.LPStr)]String sUserName, int dwKey);

// Returns the version of NTPort Library.
// WORD WINAPI GetNTPortVersion();
[ DllImport( "Ntport.dll", EntryPoint="GetNTPortVersion", CharSet=CharSet.Auto )]
public static extern short GetNTPortVersion();

// Set the setting of fast mode
// void WINAPI SetFastMode(BOOL bOption);
[ DllImport( "Ntport.dll", EntryPoint="SetFastMode", CharSet=CharSet.Auto )]
public static extern void SetFastMode(bool bOption);

// Get the current setting of fast mode
// BOOL WINAPI GetFastMode();
[ DllImport( "Ntport.dll", EntryPoint="GetFastMode", CharSet=CharSet.Auto )]
public static extern bool GetFastMode();

// Get the base address of LPT port
// WORD WINAPI GetLPTPortAddress(WORD PortNo);
[ DllImport( "Ntport.dll", EntryPoint="GetLPTPortAddress", CharSet=CharSet.Auto )]
public static extern ushort GetLPTPortAddress(short nPortNo);

public const int ERROR_NONE = 0;
public const int ERROR_DRIVER = 2;
public const int ERROR_SCM_CANT_CONNECT = 9998;

public NTPort()
{
//
// TODO: Add constructor logic here
//
}
}


[ 3 comments ] ( 599 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 341 )
NTPort Library has received a 5 Stars Rating at PCWin.com 
This a new award for NTPort Library. Visit NTPort Library page at PCWin.com.


[ 4 comments ] ( 622 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 2.9 / 2286 )
NTPort Library now supports Windows Vista! 
We are excited to announce the new release of NTPort Library, version 2.8 .

In this version, we officially support Windows Vista, both x86 and x64 version . From July 2006, we worked on Windows Vista, and released beta versions to our registered users. We got valuable feedbacks from our testers. Now, I think it's the time to release it to all users. Two major updates, signed kernel driver and HTML Help(.chm format), are made for Windows Vista. A screen shot of PortTest sample running in Windows Vista is shown below.



We also addJBuilder 2007 & Eclipse samples to this version. We will continue to develop more samples for our customers.

Since last version, Microsoft and CodeGear have released their new development tools. We are registered partner of Microsoft and Technology Partner of CodeGear. Of course, we provide full support of Visual Studio 2008 and CodeGear RAD Studio 2007 in this version.

Although x64 edition of Windows is not so popular as x86 edition, we continue to improve our x64 support. We rewrite the merge module for Windows Installer, so that it can work with both 32-bit and 64-bit installer.

A small feature is missing in this version. We removed Wise Installation System 8.0 sample. which is out-of-date.

If you are a registered user, please go to update page to download the upgrade version. If you are a new user, please go to download page to get a full feature evaluation version.

[ add comment ] ( 235 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 2072 )
Add NTPort Library path to Visual C++ 2005/2008 directories 
The installer of NTPort Library will automatically add NTPort Library to Visual C++ 6.0/2002/2003's directories, so Visual C++ can easily find ntport.h and ntport.lib.

But our installer won't do such things in Visual C++ 2005/2008. Because Visual C++ 2005/2008 stores such settings in two files, VCProjectEngine.dll.config and VCProjectEngine.Dll.Express.Config in <Visual Studio directory>\VC\vcpackages. Both files in XML format, so it's a bit difficult to modify both files in our installer written in NSIS. We recommend you to add NTPort Library manually using Tools -> Options -> Projects and Solutions -> VC++ Directories .

[ 1 comment ] ( 638 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 2658 )
NTPort Library received 5 stars award 
NTPort Library receives 5 stars award from Download25.com. See NTPort Libary page at Downlod25.com.


[ 2 comments ] ( 521 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 2.9 / 2456 )
NTPort Library for JBuilder 2007 Samples 
Now, NTPort Library for JBuilder 2007 Samples are available for download.

From version 2.6, we supports JBuilder 2006 and previous version. JBuilder 2007 is a completely new version and built on the open source Eclipse platform. Our samples are fully tested with JBuilder 2007 and will be included in the next release of NTPort Library.

Before install and run these samples, you must install an evaluation version or registration version of NTPort Library, which includes Java JNI DLL and other documents. If you don't have a copy of NTPort Library, please download an evaluation version from here.



[ add comment ] ( 14 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 2765 )
We supports all Borland Turbo products. 
Zeal SoftStudio announced that our flagship products, NTPort Library and MemAccess Library will support all Borland Turbo products. As a Borland Technology Partner (BTP), we always provide best support to Borland Development tools, and our products will pass the test with Borland Development products before Borland release its products.

The Turbo product set includes Turbo Delphi for Win32, Turbo Delphi for .NET Turbo C++ and Turbo C# Each version will be available in two editions: Turbo Explorer, a free downloadable version, and Turbo Professional, a version priced less than $500 which is designed to accept thousands of available third-party tools, components and plug-ins. All Turbo editions enable developers to rapidly build high performance GUI, Database, Web, and Web Services applications for Microsoft Windows. Turbo Delphi for .NET and Turbo C# support the Microsoft .NET and ASP.NET platforms. More information is available at http://www.turboexplorer.com.

Turbo Delphi Turbo Delphi for .NET Turbo C++ Turbo C#


[ add comment ] ( 40 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 3006 )

Back Next