@@ -58,6 +58,7 @@ template <typename T> T Execute(std::function<T()> func, wchar_t* err, T default
58
58
catch (Exception^ e)
59
59
{
60
60
convertSystemString (err, e->Message );
61
+ MtAdapter::GetInstance ()->LogError (e->Message );
61
62
}
62
63
return result;
63
64
}
@@ -220,67 +221,67 @@ _DLLAPI int _stdcall sendErrorResponse(int expertHandle, int code, wchar_t* mess
220
221
221
222
// ----------- get values -------------------------------
222
223
223
- _DLLAPI int _stdcall getCommandType (int expertHandle, int * res, wchar_t * err)
224
+ _DLLAPI int _stdcall getCommandType (int expertHandle, int & res, wchar_t * err)
224
225
{
225
- return Execute<int >([&expertHandle, res]() {
226
- * res = MtAdapter::GetInstance ()->GetCommandType (expertHandle);
226
+ return Execute<int >([&expertHandle, & res]() {
227
+ res = MtAdapter::GetInstance ()->GetCommandType (expertHandle);
227
228
return 1 ;
228
229
}, err, 0 );
229
230
}
230
231
231
- _DLLAPI int _stdcall getIntValue (int expertHandle, int paramIndex, int * res, wchar_t * err)
232
+ _DLLAPI int _stdcall getIntValue (int expertHandle, int paramIndex, int & res, wchar_t * err)
232
233
{
233
- return Execute<int >([&expertHandle, ¶mIndex, res]() {
234
- * res = ( int ) MtAdapter::GetInstance ()->GetCommandParameter (expertHandle, paramIndex);
234
+ return Execute<int >([&expertHandle, ¶mIndex, & res]() {
235
+ res = MtAdapter::GetInstance ()->GetCommandParameter < int > (expertHandle, paramIndex);
235
236
return 1 ;
236
237
}, err, 0 );
237
238
}
238
239
239
- _DLLAPI int _stdcall getDoubleValue (int expertHandle, int paramIndex, double * res, wchar_t * err)
240
+ _DLLAPI int _stdcall getDoubleValue (int expertHandle, int paramIndex, double & res, wchar_t * err)
240
241
{
241
- return Execute<int >([&expertHandle, ¶mIndex, res]() {
242
- * res = ( double ) MtAdapter::GetInstance ()->GetCommandParameter (expertHandle, paramIndex);
242
+ return Execute<int >([&expertHandle, ¶mIndex, & res]() {
243
+ res = MtAdapter::GetInstance ()->GetCommandParameter < double > (expertHandle, paramIndex);
243
244
return 1 ;
244
245
}, err, 0 );
245
246
}
246
247
247
248
_DLLAPI int _stdcall getStringValue (int expertHandle, int paramIndex, wchar_t * res, wchar_t * err)
248
249
{
249
250
return Execute<int >([&expertHandle, ¶mIndex, res]() {
250
- convertSystemString (res, (String^) MtAdapter::GetInstance ()->GetCommandParameter (expertHandle, paramIndex));
251
+ convertSystemString (res, MtAdapter::GetInstance ()->GetCommandParameter <String^> (expertHandle, paramIndex));
251
252
return 1 ;
252
253
}, err, 0 );
253
254
}
254
255
255
- _DLLAPI int _stdcall getULongValue (int expertHandle, int paramIndex, unsigned __int64* res, wchar_t * err)
256
+ _DLLAPI int _stdcall getULongValue (int expertHandle, int paramIndex, unsigned __int64& res, wchar_t * err)
256
257
{
257
- return Execute<int >([&expertHandle, ¶mIndex, res]() {
258
- * res = ( unsigned __int64) MtAdapter::GetInstance ()->GetCommandParameter (expertHandle, paramIndex);
258
+ return Execute<int >([&expertHandle, ¶mIndex, & res]() {
259
+ res = MtAdapter::GetInstance ()->GetCommandParameter < unsigned __int64> (expertHandle, paramIndex);
259
260
return 1 ;
260
261
}, err, 0 );
261
262
}
262
263
263
- _DLLAPI int _stdcall getLongValue (int expertHandle, int paramIndex, __int64* res, wchar_t * err)
264
+ _DLLAPI int _stdcall getLongValue (int expertHandle, int paramIndex, __int64& res, wchar_t * err)
264
265
{
265
- return Execute<int >([&expertHandle, ¶mIndex, res]() {
266
- * res = (__int64) MtAdapter::GetInstance ()->GetCommandParameter (expertHandle, paramIndex);
266
+ return Execute<int >([&expertHandle, ¶mIndex, & res]() {
267
+ res = MtAdapter::GetInstance ()->GetCommandParameter <__int64> (expertHandle, paramIndex);
267
268
return 1 ;
268
269
}, err, 0 );
269
270
}
270
271
271
- _DLLAPI int _stdcall getBooleanValue (int expertHandle, int paramIndex, int * res, wchar_t * err)
272
+ _DLLAPI int _stdcall getBooleanValue (int expertHandle, int paramIndex, int & res, wchar_t * err)
272
273
{
273
- return Execute<int >([&expertHandle, ¶mIndex, res]() {
274
- bool val = ( bool ) MtAdapter::GetInstance ()->GetCommandParameter (expertHandle, paramIndex);
275
- * res = val == true ? 1 : 0 ;
274
+ return Execute<int >([&expertHandle, ¶mIndex, & res]() {
275
+ bool val = MtAdapter::GetInstance ()->GetCommandParameter < bool > (expertHandle, paramIndex);
276
+ res = val == true ? 1 : 0 ;
276
277
return 1 ;
277
278
}, err, 0 );
278
279
}
279
280
280
- _DLLAPI int _stdcall getUIntValue (int expertHandle, int paramIndex, unsigned int * res, wchar_t * err)
281
+ _DLLAPI int _stdcall getUIntValue (int expertHandle, int paramIndex, unsigned int & res, wchar_t * err)
281
282
{
282
- return Execute<int >([&expertHandle, ¶mIndex, res]() {
283
- * res = ( unsigned int ) MtAdapter::GetInstance ()->GetCommandParameter (expertHandle, paramIndex);
283
+ return Execute<int >([&expertHandle, ¶mIndex, & res]() {
284
+ res = MtAdapter::GetInstance ()->GetCommandParameter < unsigned int > (expertHandle, paramIndex);
284
285
return 1 ;
285
286
}, err, 0 );
286
287
}
0 commit comments