From 72d11b06f6299b1043f3a417d1f123ddcfe1a873 Mon Sep 17 00:00:00 2001 From: mtollari Date: Thu, 2 Nov 2017 14:08:41 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2012.?= =?UTF-8?q?0=20no-patch=20Files=20correlati=20=20=20=20=20:=20Commento=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20:=20Reso=20il=20codice=20espor?= =?UTF-8?q?tabile=20per=20.dll,=20in=20xvturl=20=C3=A8=20stata=20creata=20?= =?UTF-8?q?una=20funzione=20dummy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/branches/R_10_00@24175 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/xvtdb/xvtdb.cpp | 2 +- src/xvtdb/xvtdb.h | 22 ++++++++++++++++------ src/xvturl/xvturl.cpp | 7 ++++++- src/xvturl/xvturl.h | 9 +++++++++ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/xvtdb/xvtdb.cpp b/src/xvtdb/xvtdb.cpp index 6486dfd78..8d796f0e8 100644 --- a/src/xvtdb/xvtdb.cpp +++ b/src/xvtdb/xvtdb.cpp @@ -497,7 +497,7 @@ const char* TXvt_recordset::getDate(const char * field) try { SADateTime app = _RCS(_recset)->Field(field).asDateTime(); - char date[10]; + static char date[10]; sprintf_s(date, (size_t)10, "%d-%d-%d", app.GetDay(), app.GetMonth(), app.GetYear()); return date; } diff --git a/src/xvtdb/xvtdb.h b/src/xvtdb/xvtdb.h index b881a7ab9..fc75519e6 100644 --- a/src/xvtdb/xvtdb.h +++ b/src/xvtdb/xvtdb.h @@ -1,6 +1,12 @@ #pragma once + +#ifndef __XVTDB_H +#define __XVTDB_H + #include +#define DBDLL __declspec(dllexport) + #ifndef NOERR #define NOERR 0 #endif @@ -8,7 +14,7 @@ #define NOT_INITIALIZED -86552 #define ERROR_FREEZED -883 -enum TT_driver +DBDLL enum TT_driver { //! DBMS client is not specified TSDB_undefined, @@ -38,7 +44,7 @@ enum TT_driver TSDB_SQLAnywhere }; -enum isoLvl { unknown = -1, uncommitted, committed, rr, serializable }; +DBDLL enum isoLvl { unknown = -1, uncommitted, committed, rr, serializable }; #define P_CONN_VOID void * #define P_COMM_VOID void * @@ -46,7 +52,7 @@ enum isoLvl { unknown = -1, uncommitted, committed, rr, serializable }; /* Esempio parametri da passare con MSSQL: * db = SERVER@DATABASE (NBKDELLI7TOLLAR\MSSQLSERVER14@project_vahlalla) */ -int xvt_create_connection(P_CONN_VOID con, const char* db, const char* user, const char* pass, TT_driver tipoDb); +DBDLL int xvt_create_connection(P_CONN_VOID con, const char* db, const char* user, const char* pass, TT_driver tipoDb); /****************************************************************************** @@ -54,7 +60,7 @@ int xvt_create_connection(P_CONN_VOID con, const char* db, const char* user, con * Wrapper base di SACommand e SAConnection, classe per l'esecuzione di query * * permette una connessione a vari DB tramite molteplici drivers * ******************************************************************************/ -class TXvt_recordset +class DBDLL TXvt_recordset { protected: /**< Recordset */ @@ -62,7 +68,9 @@ protected: /**< Oggetto della connessione */ P_COMM_VOID _con; /**< Ultima stringa con codice di errore ricevuto */ - std::string _stringError; + // Con la trasformazione in DLL questa variabile da il warning C4251, teoricamente si può evitare il workaround perchè la variabile _ITERATOR_DEBUG_LEVEL è uguale su tutti i nostri progetti + // link: https://stackoverflow.com/questions/8976617/when-exporting-stl-stdbasic-string-template-from-dll-i-get-a-lnk2005-error + std::string _stringError; /**< Ultimo codice di errore ricevuto */ long _codeError; /**< Numero record corrente */ @@ -195,4 +203,6 @@ public: /**< Scongela il cursore */ void defrost() { _freezed = false; } -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/src/xvturl/xvturl.cpp b/src/xvturl/xvturl.cpp index 68003d8be..616db3712 100644 --- a/src/xvturl/xvturl.cpp +++ b/src/xvturl/xvturl.cpp @@ -1,2 +1,7 @@ #include "xvturl.h" -#include \ No newline at end of file +#include + +void functionTest() +{ + bool tolla = true; +} \ No newline at end of file diff --git a/src/xvturl/xvturl.h b/src/xvturl/xvturl.h index d5172a6e3..b82a794ee 100644 --- a/src/xvturl/xvturl.h +++ b/src/xvturl/xvturl.h @@ -1,3 +1,12 @@ #pragma once + +#ifndef __XVTURL_H +#define __XVTURL_H + +#define URLDLL __declspec(dllexport) + #include +URLDLL void functionTest(); + +#endif \ No newline at end of file