 API browser of webstampManager400 COM module
Interface version: | 4.00
Interface date: | 9 Oct 2007

The WebstampManager is an ATL COM module which provides methods to generate electronic stamps as BMP files suitable to stamp print matters.

The WebstampManager is based on the newest generation of the Swiss Post's webstamp functionality. Although the module is independent of the Sumex1 xmlManager modules, these were updated accordingly to process such webstamp files via the Print method (cf. below "How to print a stamp onto an invoice/credit/reminder request form").

Prerequisites for the usage of WebstampManager:

  • HTTP connection to the internet on port 80
  • A valid account for Webstamps on the Swiss Post's site.
 space
Interfaces | 1 interface
IWebstampManager | Main stamp generator interface
Types
type definitions | List of all used builtin, composite and enumeration types
Important information about the usage and handling of the module
Document | General usage of the webstampManager400 COM module - an overview
Document | VB code snippet for using the webstampManager400 COM module
Document | How to print a stamp onto an invoice/credit request

© by sumex1.net - all rights reserved


  • webstampManager400
  • IWebstampManager

IWebstampManager interface |  | V4.00/ 9 Oct 2007
The WebstampManager provides all the necessary tools to produce electronic stamp as BMP files. These stamps can be used as postages for print matters e.g. in the XMLManagers. |  | space
Methods |  | 10 methods
GetAbortInfo | Get the abort information. |
GetFirstOption | Retrieves the first option based on your search call. |
GetInfoBalance | Get the current balance of your Swiss Post account. |
GetInfoJournal | Get a journal of your webstamp activity in a given time interval as a one-time-hash URL |
GetInfoReceipt | Get a receipt of a previously generated webstamp as PDF file |
GetNextOption | Retrieves the next option based on your search call until no more options are available. |
InfoStamp | Retrieve all needed information about a previously generated stamp given by an order id. |
OrderStamp | Order one new electronic stamp defined by the given product id. |
SearchOptions | Search for |
StornoStamp | Since the Swiss Post webstamp module does not implement a storno functionality for a generated stamp you must reuse a stamp file e. |
Properties |  | 9 properties
[get/put] BaseDirectory | Get and Set the base directory where the generated webstamps and receipts are stored. |
[get/put] EnableLog | Get and Set the log activity for the module. |
[get/put] Logo | Get and Set a logo as an absolute filename of a BMP logo to be used for stamps with LocationType=enLocationPostageZone. |
[get/put] ModuleLanguage | Language in which the module generates the error messages. |
[get] ModuleVersion | Get the version of the WebstampManager module. |
[get] ModuleVersionText | Get the textual version of the WebstampManager module. |
[get/put] Modus | Operation modus to be used. |
[get/put] Password | Get and Set the password for the Swiss Post account. |
[get/put] UserID | Get and Set the user ID (aka customer number) for the Swiss Post account |


  • GetAbortInfo

IWebstampManager::GetAbortInfo method |  |  |
Get the abort information. |  |  | space
C/C++ calling syntax |  |  |
HRESULT GetAbortInfo( | BSTR VARIANT_BOOL | *pbstrAbort, *pbStatus); |
Calling argument description |  |  |
[out] BSTR | *pbstrAbort | Abort information string. |
[out, retval] VARIANT_BOOL | *pbStatus | Return status |
C/C++ return value |  |  |
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE. |  |
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE. |  |
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions. |  |


  • GetFirstOption

IWebstampManager::GetFirstOption method |  |  |
Retrieves the first option based on your search call. |  |  | space
C/C++ calling syntax |  |  |
HRESULT GetFirstOption( | long BSTR VARIANT_BOOL | *plID, *pbstrName, *pbStatus); |
Calling argument description |  |  |
[out] long | *plID | The Swiss Post ID of the product or product type Please note that these IDs can change e.g. if the price of a product is altered |
[out] BSTR | *pbstrName | The name of the product type or product |
[out, retval] VARIANT_BOOL | *pbStatus | Return status |
C/C++ return value |  |  |
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE. |  |
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE. |  |
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions. |  |


  • GetInfoBalance

IWebstampManager::GetInfoBalance method |  |  |
Get the current balance of your Swiss Post account. Note that GetInfoBalance always delivers a balance of 42.45 in Mode=enDemo, since that mode does not use the Internet. |  |  | space
C/C++ calling syntax |  |  |
HRESULT GetInfoBalance( | double VARIANT_BOOL | *pdBalance, *pbStatus); |
Calling argument description |  |  |
[out] double | *pdBalance | The balance of the account is CHF |
[out, retval] VARIANT_BOOL | *pbStatus | Return status |
C/C++ return value |  |  |
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE. |  |
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE. |  |
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions. |  |


  • GetInfoJournal

