Bookmark page
Send to a Friend
Print this page
Features:
Competitive pricing
No set-up Charges
Over 99.99% Availability
Free Trial Software
Free Technical Support
Try before you buy
Local or Internet
Reseller Opportunities
    Postcode finder using data supplied by royal mail
Updated Daily

Postcode Programming API  Simply Postcode Software COM Object:


The COM Object can be used with most modern development environments, to quickly provide Postcode Address Lookup Software functionality and Nearest Store locator Ideal for Microsoft Visual C++®, Microsoft Visual Basic®, Borland® C++ Builder, Active Server Pages (ASP) and Borland® Delphi.

Examples with full source code are included for Microsoft Visual C++®, Microsoft Visual Basic® and ASP, plus others.

The COM Object can also be used in "Local Mode", as apposed to Internet based data,  which is ideal for till solutions where no internet is available.

video  Tutorial Video : Explain COM Object

video  Full Online API Reference Manual : COM Object


COM Object Features:


The COM Object has the following features:

  • Out of the box solution Full Postcode Address Search solution
  • Quick and Simple to add Full Address Search, by using implemented User Interface
  • Offers full access to all data we provide (Full/Thoroughfare/Geographic Longitude and Latitude)
  • Offers Advanced Word Search when using implemented User Interface
  • Can be included in your own install routines
  • Data always up to date
  • No Data Administration Cost for you
  • Can allow your customer to open an account, you get commission
  • Can be run in local mode when internet is not available

COM Object Example Code


The COM Object examples:

DirectoryLanguage API UsedDescription
COM Object/
SimplyPostCodeLookupCOMExample.exe
 COMExample program of using COM
COM Object/C++ COM Objectc++COMUsing COM for FULL, Thoroughfare/Street and PostZon Data
COM Object/COM Object Files COMAll the file need to install the COM Object. These are install by InstallSimplyPostcodeCOM.EXE, but can be included in your own install routine
COM Object/Csharp COM 2005C#COMUsing COM for FULL, Thoroughfare/Street and PostZon Data
COM Object/Delphi6 COMDelphiCOM 
COM Object/VB6 COM ExampleVB6COMUsing COM for FULL, Thoroughfare/Street and PostZon Data
COM Object/VB6 COM Example Late BindingVB6COMUsing COM for FULL, Thoroughfare/Street and PostZon Data, using Late binding
COM Object/VBNET COM 2005VB.NETCOMDesktop App using COM for FULL, Thoroughfare/Street and PostZon Data
COM Object/VBNET COM 2008VB.NETCOMDesktop App using COM for FULL, Thoroughfare/Street and PostZon Data
COM Object/MS Access 2000 onwardsVBACOMExample for FULL, Thoroughfare/Street and PostZon Data
COM Object/MS Excel using COMVBACOMExample for FULL, Thoroughfare/Street, Nearest Store and PostZon Data
InstallSimplyPostcodeCOM.EXEInstallN/AInstalls the COM Object

   Download API Examples


Using the COM Object


The COM object install routine, “InstallSimplyPostcodeCOM.EXE” , is in the root directory of our example code. Or you can include the required files, found in directory "COM Object\COM Object Files", in your own install routine to ship with your bespoke software.

Creating the COM Object

Add a COM Reference to our COM object, “ISimplyPostCodeCOMClass”SimplyPostCodeLookup.dll, within your programming language.

  VB6/VB.Net
Dim SimplyPostCodeLookup As New SimplyPostCode

Specify then Data Key

The Data Key will have been sent to you via an e-mail when you opened the account. It is also available under the “Data Key” tab of the online admin window. Note the prefix “I” or “W” denotes for “Internal” / “Web” use.

  VB6/VB.Net
SimplyPostCodeLookup.SetDataKey(“I_KD352jKKHhk2GAFFKDU”)

For more information, about the COM object to implement Postcode Finder Software, click on the link below:

video  Full Online API Reference Manual : COM Object


  Using the COM Object in Local Mode


If you are using Local data, as apposed to our internet based database, then you need to specify where the data file and license is.

  We recommend you use our web based address data for initial testing. Then when happy download and install the local data files

  VB6/VB.Net
