Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: [test] Add gtest sample #97

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#include "stdafx.h"
#include "Sazabi.h"

#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int MY_WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
int nReturnCode = -1;
CWinThread* pThread = AfxGetThread();
CWinApp* pApp = AfxGetApp();
if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
{
AfxWinTerm();
return -1;
}

if (pApp != NULL)
{
if (!pApp->InitApplication())
{
AfxWinTerm();
return -1;
}
}

if (!pThread->InitInstance())
{
if (pThread->m_pMainWnd)
{
pThread->m_pMainWnd->DestroyWindow();
}
nReturnCode = pThread->ExitInstance();
AfxWinTerm();
return nReturnCode;
}

nReturnCode = pThread->Run();
AfxWinTerm();
return nReturnCode;
}


int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{

#ifdef _DEBUG
::_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF);
#endif
HMODULE kernel32 = GetModuleHandleA("KERNEL32");
if (kernel32)
{
typedef BOOL(WINAPI * Proc_pfnSetDllDirectoryW)(LPCWSTR);
Proc_pfnSetDllDirectoryW pfnSetDllDirectoryW = (Proc_pfnSetDllDirectoryW)GetProcAddress(kernel32, "SetDllDirectoryW");
if (pfnSetDllDirectoryW)
{
pfnSetDllDirectoryW(L"");
}
typedef BOOL(WINAPI * Proc_pfnSetSearchPathMode)(DWORD);
Proc_pfnSetSearchPathMode pfnSetSearchPathMode = (Proc_pfnSetSearchPathMode)GetProcAddress(kernel32, "SetSearchPathMode");
if (pfnSetSearchPathMode)
{
const DWORD dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE = 1;
const DWORD dwBASE_SEARCH_PATH_PERMANENT = 0x8000;
pfnSetSearchPathMode(dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | dwBASE_SEARCH_PATH_PERMANENT);
}
}
setlocale(LC_ALL, "Japanese");

int nRet = 0;
CString strCommandLineData;
strCommandLineData = ::GetCommandLine();
if (strCommandLineData.Find(_T("--type=")) > 0)
{
#if CHROME_VERSION_MAJOR < 112
CefEnableHighDPISupport();
#endif
CefMainArgs mainargs(hInstance);
void* sandbox_info = NULL;
if (strCommandLineData.Find(_T("--type=renderer")) > 0)
{
CefRefPtr<CefApp> app;
app = new AppRenderer();
int exitCode = CefExecuteProcess(mainargs, app.get(), sandbox_info);
if (exitCode >= 0)
{
return exitCode;
}
}
int exit_code = CefExecuteProcess(mainargs, nullptr, sandbox_info);
if (exit_code >= 0)
{
return exit_code;
}
}
nRet = MY_WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
return nRet;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
94 changes: 0 additions & 94 deletions Sazabi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5065,97 +5065,3 @@ void CAboutDlg::OnBnClickedCefVersion()
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int MY_WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
int nReturnCode = -1;
CWinThread* pThread = AfxGetThread();
CWinApp* pApp = AfxGetApp();
if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
{
AfxWinTerm();
return -1;
}

if (pApp != NULL)
{
if (!pApp->InitApplication())
{
AfxWinTerm();
return -1;
}
}

if (!pThread->InitInstance())
{
if (pThread->m_pMainWnd)
{
pThread->m_pMainWnd->DestroyWindow();
}
nReturnCode = pThread->ExitInstance();
AfxWinTerm();
return nReturnCode;
}

nReturnCode = pThread->Run();
AfxWinTerm();
return nReturnCode;
}

int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{

#ifdef _DEBUG
::_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF);
#endif
HMODULE kernel32 = GetModuleHandleA("KERNEL32");
if (kernel32)
{
typedef BOOL(WINAPI * Proc_pfnSetDllDirectoryW)(LPCWSTR);
Proc_pfnSetDllDirectoryW pfnSetDllDirectoryW = (Proc_pfnSetDllDirectoryW)GetProcAddress(kernel32, "SetDllDirectoryW");
if (pfnSetDllDirectoryW)
{
pfnSetDllDirectoryW(L"");
}
typedef BOOL(WINAPI * Proc_pfnSetSearchPathMode)(DWORD);
Proc_pfnSetSearchPathMode pfnSetSearchPathMode = (Proc_pfnSetSearchPathMode)GetProcAddress(kernel32, "SetSearchPathMode");
if (pfnSetSearchPathMode)
{
const DWORD dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE = 1;
const DWORD dwBASE_SEARCH_PATH_PERMANENT = 0x8000;
pfnSetSearchPathMode(dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | dwBASE_SEARCH_PATH_PERMANENT);
}
}
setlocale(LC_ALL, "Japanese");