IWebstampManager::GetInfoJournal method |  |  |
Get a journal of your webstamp activity in a given time interval as a one-time-hash URL Note that SearchOptions generates an error in Mode=enDemo, since that mode does not use the Internet. |  |  | space
C/C++ calling syntax |  |  |
HRESULT GetInfoJournal( | DATE DATE BSTR VARIANT_BOOL | dDateFrom, dDateTo, *pbstrURLFile, *pbStatus); |
Calling argument description |  |  |
[in] DATE | dDateFrom | Begin date of the journal |
[in] DATE | dDateTo | End date of the journal |
[out] BSTR | *pbstrURLFile | One-time-hash URL |
[out, retval] VARIANT_BOOL | *pbStatus | Return status |
C/C++ return value |  |  |
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE. |  |
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE. |  |
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions. |  |


  • GetInfoReceipt

IWebstampManager::GetInfoReceipt method |  |  |
Get a receipt of a previously generated webstamp as PDF file Note that GetInfoReceipt delivers a demo receipt in Mode=enDemo, since that mode does not use the Internet. |  |  | space
C/C++ calling syntax |  |  |
HRESULT GetInfoReceipt( | long BSTR VARIANT_BOOL | lOrderID, *pbstrPDFFile, *pbStatus); |
Calling argument description |  |  |
[in] long | lOrderID | The order id for which the receipt should be generated |
[out] BSTR | *pbstrPDFFile | Absolute path of a PDF file that holds the requested receipt |
[out, retval] VARIANT_BOOL | *pbStatus | Return status |
C/C++ return value |  |  |
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE. |  |
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE. |  |
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions. |  |


  • GetNextOption

IWebstampManager::GetNextOption method |  |  |
Retrieves the next option based on your search call until no more options are available. VARIANT_FALSE is returned under these circumstances. |  |  | space
C/C++ calling syntax |  |  |
HRESULT GetNextOption( | long BSTR VARIANT_BOOL | *plID, *pbstrName, *pbStatus); |
Calling argument description |  |  |
[out] long | *plID | The Swiss Post ID of the product or product type Please note that these IDs can change e.g. if the price of a product is altered |
[out] BSTR | *pbstrName | The name of the product type or product |
[out, retval] VARIANT_BOOL | *pbStatus | Return status |
C/C++ return value |  |  |
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE. |  |
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE. |  |
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions. |  |


  • InfoStamp

IWebstampManager::InfoStamp method |  |  |
Retrieve all needed information about a previously generated stamp given by an order id. One can use this information to reprint a previously generated stamp without using the StornoStamp method. But keep in mind, that the Swiss Post keeping track of already used stamps. Note that the storno container is NOT included in the search. |  |  | space
C/C++ calling syntax |  |  |
HRESULT InfoStamp( | long long LocationType double DATE long long BSTR VARIANT_BOOL | lOrderID, *plProductID, *peLocation, *pdPrice, *pdValidityDate, *plWidth_mm, *plHeight_mm, *pbstrBMPFile, *pbStatus); |
Calling argument description |  |  |
[in] long | lOrderID | The order id of the stamp that should be loaded |
[out] long | *plProductID | The product id of the loaded stamp |
[out] LocationType | *peLocation | The location type of the loaded stamp |
[out] double | *pdPrice | The price of the loaded stamp |
[out] DATE | *pdValidityDate | The date of the loaded stamp until which the stamp is valid |
[out] long | *plWidth_mm | The width in mm of the loaded stamp |
[out] long | *plHeight_mm | The height in mm of the loaded stamp |
[out] BSTR | *pbstrBMPFile | Absolute path of a BMP stamp file that holds the requested electronic stamp |
[out, retval] VARIANT_BOOL | *pbStatus | Return status |
C/C++ return value |  |  |
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE. |  |
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE. |  |
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions. |  |


  • OrderStamp