LMSetDataPath "X:\PAFDATA"
SetDataKey "I"

When in local mode the Datakey is irrelevant, since the license is defined by the code entered in manager.exe (License manager, located in "X:\PAFDATA" in the above example). But we must specify “I” or “W” for Internal or External use.

Additional files needed

To use in local mode you need additional files to:

  • Implement the Postcode Address finder database
  • Allow the licenses to be unlocked
  • Allow access to data files

For more information, about the COM object in Local mode, click on the link below:

video  Full Online API Reference Manual : COM Object using Local Data


Getting Full address finder using the COM Object User Interface


Simply call SearchForFullAddressWithDialogue(PostcodePrima, Caption, ShowLicienceDetails, AllowManageAccount, DisplayErrors)

  This call can be used with Local Data or Internet based data.  But when using Local Data the advanced search is not available.

This function call will display a dialogue box for the user to enter the postcode to search for (or address words if using our Web Based data, more info). The user then presses the [FIND] button, and a list of possible addresses is displayed for the entered postcode. The user selects an appropriate address record and the address is returned.

Postcode Lookup Example:

This code displays the following Postcode Address Lookup window:

  VB6
Function GetAddressByPostcode() As Boolean

   On Error GoTo Error_loading
   Set SimplyPostCodeLookup = CreateObject("ISimplyPostCodeCOMClass.SimplyPostCode")

   SimplyPostCodeLookup.SetDataKey ("Your Data key")

   If SimplyPostCodeLookup.SearchForFullAddressWithDialogue("", "Get Address", true, true, true) then
      With SimplyPostCodeLookup
         me.CompanyName = .Address_Organisation
         me.Line1 = .Address_Line1
         me.Line2 = .Address_Line2
         me.Line3 = .Address_Line3
         me.Town = .Address_Town
         me.County = .Address_County
         me.Postcode = .Address_Postcode

      end with
   end if
   Set SimplyPostCodeLookup = Nothing

Exit_error:

   Exit Function

Error_loading:

   MsgBox "Simply Post Lookup COM Object has not been installed on this PC !!! Please install using
               'InstallSimplyPostcodeCOM.EXE'", vbCritical, "Simply Postcode Lookup software"
   Resume Exit_error
End Function
  VB.Net
'Set Data key, to identify your account
SimplyPostCodeLookup.SetDataKey(Me.txtDataKey.Text)

