Skip to content

Commit 2cde00b

Browse files
committed
add date/time in error output
1 parent 0ad0152 commit 2cde00b

6 files changed

+22
-12
lines changed

cpp/dart_mssql/dart_mssql.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ void _connectCommand(Dart_NativeArguments arguments) {
8383
HandleError(Dart_StringToCString(HandleError(Dart_GetNativeArgument(arguments, 2)), &userName));
8484
HandleError(Dart_StringToCString(HandleError(Dart_GetNativeArgument(arguments, 3)), &password));
8585
HandleError(Dart_IntegerToInt64(HandleError(Dart_GetNativeArgument(arguments, 4)), &authType));
86+
dartMssqlLib = HandleError(Dart_LookupLibrary(Dart_NewStringFromCString("package:dart_mssql/src/sql_connection.dart")));
87+
sqlResultClass = HandleError(Dart_GetType(dartMssqlLib, Dart_NewStringFromCString("SqlResult"), 0, NULL));
88+
sqlReturnClass = HandleError(Dart_GetType(dartMssqlLib, Dart_NewStringFromCString("_SqlReturn"), 0, NULL));
8689

8790
Dart_Handle dartSqlReturn = HandleError(Dart_New(sqlReturnClass, Dart_Null(), 0, NULL));
8891
sqlConnect(serverName, databaseName, userName, password, authType, &pSession, &errorCount, &errorMessages);
@@ -108,6 +111,9 @@ void _executeCommand(Dart_NativeArguments arguments) {
108111
HandleError(Dart_IntegerToInt64(HandleError(Dart_GetNativeArgument(arguments, 0)), &handle));
109112
HandleError(Dart_StringToCString(HandleError(Dart_GetNativeArgument(arguments, 1)), &sqlCommand));
110113
Dart_Handle sqlParams = HandleError(Dart_GetNativeArgument(arguments, 2));
114+
dartMssqlLib = HandleError(Dart_LookupLibrary(Dart_NewStringFromCString("package:dart_mssql/src/sql_connection.dart")));
115+
sqlResultClass = HandleError(Dart_GetType(dartMssqlLib, Dart_NewStringFromCString("SqlResult"), 0, NULL));
116+
sqlReturnClass = HandleError(Dart_GetType(dartMssqlLib, Dart_NewStringFromCString("_SqlReturn"), 0, NULL));
111117

112118
pSession = getHandleFromGlobalInterfaceTable((DWORD)handle, &errorCount, &errorMessages);
113119
Dart_Handle dartSqlReturn = HandleError(Dart_New(sqlReturnClass, Dart_Null(), 0, NULL));
@@ -199,10 +205,6 @@ DART_EXPORT Dart_Handle dart_mssql_Init(Dart_Handle library) {
199205
return result;
200206
}
201207

202-
dartMssqlLib = Dart_NewPersistentHandle(HandleError(Dart_LookupLibrary(Dart_NewStringFromCString("package:dart_mssql/src/sql_connection.dart"))));
203-
sqlResultClass = Dart_NewPersistentHandle(HandleError(Dart_GetType(dartMssqlLib, Dart_NewStringFromCString("SqlResult"), 0, NULL)));
204-
sqlReturnClass = Dart_NewPersistentHandle(HandleError(Dart_GetType(dartMssqlLib, Dart_NewStringFromCString("_SqlReturn"), 0, NULL)));
205-
206208
return Dart_Null();
207209
}
208210

cpp/dart_mssql/dart_mssql.vcxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
<SubSystem>Windows</SubSystem>
156156
<GenerateDebugInformation>true</GenerateDebugInformation>
157157
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);F:\DartSDK32\dart-sdk\bin\dart.lib</AdditionalDependencies>
158-
<OutputFile>F:\flutter\polygonus\server\dart_mssql\dart_mssql.dll</OutputFile>
158+
<OutputFile>F:\flutter\polygonus_mobile\server\mobile_aqueduct\dart_mssql.dll</OutputFile>
159159
</Link>
160160
</ItemDefinitionGroup>
161161
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='IsolateTests|Win32'">
@@ -190,7 +190,7 @@
190190
<SubSystem>Windows</SubSystem>
191191
<GenerateDebugInformation>true</GenerateDebugInformation>
192192
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);F:\DartSDK64\dart-sdk\bin\dart.lib</AdditionalDependencies>
193-
<OutputFile>F:\flutter\polygonus\server\dart_mssql\dart_mssql.dll</OutputFile>
193+
<OutputFile>F:\flutter\polygonus_mobile\server\mobile_aqueduct\dart_mssql.dll</OutputFile>
194194
</Link>
195195
</ItemDefinitionGroup>
196196
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='IsolateTests|x64'">