IWebstampManager::OrderStamp method |  |  |
Order one new electronic stamp defined by the given product id. Use the SearchOptions method to retrieve all possible product ids of a given product type. Before requesting a stamp over the Internet the storno container is searched first (cf. StornoStamp). Note that a test stamp is delivered in enDemo mode dependent only on the given location (productID is not checked) without doing an Internet request! |  |  | space
C/C++ calling syntax |  |  |
HRESULT OrderStamp( | long LocationType long long long BSTR VARIANT_BOOL | lProductID, eLocation, *plOrderID, *plWidth_mm, *plHeight_mm, *pbstrBMPFile, *pbStatus); |
Calling argument description |  |  |
[in] long | lProductID | The product id of the stamp to generate |
[in] LocationType | eLocation | The location type of the stamp to generate |
[out] long | *plOrderID | The order id of the generated stamp |
[out] long | *plWidth_mm | The width in mm of the generated stamp |
[out] long | *plHeight_mm | The height in mm of the generated stamp |
[out] BSTR | *pbstrBMPFile | Absolute path of a BMP stamp file that holds the generated electronic stamp |
[out, retval] VARIANT_BOOL | *pbStatus | Return status |
C/C++ return value |  |  |
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE. |  |
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE. |  |
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions. |  |


  • SearchOptions

IWebstampManager::SearchOptions method
Search for
  • all product types (OptionType=enOptionCatalog, lProductTypeID is ignored)
  • all products of a given product type (OptionType=enOptionProduct, lProductTypeID = id of the product type to use)
The results of the query are loaded by GetFirstOption/GetNextOption
Note that SearchOptions generates an error in Mode=enDemo, since that mode does not use the Internet. 		space
C/C++ calling syntax
HRESULT SearchOptions( OptionType
long
VARIANT_BOOL 		eOptionType,
lProductTypeID,
*pbStatus);
Calling argument description
[in] OptionType | eOptionType | Enumerator of the option type to use in the query
[in] long | lProductTypeID | Product type identification (returned by a call to SearchOptions with OptionType=enOptionCatalog)
[out, retval] VARIANT_BOOL | *pbStatus | Return status
C/C++ return value
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE.
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.


  • StornoStamp

IWebstampManager::StornoStamp method |  |  |
Since the Swiss Post webstamp module does not implement a storno functionality for a generated stamp you must reuse a stamp file e.g. in the case of a paper jam. The storno process therefore moves a previously generated stamp given by the order id into a storno container. If an OrderStamp is done, this storno container is searched first for a suitable stamp before requesting a stamp over the Internet. The validity if a stamp is approximately 1 year. |  |  | space
C/C++ calling syntax |  |  |
HRESULT StornoStamp( | long VARIANT_BOOL | lOrderID, *pbStatus); |
Calling argument description |  |  |
[in] long | lOrderID | The order id of the stamp that should be canceled. SetlOrderID = -1 to cancel all previously generated orders of the current session! |
[out, retval] VARIANT_BOOL | *pbStatus | Return status |
C/C++ return value |  |  |
S_OK | This value is returned if the function call was successful or if the return value of a boolean method signalling a true value. In this case the VARIANT_BOOL is set to VARIANT_TRUE. |  |
S_FALSE | This is the return value of a boolean method signalling a false return value. In this case the VARIANT_BOOL is set to VARIANT_FALSE. |  |
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions. |  |


  • BaseDirectory

IWebstampManager::BaseDirectory property
Get and Set the base directory where the generated webstamps and receipts are stored.

Note that the modules needs read/write privileges for the base directory and all its descendants. A [storno], [stamps] and [receipts] subdirectory is generated under the base directory, and the later 2 directories are further subdivided into year and month subdirectories.
The default base directory is at the location of the DLL.

space
C/C++ calling syntax
[get] HRESULT | BaseDirectory( BSTR *aBSTR);
[put] HRESULT | BaseDirectory( BSTR aBSTR);
space
Calling argument description
[out,retval] BSTR | *aBSTR
[in] BSTR | aBSTR
C/C++ return value
S_OK | This value is returned if the function call was successful.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
Remarks
If SmartPointers are used than the function names and calls are rewritten by Microsoft into the form
  • BSTR *GetBaseDirectory(void);
  • void PutBaseDirectory( BSTR aBSTR);
space


  • EnableLog

IWebstampManager::EnableLog property
Get and Set the log activity for the module.
The default log activity is enYes. 		space
C/C++ calling syntax
[get] HRESULT | EnableLog( YesNoType *aYesNoType);
[put] HRESULT | EnableLog( YesNoType aYesNoType);
space
Calling argument description
[out,retval] YesNoType | *aYesNoType
[in] YesNoType | aYesNoType
C/C++ return value
S_OK | This value is returned if the function call was successful.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
Remarks
If SmartPointers are used than the function names and calls are rewritten by Microsoft into the form
  • YesNoType *GetEnableLog(void);
  • void PutEnableLog( YesNoType aYesNoType);
