00001 /* 00002 Free Download Manager Copyright (c) 2003-2007 FreeDownloadManager.ORG 00003 Open Download Manager Copyright (c) 2008-2010 OpenDownloadManager.ORG 00004 */ 00005 00006 #include "stdafx.h" 00007 #include "FdmApp.h" 00008 #include "FdmTorrentFilesRcvr.h" 00009 #include "DownloadsWnd.h" 00010 #include "UIThread.h" 00011 00012 STDMETHODIMP CFdmTorrentFilesRcvr::CreateBtDownloadFromFile(BSTR bstrFile) 00013 { 00014 USES_CONVERSION; 00015 00016 if (Is9xME) 00017 return E_NOTIMPL; 00018 00019 _inc_CBRFF_ctx *p = new _inc_CBRFF_ctx; 00020 00021 p->strFile = W2A (bstrFile); 00022 p->strFileUrl = "file://"; p->strFileUrl += p->strFile; 00023 p->bForceSilent = m_bForceSilent; 00024 00025 UIThread *thr = (UIThread*) RUNTIME_CLASS (UIThread)->CreateObject (); 00026 thr->set_Thread (_threadCreateBtDownloadFromFile, p); 00027 thr->CreateThread (); 00028 00029 return S_OK; 00030 } 00031 00032 STDMETHODIMP CFdmTorrentFilesRcvr::get_ForceSilent(BOOL *pVal) 00033 { 00034 *pVal = m_bForceSilent; 00035 return S_OK; 00036 } 00037 00038 STDMETHODIMP CFdmTorrentFilesRcvr::put_ForceSilent(BOOL newVal) 00039 { 00040 m_bForceSilent = newVal; 00041 return S_OK; 00042 } 00043 00044 DWORD WINAPI CFdmTorrentFilesRcvr::_threadCreateBtDownloadFromFile(LPVOID lp) 00045 { 00046 _inc_CBRFF_ctx *p = (_inc_CBRFF_ctx*) lp; 00047 00048 _pwndDownloads->CreateBtDownloadFromFile (p->strFile, p->strFileUrl, 00049 p->bForceSilent ? TRUE : _App.Monitor_Silent ()); 00050 00051 delete p; 00052 00053 return 0; 00054 }
1.5.6