-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCustomSolver.cpp
More file actions
executable file
·69 lines (61 loc) · 2.37 KB
/
Copy pathCustomSolver.cpp
File metadata and controls
executable file
·69 lines (61 loc) · 2.37 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
68
69
// Copyright 2010 ESRI
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
//
// See the use restrictions at http://help.arcgis.com/en/sdk/10.0/usageRestrictions.htm
// ===============================================================================================
// Evacuation Solver: DDL entry implementation
// Description: Implementation of DLL Exports.
//
// Copyright (C) 2014 Kaveh Shahabi
// Distributed under the Apache Software License, Version 2.0. (See accompanying file LICENSE.txt)
//
// Author: Kaveh Shahabi
// URL: http://github.com/spatial-computing/CASPER
// ===============================================================================================
#include "stdafx.h"
#include "resource.h"
[importlib("C:\Program Files (x86)\ArcGIS\Desktop10.3\com\esrinetworkanalyst.olb")];
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{F25947D1-9C81-48A6-9BFF-CF9EB158FFD7}",
name = "CustomSolver",
helpstring = "CustomSolver 1.0 Type Library",
resource_name = "IDR_CUSTOMSOLVER") ]
class CustomSolverModule
{
public:
// Override CAtlDllModuleT members
BOOL WINAPI DllMain(DWORD dwReason, LPVOID lpReserved)
{
// Perform actions based on the reason for calling.
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
// Initialize once for each new process.
// Return FALSE to fail DLL load.
// set program start for memory leak detection (DEBUG Mode)
_ASSERTE(_CrtCheckMemory());
// turn the next line on to activate heap checking during debug
/// _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_EVERY_1024_DF);
break;
case DLL_THREAD_ATTACH:
// Do thread-specific initialization.
break;
case DLL_THREAD_DETACH:
// Do thread-specific cleanup.
break;
case DLL_PROCESS_DETACH:
// Perform any necessary cleanup.
_ASSERT_EXPR(_CrtDumpMemoryLeaks() == FALSE, L"EvcSolver memory leak detected");
_CrtSetDbgFlag(_CRTDBG_CHECK_DEFAULT_DF);
_ASSERTE(_CrtCheckMemory());
break;
}
return TRUE; // Successful DLL_PROCESS_ATTACH.
}
};