-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
68 lines (54 loc) · 1.65 KB
/
main.cpp
File metadata and controls
68 lines (54 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "stdafx.h"
#include "Fault.h"
#include "TestRemoteUdp.h"
#include "TestRemotePipe.h"
#include "TestSysData.h"
#include "TestRemoteUdpAsync.h"
#ifdef RAPID_JSON
#include "TestRemoteUdpJson.h"
#endif
#include "UdpDelegateRecv.h"
#include "UdpDelegateSend.h"
#include "PipeDelegateRecv.h"
#include "PipeDelegateSend.h"
#include <iostream>
// main.cpp
// @see https://www.codeproject.com/Articles/5262271/Remote-Procedure-Calls-using-Cplusplus-Delegates
// David Lafreniere, Mar 2020.
//
// @see https://www.codeproject.com/Articles/1160934/Asynchronous-Multicast-Delegates-in-Cplusplus
// David Lafreniere, Dec 2016.
//
// Executes Windows examples.
using namespace std;
extern void DelegateUnitTests();
//------------------------------------------------------------------------------
// main
//------------------------------------------------------------------------------
int main(void)
{
BOOL result = AfxWinInit(GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0);
ASSERT_TRUE(result == TRUE);
result = AfxSocketInit(NULL);
ASSERT_TRUE(result == TRUE);
UdpDelegateRecv::GetInstance().Initialize();
UdpDelegateSend::GetInstance().Initialize();
PipeDelegateRecv::GetInstance().Initialize();
PipeDelegateSend::GetInstance().Initialize();
// Run a simple test
TestRemoteUdp();
// Run a named pipe test
TestRemotePipe();
// See RapidJSON_Readme.txt
#ifdef RAPID_JSON
// Run a JSON test
TestRemoteUdpJson();
#endif
// Run an async test
TestRemoteUdpAsync();
// Run a test using SysData
TestSysData();
// Run all unit tests (uncomment to run unit tests)
//DelegateUnitTests();
return 0;
}