int nRet = 0;
CString strCommandLineData;
strCommandLineData = ::GetCommandLine();
if (strCommandLineData.Find(_T("--type=")) > 0)
{
#if CHROME_VERSION_MAJOR < 112
CefEnableHighDPISupport();
#endif
CefMainArgs mainargs(hInstance);
void* sandbox_info = NULL;
if (strCommandLineData.Find(_T("--type=renderer")) > 0)
{
CefRefPtr<CefApp> app;
app = new AppRenderer();
int exitCode = CefExecuteProcess(mainargs, app.get(), sandbox_info);
if (exitCode >= 0)
{
return exitCode;
}
}
int exit_code = CefExecuteProcess(mainargs, nullptr, sandbox_info);
if (exit_code >= 0)
{
return exit_code;
}
}
nRet = MY_WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
return nRet;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 changes: 1 addition & 1 deletion Sazabi.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ BEGIN
IDS_STRING_CEF_LOCALE "en"
IDS_STRING_CEF_ACCEPT_LANGUAGE_LIST "en-US"
IDS_STRING_PROPRIETARY_CODEC_LICENSES
"\n\nAVC\nTHIS PRODUCT IS LICENSED UNDER THE\nAVC PATENT PORTFOLIO LICENSE FOR THE PERSONAL USE OF A\nCONSUMER OR OTHER USES IN WHICH IT DOES NOT RECEIVE\nREMUNERATION TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE\nAVC STANDARD (�AVC VIDEO�) AND/OR (ii) DECODE AVC VIDEO\nTHAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL\nACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER\nLICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS GRANTED OR\nSHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL\nINFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE\nHTTP://WWW.MPEGLA.COM"
"\n\nAVC\nTHIS PRODUCT IS LICENSED UNDER THE\nAVC PATENT PORTFOLIO LICENSE FOR THE PERSONAL USE OF A\nCONSUMER OR OTHER USES IN WHICH IT DOES NOT RECEIVE\nREMUNERATION TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE\nAVC STANDARD (�AVC VIDEO�E AND/OR (ii) DECODE AVC VIDEO\nTHAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL\nACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER\nLICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS GRANTED OR\nSHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL\nINFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE\nHTTP://WWW.MPEGLA.COM"
END

STRINGTABLE
Expand Down
30 changes: 30 additions & 0 deletions Sazabi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,50 @@ VisualStudioVersion = 16.0.31605.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sazabi", "Sazabi.vcxproj", "{83410426-0B15-352C-4BC5-CCD2A7EF1930}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SazabiSpec", "test\SazabiSpec\SazabiSpec.vcxproj", "{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
D64_CSG|Win32 = D64_CSG|Win32
D64_CSG|x64 = D64_CSG|x64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
R64_CSG|Win32 = R64_CSG|Win32
R64_CSG|x64 = R64_CSG|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.D64_CSG|Win32.ActiveCfg = D64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.D64_CSG|Win32.Build.0 = D64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.D64_CSG|x64.ActiveCfg = D64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|Win32.ActiveCfg = D64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|Win32.Build.0 = D64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|x64.ActiveCfg = R64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|x64.Build.0 = R64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.R64_CSG|Win32.ActiveCfg = R64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.R64_CSG|Win32.Build.0 = R64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.R64_CSG|x64.ActiveCfg = R64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|Win32.ActiveCfg = R64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|Win32.Build.0 = R64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.ActiveCfg = R64_CSG|Win32
{83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.Build.0 = R64_CSG|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.ActiveCfg = Debug|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.Build.0 = Debug|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.ActiveCfg = Debug|x64
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.Build.0 = Debug|x64
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|Win32.ActiveCfg = Debug|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|Win32.Build.0 = Debug|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.ActiveCfg = Release|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.Build.0 = Release|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|Win32.ActiveCfg = Release|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|Win32.Build.0 = Release|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|x64.ActiveCfg = Release|x64
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|x64.Build.0 = Release|x64
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|Win32.ActiveCfg = Release|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|Win32.Build.0 = Release|Win32
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|x64.ActiveCfg = Release|x64
{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions Sazabi.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
<ClCompile Include="DlgDomainDetail.cpp" />
<ClCompile Include="DlgSetting.cpp" />
<ClCompile Include="FullScreenTitleBar.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="MainFrm.cpp" />
<ClCompile Include="MyComboBoxEx.cpp" />
<ClCompile Include="Sazabi.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions Sazabi.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
<ClCompile Include="DlgCertification.cpp">
<Filter>DLG</Filter>
</ClCompile>
<ClCompile Include="Main.cpp">
<Filter>SB</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Resource.h" />
Expand Down
Loading