With SimplyPostCodeLookup
   If .SearchForFullAddressWithDialogue(Me.txtPostcode.Text, "Get address using simple call to
               .NET Assembly Object", True, True, True)
Then

      Me.CompanyName.text = .Address_Organisation
      Me.Line1.text = .Address_Line1
      Me.Line2.text = .Address_Line2
      Me.Line3.text = .Address_Line3
      Me.Town.text = .Address_Town
      Me.County.text = .Address_County
      Me.Postcode.text = .Address_Postcode

   End If
End With


  C# .NET
//Set Data key, to identify your account
string DataKey= "Your Data Key";
SimplyPostCodeLookup.SetDataKey(ref DataKey);

//This calls the COM object to do all of the work!
string PostCodeToFind = txtPostcode.Text;
string Title = "Get address using simple call to .NET Assembly Object";

if (SimplyPostCodeLookup.SearchForFullAddressWithDialogue(PostCodeToFind, Title, true, true, true) == true)
{
   CompanyName.text = SimplyPostCodeLookup.Address_Organisation;
   Line1.text = SimplyPostCodeLookup.Address_Line1;
   Line2.text = SimplyPostCodeLookup.Address_Line2;
   Line3.text = SimplyPostCodeLookup.Address_Line3;
   Town.text = SimplyPostCodeLookup.Address_Town;
   County.text = SimplyPostCodeLookup.Address_County;
   Postcode.text = SimplyPostCodeLookup.Address_Postcode;
}

Using .NET Assembly to provide Address Finder

Advanced Search Example:

This function adds an [Advanced Find] button to the search window provided by SearchForFullAddressWithDialogue call (See previous section). This allows users to enter address words to search for, to return Full address information:

Advanced search using .NET Assembly

When the [Advanced Find] button is pressed the following is displayed:

Advanced postcode search results

Results:

Results of Advanced Postcode Search

  This call can ONLY be used with Internet based data

For more information, about the COM Object to implement Postcode Finder Software for bespoke desktop software, click on the link below:

video  Full Online API Reference Manual : COM Object


Getting Thoroughfare/Street address using the COM Object User Interface


Simply call GetThoroughfareAddressRecord(Postcode) as Boolean

This type of search will get most of the address, except the house name or number. The user then must enter this information themselves.

  This call can be used with Local Data or Internet based data. 

Simply call with the postcode to search for.

Postcode Lookup Example:

This code gets the Thoroughfare/Street address information from the Royal Mail address database.

  VB6
With SimplyPostCodeLookup
   PostcodeToSearchFor = "PE13 2QL"
   If .GetThoroughfareAddressRecord(PostcodeToSearchFor) Then
      ‘Process data
      me.Line1 = .Address_line1
      me.Line2 = .Address_line2
   Else
      'Show/Handle any errors
      MsgBox .General_credits_display_text & vbCrLf & .General_errormessage,
                        vbCritical,"Simply Postcode Lookup"

   End If

   'Show Credit/License in form caption
   Me.Caption = .General_credits_display_text
End With

  VB.Net
 'Set Data key, to identify your account
SimplyPostCodeLookup.SetDataKey("Your Data Key")

With SimplyPostCodeLookup

   If .GetThoroughfareAddressRecord(Me.txtPostcode.Text) Then
      Me.Line1.text = .Address_Line1
      Me.Line2.text = .Address_Line2
      Me.Line3.text = .Address_Line3
      Me.Town.text = .Address_Town
      Me.County.text = .Address_County
      Me.Postcode.text = .Address_Postcode

   Else
      If .General_errormessage <> "" Then
         MsgBox(.General_credits_display_text & vbCrLf & .General_errormessage,
                  vbCritical, "Simply Postcode Lookup")

      Else
         MsgBox("Not found!")
      End If
   End If

   Me.Text = "Simply Postcode Lookup : " & .General_credits_display_text
End With


  C# .NET
//Set Data key, to identify your account
string DataKey= "Your Data Key";
string DataToShow= "";
string string crlf = "\r\n";

SimplyPostCodeLookup.SetDataKey(DataKey);

string PostCodeToFind=txtPostcode.Text;
if (SimplyPostCodeLookup.GetThoroughfareAddressRecord(PostCodeToFind) == true)
{
   MessageBox.Show(GetReturnedAddressDataToText( ), "Simply Postcode Lookup");

   DataToShow = " line1 : " + SimplyPostCodeLookup.Address_Line1 + crlf;
   DataToShow = DataToShow + " line2 : " + SimplyPostCodeLookup.Address_Line2 + crlf;
   DataToShow = DataToShow + " line3 : " + SimplyPostCodeLookup.Address_Line3 + crlf;
   DataToShow = DataToShow + " town : " + SimplyPostCodeLookup.Address_Town + crlf;
   DataToShow = DataToShow + " county : " + SimplyPostCodeLookup.Address_County + crlf;
   DataToShow = DataToShow + " postcode : " + SimplyPostCodeLookup.Address_Postcode + crlf;

   //If low credit then can display button to buy more Credits/Licenses
   //This is optional, but it is recommended to provide some means for the end
   //Customer to purchase new Credits/Licenses from Simply Postcode Lookup Direct
   if (SimplyPostCodeLookup.General_credits_display_showbutton==true)
   {
      ButtonBuyMore.Visible = true;
   } else {
      ButtonBuyMore.Visible = false;
   }
} else {
   if (SimplyPostCodeLookup.General_errormessage != "" )
   {
      MessageBox.Show(SimplyPostCodeLookup.General_credits_display_text+" "+
      SimplyPostCodeLookup.General_errormessage, "Simply Postcode Lookup");

   } else {
      MessageBox.Show("Not found!");
   }
}

this.Text = "Simply Postcode Lookup : " + SimplyPostCodeLookup.General_credits_display_text;

For more information, about the COM Object to implement Postcode Finder Software for bespoke desktop software, click on the link below:

video  Full Online API Reference Manual : COM Object