space


  • Logo

IWebstampManager::Logo property
Get and Set a logo as an absolute filename of a BMP logo to be used for stamps with LocationType=enLocationPostageZone.

This functionality is not yet implemented!!

space
C/C++ calling syntax
[get] HRESULT | Logo( BSTR *aBSTR);
[put] HRESULT | Logo( BSTR aBSTR);
space
Calling argument description
[out,retval] BSTR | *aBSTR
[in] BSTR | aBSTR
C/C++ return value
S_OK | This value is returned if the function call was successful.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
Remarks
If SmartPointers are used than the function names and calls are rewritten by Microsoft into the form
  • BSTR *GetLogo(void);
  • void PutLogo( BSTR aBSTR);
space


  • ModuleLanguage

IWebstampManager::ModuleLanguage property
Language in which the module generates the error messages. | space
C/C++ calling syntax
[get] HRESULT | ModuleLanguage( LanguageType *aLanguageType);
[put] HRESULT | ModuleLanguage( LanguageType aLanguageType);
space
Calling argument description
[out,retval] LanguageType | *aLanguageType
[in] LanguageType | aLanguageType
C/C++ return value
S_OK | This value is returned if the function call was successful.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
Remarks
If SmartPointers are used than the function names and calls are rewritten by Microsoft into the form
  • LanguageType *GetModuleLanguage(void);
  • void PutModuleLanguage( LanguageType aLanguageType);
space


  • ModuleVersion

IWebstampManager::ModuleVersion property
Get the version of the WebstampManager module. | space
C/C++ calling syntax
[get] HRESULT | ModuleVersion( BSTR *aBSTR);
space
Calling argument description
[out, retval] BSTR | *aBSTR
C/C++ return value
S_OK | This value is returned if the function call was successful.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
Remarks
If SmartPointers are used than the function names and calls are rewritten by Microsoft into the form
  • BSTR *GetModuleVersion(void);
space


  • ModuleVersionText

IWebstampManager::ModuleVersionText property
Get the textual version of the WebstampManager module. | space
C/C++ calling syntax
[get] HRESULT | ModuleVersionText( BSTR *aBSTR);
space
Calling argument description
[out, retval] BSTR | *aBSTR
C/C++ return value
S_OK | This value is returned if the function call was successful.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
Remarks
If SmartPointers are used than the function names and calls are rewritten by Microsoft into the form
  • BSTR *GetModuleVersionText(void);
space


  • Modus

IWebstampManager::Modus property
Operation modus to be used.
Note that Modus=enDemo generate an invalid test stamp without using an Internet connection. Modus=enTest generates invalid webstamps for testing the principle functionality using a valid Swiss Post account, whereas Modus=enProduction generates valid webstamps, that are liable to pay costs
The default mode is enProduction. 		space
C/C++ calling syntax
[get] HRESULT | Modus( ModusType *aModusType);
[put] HRESULT | Modus( ModusType aModusType);
space
Calling argument description
[out,retval] ModusType | *aModusType
[in] ModusType | aModusType
C/C++ return value
S_OK | This value is returned if the function call was successful.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
Remarks
If SmartPointers are used than the function names and calls are rewritten by Microsoft into the form
  • ModusType *GetModus(void);
  • void PutModus( ModusType aModusType);
space


  • Password

IWebstampManager::Password property
Get and Set the password for the Swiss Post account. Input the password unscrambled, the module does a MD5 encryption in the request send over the internet. | space
C/C++ calling syntax
[get] HRESULT | Password( BSTR *aBSTR);
[put] HRESULT | Password( BSTR aBSTR);
space
Calling argument description
[out,retval] BSTR | *aBSTR
[in] BSTR | aBSTR
C/C++ return value
S_OK | This value is returned if the function call was successful.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
Remarks
If SmartPointers are used than the function names and calls are rewritten by Microsoft into the form
  • BSTR *GetPassword(void);
  • void PutPassword( BSTR aBSTR);
space


  • UserID

IWebstampManager::UserID property
Get and Set the user ID (aka customer number) for the Swiss Post account | space
C/C++ calling syntax
[get] HRESULT | UserID( BSTR *aBSTR);
[put] HRESULT | UserID( BSTR aBSTR);
space
Calling argument description
[out,retval] BSTR | *aBSTR
[in] BSTR | aBSTR
C/C++ return value
S_OK | This value is returned if the function call was successful.
E_name | This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
Remarks
If SmartPointers are used than the function names and calls are rewritten by Microsoft into the form
  • BSTR *GetUserID(void);
  • void PutUserID( BSTR aBSTR);
