This is an example program how to call the SFDB_WKNDate API More details about this example.
#include <windows.h>
#include <iostream>
#include <string>
#include "SFLOG.h"
#include "SFDBM.h"
bool dbm_example_init(void);
void dbm_example_shutdown(void);
int main(){
if(!dbm_example_init()){
std::wcout << L" ERROR - Failed to initialize the sdk. Exit!" << std::endl;
return -1;
}
long dt = 41030;
std::wstring szHolidays;
WORD wkndNo = 1;
WORD wkdOption = 1;
WORD direction = 1;
long lNextWknd = 0;
int nRetCode =
SFDB_WKNDate(dt, NULL, NULL, 0, wkndNo, wkdOption, direction, &lNextWknd);
std::wcout << L" SUCCESS - SFDB_WKNDate for next weekend: " << lNextWknd << std::endl;
WORD wDur=0;
nRetCode =
SFDB_WKNDur (lNextWknd, NULL, NULL, 0, wkndNo, &wDur);
std::wcout << L" SUCCESS - the duration SFDB_WKNDur for a given weekend: " << wDur << std::endl;
}
}
direction = 2;
long lPrevWknd = 0;
nRetCode =
SFDB_WKNDate(dt, NULL, NULL, 0, wkndNo, wkdOption, direction, &lPrevWknd);
std::wcout << L" SUCCESS - SFDB_WKNDate for last weekend: " << lPrevWknd << std::endl;
}
dbm_example_shutdown();
return 0;
}
int __stdcall SFDB_WKNDur(LONG argDate, LPCTSTR holidays, LPLONG zDates, size_t nSize, WORD nWkndNo, LPWORD retVal)
Calculate the duration in calendar days of the long weekend that a given date falls on.
Definition weekend.cpp:464
int __stdcall SFDB_WKNDate(LONG argDate, LPCTSTR holidays, LPLONG zDates, size_t nSize, WORD nWkndNo, WORD argLWkndOption, WORD argDirection, LPLONG retVal)
Calculate the serial date number for the first day of the next weekend (or the last day of the last w...
Definition weekend.cpp:575