718c41634f
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试 2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程 3.重整权利声明文件,重整代码工程,确保最小化侵权风险 Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
59 lines
1.7 KiB
C++
59 lines
1.7 KiB
C++
//////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// dllmain.cpp
|
|
//
|
|
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
|
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
|
// PARTICULAR PURPOSE.
|
|
//
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
#include <initguid.h>
|
|
#include "OcvTransform.h"
|
|
|
|
using namespace Microsoft::WRL;
|
|
|
|
namespace Microsoft { namespace Samples {
|
|
ActivatableClass(OcvImageManipulations);
|
|
}}
|
|
|
|
BOOL WINAPI DllMain( _In_ HINSTANCE hInstance, _In_ DWORD dwReason, _In_opt_ LPVOID lpReserved )
|
|
{
|
|
if( DLL_PROCESS_ATTACH == dwReason )
|
|
{
|
|
//
|
|
// Don't need per-thread callbacks
|
|
//
|
|
DisableThreadLibraryCalls( hInstance );
|
|
|
|
Module<InProc>::GetModule().Create();
|
|
}
|
|
else if( DLL_PROCESS_DETACH == dwReason )
|
|
{
|
|
Module<InProc>::GetModule().Terminate();
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
HRESULT WINAPI DllGetActivationFactory( _In_ HSTRING activatibleClassId, _Outptr_ IActivationFactory** factory )
|
|
{
|
|
auto &module = Microsoft::WRL::Module< Microsoft::WRL::InProc >::GetModule();
|
|
return module.GetActivationFactory( activatibleClassId, factory );
|
|
}
|
|
|
|
HRESULT WINAPI DllCanUnloadNow()
|
|
{
|
|
auto &module = Microsoft::WRL::Module<Microsoft::WRL::InProc>::GetModule();
|
|
return (module.Terminate()) ? S_OK : S_FALSE;
|
|
}
|
|
|
|
STDAPI DllGetClassObject( _In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ LPVOID FAR* ppv )
|
|
{
|
|
auto &module = Microsoft::WRL::Module<Microsoft::WRL::InProc>::GetModule();
|
|
return module.GetClassObject( rclsid, riid, ppv );
|
|
}
|