space


  • Type definitions

Builtin, composite & enumeration types |  | V4.00/ 9 Oct 2007
The following list shows ans defines all used data types either basic builtin, composite or enumeration types that are used in the interface of the ATL COM module. |  | space
Data types |  | 11 types
[builtin] BSTR | A BSTR, known as basic string or binary string, is a pointer to a wide character string used by Automation data manipulation functions. |
[builtin] DATE | A value denoting a date and time was specified. |
[builtin] double | An 8-byte IEEE real value. |
[builtin] HRESULT | The HRESULT data type is a 32-bit value that is used to describe an error or warning. |
[enumeration] LanguageType | Enumerates all supported languages. |
[enumeration] LocationType | Enumerates all possible locations where the electronic stamp can be placed/printed |
[builtin] long | A 4-byte integer value. |
[enumeration] ModusType | Enumerates the defined modus types. |
[enumeration] OptionType | The OptionType enumeration lists the possible option types for making queries |
[builtin] VARIANT_BOOL | A 16 bit Boolean (True/False) value was specified. |
[enumeration] YesNoType | Boolean enumerator. |


  • Type definitions
  • BSTR

BSTR type |
A BSTR, known as basic string or binary string, is a pointer to a wide character string used by Automation data manipulation functions. BSTRs are wide, double-byte (Unicode) strings on 32-bit Windows platforms. | space


  • Type definitions
  • DATE

DATE type |
A value denoting a date and time was specified. Dates are represented as double-precision numbers, where midnight, January 1, 1900 is 2.0, January 2, 1900 is 3.0, and so on. The value is passed in date. | space


  • Type definitions
  • double

double type |
An 8-byte IEEE real value. | space


  • Type definitions
  • HRESULT

HRESULT type |
The HRESULT data type is a 32-bit value that is used to describe an error or warning. | space


  • Type definitions
  • LanguageType

LanguageType enumeration type |  |
Enumerates all supported languages. |  | space
Set of enumeration values |  | 4 elements
enGerman: 1 | German |
enFrench: 2 | French. |
enItalian: 3 | Italian |
enEnglish: 4 | English |


  • Type definitions
  • LocationType

LocationType enumeration type |  |
Enumerates all possible locations where the electronic stamp can be placed/printed |  | space
Set of enumeration values |  | 2 elements
enLocationPostageZone: 1 | The generated stamp is used in the postage zone |
enLocationAddressZone: 2 | The generated stamp is used in the address zone |


  • Type definitions
  • long

long type |
A 4-byte integer value. | space


  • Type definitions
  • ModusType

ModusType enumeration type |  |
Enumerates the defined modus types. |  | space
Set of enumeration values |  | 3 elements
enProduction: 0 | Production modus - a valid Post account is necessary and the generated stamp is valid (the Post account is charged!) |
enTest: 1 | Test modus - a valid Post account is necessary but the generated stamp is an invalid test stamp (no costs!) |
enDemo: 2 | Demo modus - there is no need for an account as no Internet request is performed (OrderStamp delivers a test stamp)! |


  • Type definitions
  • OptionType

OptionType enumeration type |  |
The OptionType enumeration lists the possible option types for making queries |  | space
Set of enumeration values |  | 2 elements
enOptionProductTypes: 1 | Query for all product types |
enOptionProducts: 2 | Query for all products of a given product type id |


  • Type definitions
  • VARIANT_BOOL

VARIANT_BOOL type |
A 16 bit Boolean (True/False) value was specified. A value of 0xFFFF (all bits 1) indicates True; a value of 0 (all bits 0) indicates False. No other values are valid. | space


  • Type definitions
  • YesNoType

YesNoType enumeration type |  |
Boolean enumerator. |  | space
Set of enumeration values |  | 2 elements
enNo: 0 | No. |
enYes: 1 | Yes. |


 Visual Basic code snippet for generating a stamp file

Private Sub Print_Click()

On Error GoTo Err_Trap

'### Note: if you encounter a namespace problem with a variable declaration you have to
'###       put WEBSTAMPMANAGER400Lib in front of the variable declaration
'###

Dim bStatus As Boolean

Dim today As Date
today = DateTime.Now

'### WebstampManager interface
Dim webstampManager As WEBSTAMPMANAGER400Lib.webstampManager
Set webstampManager = New webstampManager