cpp/dart_mssql/dart_mssql.vcxproj.user

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
44
<LocalDebuggerDebuggerType>Mixed</LocalDebuggerDebuggerType>
55
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
6-
<LocalDebuggerCommand>F:\DartSDK32\dart-sdk\bin\dart.exe </LocalDebuggerCommand>
7-
<LocalDebuggerCommandArguments>"--enable-asserts" "example\main.dart" </LocalDebuggerCommandArguments>
8-
<LocalDebuggerWorkingDirectory>f:\flutter\polygonus\server\dart_mssql</LocalDebuggerWorkingDirectory>
6+
<LocalDebuggerCommand>F:\DartSDKDebug\sdk\out\DebugX64\dart.exe</LocalDebuggerCommand>
7+
<LocalDebuggerCommandArguments>"--enable-asserts" "bin\main.dart" "192.168.0.101" "80" "SGEIMM"</LocalDebuggerCommandArguments>
8+
<LocalDebuggerWorkingDirectory>F:\flutter\polygonus_mobile\server\mobile_aqueduct</LocalDebuggerWorkingDirectory>
99
</PropertyGroup>
1010
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='IsolateTests|x64'">
1111
<LocalDebuggerDebuggerType>Mixed</LocalDebuggerDebuggerType>
@@ -17,9 +17,9 @@
1717
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
1818
<LocalDebuggerAttach>false</LocalDebuggerAttach>
1919
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
20-
<LocalDebuggerCommand>F:\DartSDK32\dart-sdk\bin\dart.exe </LocalDebuggerCommand>
21-
<LocalDebuggerCommandArguments>"--enable-asserts" "example\main.dart" </LocalDebuggerCommandArguments>
22-
<LocalDebuggerWorkingDirectory>f:\flutter\polygonus\server\dart_mssql</LocalDebuggerWorkingDirectory>
20+
<LocalDebuggerCommand>F:\DartSDKDebug\sdk\out\DebugIA32\dart.exe</LocalDebuggerCommand>
21+
<LocalDebuggerCommandArguments>"--enable-asserts" "bin\main.dart" "192.168.0.101" "80" "SGEIMM"</LocalDebuggerCommandArguments>
22+
<LocalDebuggerWorkingDirectory>F:\flutter\polygonus_mobile\server\mobile_aqueduct</LocalDebuggerWorkingDirectory>
2323
</PropertyGroup>
2424
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='IsolateTests|Win32'">
2525
<LocalDebuggerAttach>false</LocalDebuggerAttach>

cpp/dart_mssql/dart_mssql_common.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <stdio.h>
22
#include <comutil.h>
33
#include <string>
4+
#include <time.h>
45
#include "stdafx.h"
56
#include "msoledbsql.h"
67
#include "dart_api.h"
@@ -74,6 +75,13 @@ void DumpErrorInfo(IUnknown* pObjectWithError, REFIID IID_InterfaceWithError, in
7475
// Hard-code an American English locale for the example.
7576
DWORD MYLOCALEID = 0x0409;
7677

78+
// printing current date and time (moacir):
79+
time_t t = time(NULL);
80+
char strTime[26];
81+
82+
ctime_s(strTime, sizeof strTime, &t);
83+
fprintf_s(stderr, "Date/Time:\t%s", strTime);
84+
7785
// Only ask for error information if the interface supports
7886
// it.
7987
if (FAILED(pObjectWithError->QueryInterface(IID_ISupportErrorInfo,

dart_mssql_32.dll

26.5 KB
Binary file not shown.

dart_mssql_64.dll

31.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)