Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memorypool", "memorypool\memorypool.vcxproj", "{E36BC5DE-60A1-4A78-90EA-F3BFEF89F9A8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlite", "nlite\nlite.vcxproj", "{EB0B5264-9BB4-4EE3-B196-A0472DCB32A8}"
+ ProjectSection(ProjectDependencies) = postProject
+ {5150C843-E70B-4696-8F08-11B900B7F91F} = {5150C843-E70B-4696-8F08-11B900B7F91F}
+ EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlite_stub", "nlite_stub\nlite_stub.vcxproj", "{5150C843-E70B-4696-8F08-11B900B7F91F}"
EndProject
const nlite::CApplicationInfo* appInfo = NULL;
-
-
+static WSAData wsaData; //winsockdata
+static HINTERNET hInternet = NULL;
static BOOL InitializeNlite(); //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8f\89\8aú\89»
static VOID FinalizeNlite(); //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8fI\97¹\8f\88\97\9d
nRet = theLoop.Run();
- vcassert(_heapchk() == -2,TEXT("\83q\81[\83v\83G\83\89\81[\82Å\82·"));
+ vcassert(_heapchk() == _HEAPOK,TEXT("\83q\81[\83v\83G\83\89\81[\82Å\82·"));
_Module.RemoveMessageLoop();
} catch(Exception e){
FinalizeNlite();
_Module.Term();
+
return nRet;
}
try{
appInfo = &CApplicationInfo::getInstance();
-
+ INT_PTR err;
+ INT_PTR count = 0;
+
+ //WSAData\82ð\8f\89\8aú\89»
+ while((err = WSAStartup(MAKEWORD(2,0),&wsaData)) == WSASYSNOTREADY){
+
+ count++;
+ if(count >= 5)break;
+ Sleep(500);
+
+
+
+ }
+
+ if(err != ERROR_SUCCESS){
+
+ throw AppInitException();
+ }
+
+ const CApplicationInfo &appInfo = CApplicationInfo::getInstance();
+ tstring userAgent;
+ userAgent.reserve(256);
+ userAgent = appInfo.getProcuctName();
+ userAgent += TEXT("/");
+ userAgent += appInfo.getProductVersion();
+
+
+ hInternet = WinHttpOpen(userAgent.c_str(),WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,(LPCWSTR)WINHTTP_NO_PROXY_NAME,(LPCWSTR)WINHTTP_NO_PROXY_BYPASS,0);
+
+ if(hInternet == NULL){
+
+ throw AppInitException();
+
+ }
+
+ InitializeNLIB(hInternet);
}catch (AppInitException e){
VOID FinalizeNlite(){
-
+ FinalizeNLIB();
+ WinHttpCloseHandle(hInternet);
+ WSACleanup();
return;
}
\ No newline at end of file
<ClInclude Include="nlite_listviewex.h" />
<ClInclude Include="nlite_mailframe.h" />
<ClInclude Include="nlite_appinfo.h" />
+ <ClInclude Include="nlite_nlib.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
}
-
+ _stprintf(subBlock,TEXT("\\StringFileInfo\\%04x%04x\\ProductName"),lpTranslate->wLanguage,lpTranslate->wCodePage);
+
+ if(VerQueryValue(pBlock,subBlock,(LPVOID *)&pProductName,&ulen) == FALSE){
+
+ throw err;
+
+ }
} catch (const AppInitException& e){
LPTSTR pProductVersion; //\83o\81[\83W\83\87\83\93\8fî\95ñ
LPTSTR pOriginalFileName; //\83I\83\8a\83W\83i\83\8b\83t\83@\83C\83\8b\96¼
LPTSTR pLegalCopyright; //\92\98\8dì\8c
+ LPTSTR pProductName; //\90»\95i\96¼
private:
///
///\83R\83\93\83c\83g\83\89\83N\83^
}
+ LPCTSTR getProcuctName() const{
+
+ return pProductName;
+ }
+
VOID show() const {
tstring szApp;
bspReadFlag(TRUE),
userCommentReadFlag(TRUE),
teropReadFlag(TRUE)
-
-
{}
};
numberNameFlag(FALSE),
autoColorRegisterFlag(FALSE),
activeCountTimeFlag(TRUE)
- {
-
- }
+ {}
};
#include <nlib_define.h>
#include <vcmpool.h>
#include "resource.h"
+
+
+#include "nlite_exception.h"
+#include "nlite_nlib.h"
#include "nlite_define.h"
#include "nlite_common.h"
-
#include "nlite_listviewex.h"
#include "nlite_commentview.h"
-//#include "nlite_controlPaine.h"
-
-#include "nlite_exception.h"
#include "nlite_appinfo.h"
#include "nlite.h"
#include "nlite_mailframe.h"
#pragma comment(lib, "memorypool.lib")
-#pragma comment(lib,"nlite_stub.lib")
\ No newline at end of file
+
+#ifndef NDEBUG
+
+#pragma comment(lib,"nlite_stub.lib")
+
+#else
+
+#endif
\ No newline at end of file
const static LPCTSTR NLITE_MAINWINDOW = TEXT("nlite");
+
class CLiveUserData {
public:
};
- class CNicoVideoAuth{
-
- private:
- NicoVideoAuth_P nicoVideoAuth;
-
-
- public:
- CNicoVideoAuth()
- :nicoVideoAuth(NicoVideoAuth_new()){}
-
- ~CNicoVideoAuth(){
-
- NicoVideoAuth_delete(&nicoVideoAuth);
- }
-
- VOID SetBrowserType(BROWSERTYPE bt){
- NLIB_RESULT rslt;
-
- rslt = NicoVideoAuth_getNicoVideoAuth(nicoVideoAuth,bt);
- if(rslt != NLIB_ERR_OK){
-
- throw NLIBException(rslt);
- }
-
- }
-
- NicoVideoAuth_P GetAuth(){
-
- return this->nicoVideoAuth;
- }
-
- };
class CNicoLiveStream{
--- /dev/null
+#pragma once
+
+namespace nlite{
+
+
+ class CNicoVideoAuth{
+
+ private:
+ NicoVideoAuth_P nicoVideoAuth;
+
+
+ public:
+ CNicoVideoAuth()
+ :nicoVideoAuth(NicoVideoAuth_new()){}
+
+ ~CNicoVideoAuth(){
+
+ NicoVideoAuth_delete(&nicoVideoAuth);
+ }
+
+ VOID SetBrowserType(BROWSERTYPE bt){
+ NLIB_RESULT rslt;
+
+ rslt = NicoVideoAuth_getNicoVideoAuth(nicoVideoAuth,bt);
+ if(rslt != NLIB_ERR_OK){
+
+ throw NLIBException(rslt);
+ }
+
+ }
+
+ NicoVideoAuth_P GetAuth(){
+
+ return this->nicoVideoAuth;
+ }
+
+ };
+}
\ No newline at end of file
// Windows \83w\83b\83_\81[ \83t\83@\83C\83\8b:
#include <windows.h>
#include <WindowsX.h>
+#include <WinSock2.h>
+#include <winhttp.h>
// C \83\89\83\93\83^\83C\83\80 \83w\83b\83_\81[ \83t\83@\83C\83\8b
#include <stdlib.h>
#pragma comment(lib,"shell32.lib")
#pragma comment(lib,"atlthunk.lib")
-#pragma comment(lib,"version.lib")
\ No newline at end of file
+#pragma comment(lib,"version.lib")
+#pragma comment(lib,"WinHttp.lib")
+#pragma comment(lib,"ws2_32.lib")
\ No newline at end of file
#include <nlib\nlib.h>
+#include <nlib\nlib_define.h>
#include <stdio.h>
#include <memory.h>
#include <stdlib.h>
+
+void *nlibmemory;
NicoLiveStream_P NicoLiveStream_new(){
free(*self);
*self= NULL;
+}
+
+
+NLIB_RESULT InitializeNLIB(HINTERNET hInternet){
+
+ nlibmemory = malloc(65536);
+
+ return NLIB_ERR_OK;
+}
+
+
+VOID FinalizeNLIB(){
+
+ free(nlibmemory);
}
\ No newline at end of file