'### module language for errors
webstampManager.ModuleLanguage = enGerman
'### optionally set modus to enTest
webstampManager.Modus = enTest
'### set customer number and password of the Swiss Post account
webstampManager.UserID = "set_your_customer_number_here"
webstampManager.Password = "set_your_password_here"
'### optionally set a base directory with read/write access
'webstampManager.BaseDirectory = "C:\\STAMPS"

'### get all product types
Dim lProductTypeID, lProductID As Long
Dim strName As String

bStatus = webstampManager.SearchOptions(enOptionProductTypes, lProductTypeID)

bStatus = webstampManager.GetFirstOption(lProductID, strName)
While (webstampManager.GetNextOption(lProductID, strName))
Wend

'### get all products of product type=1 "Brief Inland"
lProductTypeID = 1
bStatus = webstampManager.SearchOptions(enOptionProducts, lProductTypeID)

bStatus = webstampManager.GetFirstOption(lProductID, strName)
While (webstampManager.GetNextOption(lProductID, strName))
Wend

'### get a stamp for product id=217 "A Post Standardbrief" in the address zone
Dim lOrderID As Long
Dim lWidth_mm As Long
Dim lHeight_mm As Long
Dim strStampBMPFile As String
lProductID = 217
bStatus = webstampManager.OrderStamp(lProductID, enLocationAddressZone, lOrderID,  _
                                     lWidth_mm, lHeight_mm, strStampBMPFile)

'### store the returned lOrderID if you need to reference the BMP file again via LoadStamp
'### use the stamp "strStampBMPFile" e.g. in the xmlManager's Print method

'### relase resources
Set webstampManager = Nothing

Exit Sub

Err_Trap:
    MsgBox "Error: " & Err.Description, vbCritical, _
           "Opps! Error" & Str$(Err.Number)
'### relase resources
Set webstampManager = Nothing

End Sub


 General use of the webstampManager ATL COM module

The webstampManager provides all the necessary tools to generate webstamps as BMP files.

After creating an instance of the IWebstampManager interface the userID (IWebstampManager/UserID property), password (IWebstampManager/Password property) are set. Optionally the language (Default=enGerman) and base directory (Default=location of the COM module) properties can be supplied as well.

Next generate the list of available products (A Delivery, B Delivery, etc.) by the sequence if not already known

  • IWebstampManager::SearchOptions(enOptionProductTypes,lProductType)
  • IWebstampManager::GetFirstOption(plID,pbstrName) and IWebstampManager::GetNextOption_method(plID,pbstrName), respectively until FALSE is returned
to get all product types.
By using enOptionProducts as OptionType and choosing a product type ID (e.g. lProductType=1 aka "Briefe Inland") the list of all products per product type is generated.

Finally, call the IWebstampManager::OrderStamp method specifying a product ID and a location where the stamp should be printed (either enLocationPostageZone or enLocationAddressZone). An unique order ID and the full path to the BMP stamp file is returned.

NOTE: The Swiss post does not provide a storno functionality for a previously generated stamp. Therefore store the unique order ID and use this order ID with the IWebstampManager::StornoStamp method to cancel a stamp should there be a paper jam or the like while printing! The next time IWebstampManager::OrderStamp is called the storno section is searched first for a suitable stamp. If there is one then this stamp is used without making a web request.

Furthermore, there are methods to get the current balance of your Swiss Post account (IWebstampManager::GetInfoBalance), get a journal URL of your webstamp activities (IWebstampManager::GetInfoReceipt), and generating a receipt of an ordered stamp (IWebstampManager::GetInfoReceipt), respectively.

To get a staring point with the webstampManager module there is a Visual Basic code snippet provided.


 How to print a stamp onto an invoice/credit request

To print a webstamp onto an invoice or credit request in a xmlManager use
(WEBSTAMP=file_path_of_BMP_file;)
as an object name in the Print method.

In its simplest form e.g. in the MDInvoiceRequestManager code

     BSTR bstrPrintTemplate = "(WEBSTAMP=C:\\stamps\\stamp_1242187_81_1_100_1235887891_74x35.bmp;)";

     MDInvoiceRequestManager::Print(bstrPrintTemplate,...);
to print a webstamp onto the first invoice (onto "TP Rechnung" in the TP case or onto "Patienten-Rechnung" in the TG case).
If a webstamp should be printed on all invoices of a TG case ("Patienten-Rechnung" and "Rückerstattungsbeleg") then produce a comma separated list of BMP stamp files e.g.
(WEBSTAMP=file_path_of_BMP_file1,file_path_of_BMP_file2;)