12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478 |
- // NeroDlg1.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "NeroDlg.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- //#pragma comment(lib, "NeroAPIGlue.lib")
- /////////////////////////////////////////////////////////////////////////////
- // CNeroDlg dialog IDC_CHECK5
- CNeroDlg* pDlg;
- CNeroDlg::CNeroDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CNeroDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CNeroDlg)
- m_bFromDir = 0;
- m_bDvd = 0;
- m_checkphoto1 = 1;
- m_checkphoto2 = FALSE;
- m_checkphoto3 = FALSE;
- m_checkphoto4 = FALSE;
- m_checkphoto5 = FALSE;
- m_checkphoto6 = FALSE;
- //}}AFX_DATA_INIT
- pDlg=this;
- NowDoingBurn=false;
- m_nphotos=0;
- m_nspase=0;
- m_nphotos1=0;
- m_nspase1=0;
- m_nphotos2=0;
- m_nspase2=0;
- m_nphotos3=0;
- m_nspase3=0;
- m_nphotos4=0;
- m_nspase4=0;
- m_nphotos5=0;
- m_nspase5=0;
- m_nphotos6=0;
- m_nspase6=0;
- CString version = _T ("Version 1.0");
- m_bScale=AfxGetApp()->GetProfileInt (version, "cutphoto", 1);
- m_bDvd=AfxGetApp()->GetProfileInt (version, "bDvd", 0);
- m_checkphoto1=AfxGetApp()->GetProfileInt (version, "m_checkphoto1", 1);
- m_checkphoto2=0;//AfxGetApp()->GetProfileInt (version, "m_checkphoto2", 0);
- m_checkphoto3=0;//AfxGetApp()->GetProfileInt (version, "m_checkphoto3", 0);
- m_checkphoto4=AfxGetApp()->GetProfileInt (version, "m_checkphoto4", 0);
- m_checkphoto5=AfxGetApp()->GetProfileInt (version, "m_checkphoto5", 0);
- m_checkphoto6=AfxGetApp()->GetProfileInt (version, "m_checkphoto6", 0);
- }
- void CNeroDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CNeroDlg)
- DDX_Control(pDX, IDC_COMBO1, m_combo1);
- DDX_Control(pDX, IDC_PROGRESS1, m_Progress);
- DDX_Radio(pDX, IDC_RADIO3, m_bFromDir);
- DDX_Radio(pDX, IDC_RADIO1, m_bDvd);
- DDX_Check(pDX, IDC_CHECK1, m_checkphoto1);
- DDX_Check(pDX, IDC_CHECK2, m_checkphoto2);
- DDX_Check(pDX, IDC_CHECK3, m_checkphoto3);
- DDX_Check(pDX, IDC_CHECK4, m_checkphoto4);
- DDX_Check(pDX, IDC_CHECK5, m_checkphoto5);
- DDX_Check(pDX, IDC_CHECK6, m_checkphoto6);
- DDX_Check(pDX, IDC_CHECK7, m_bScale);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CNeroDlg, CDialog)
- //{{AFX_MSG_MAP(CNeroDlg)
- ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
- ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
- ON_BN_CLICKED(IDC_BUTchoosedir, OnBUTchoosedir)
- ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
- ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
- ON_BN_CLICKED(IDC_CHECK3, OnCheck3)
- ON_BN_CLICKED(IDC_CHECK4, OnCheck4)
- ON_BN_CLICKED(IDC_CHECK5, OnCheck5)
- ON_BN_CLICKED(IDC_CHECK6, OnCheck6)
- ON_BN_CLICKED(IDC_CHECK7, OnCheck7)
- ON_CBN_CLOSEUP(IDC_COMBO1, OnCloseupCombo1)
- ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
- ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CNeroDlg message handlers
- BOOL CNeroDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- m_Progress.SetRange(0,100);
- EnableCtrls();
- CString filter="id='"+m_id+"'";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=50;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if(g_bSendOK==0)
- {
- return 1;
- }
- CArray<CStringArray, CStringArray>sparray;
- DataToArray( &sparray);
- CString str,spname;
- CStringArray spnamearray;
- for(int i=0; i<sparray.GetSize (); i++)
- {
- str=sparray.ElementAt (i).ElementAt (6);
- spname=sparray.ElementAt (i).ElementAt (5);
- GetNo(str, m_noarray);
- }
- m_combo1.AddString ("1200x1600");
- m_combo1.AddString ("768x1024");
- m_combo1.AddString ("600x800");
- m_combo1.AddString ("480x640");
- CString version = _T ("Version 1.0");
- int pos=AfxGetApp()->GetProfileInt (version, "cutphotosize", 2);
- m_combo1.SetCurSel (pos);
- if(m_checkphoto1)OnCheck1();
- if(m_checkphoto2)OnCheck2();
- if(m_checkphoto3)OnCheck3();
- if(m_checkphoto4)OnCheck4();
- if(m_checkphoto5)OnCheck5();
- if(m_checkphoto6)OnCheck6();
- CenterWindow ();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- bool NERO_CALLBACK_ATTR CNeroDlg::IdleCallback(void *pUserData)
- {
- static MSG msg;
- while (! ::PeekMessage(&msg,NULL,NULL,NULL,PM_NOREMOVE))
- {
- if (!AfxGetThread()->PumpMessage())
- {
- break;
- }
- }
- return false;
- }
- NeroUserDlgInOut NERO_CALLBACK_ATTR CNeroDlg::UserDialog(void *pUserData, NeroUserDlgInOut type, void *data)
- {
- switch (type)
- {
- case DLG_AUTO_INSERT:
- return DLG_RETURN_CONTINUE;
- break;
- case DLG_DISCONNECT_RESTART:
- return DLG_RETURN_ON_RESTART;
- break;
- case DLG_DISCONNECT:
- return DLG_RETURN_CONTINUE;
- break;
- case DLG_AUTO_INSERT_RESTART:
- return DLG_RETURN_EXIT;
- break;
- case DLG_RESTART:
- return DLG_RETURN_EXIT;
- break;
- case DLG_SETTINGS_RESTART:
- return DLG_RETURN_CONTINUE;
- break;
- case DLG_OVERBURN:
- return DLG_RETURN_TRUE;
- break;
- case DLG_AUDIO_PROBLEMS:
- return DLG_RETURN_EXIT;
- break;
- case DLG_FILESEL_IMAGE:
- {
- // create filter for image files
-
- // create a CFileDialog object.
- // usage : CFileDialog( BOOL bOpenFileDialog, LPCTSTR lpszDefExt = NULL, LPCTSTR lpszFileName = NULL,
- // DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter = NULL,
- // CWnd* pParentWnd = NULL );
- //
- // bOpenFileDialog = TRUE, create a File Open dialog
- // lpszDefExt = NULL, do not automatically append a file extension
- // dwFlags = OFN_OVERWRITEPROMPT, makes no sense during file open,
- // just in case we decide to use File Save later
- // szFilter = "Image Files (*.nrg)|*.nrg|All Files (*.*)|*.*||"
- // pParentWnd = ((CNeroFiddlesDlg*)pUserData), our current Dialog window is the parent
-
- // user canceled, do not proceed with the burn process
- return DLG_BURNIMAGE_CANCEL;
-
- }
- break;
- case DLG_WAITCD:
- {
-
- AfxMessageBox("光盘不为空或类型错误");
- return DLG_RETURN_EXIT;
- break;
- }
- default:
- break;
- }
- //
- return DLG_RETURN_EXIT;
- }
- BOOL NERO_CALLBACK_ATTR CNeroDlg::ProgressCallback(void *pUserData, DWORD dwProgressInPercent)
- {
- ((CNeroDlg*)pUserData)->m_Progress.SetPos(dwProgressInPercent);
- return true;
- }
- BOOL NERO_CALLBACK_ATTR CNeroDlg::AbortedCallback(void *pUserData)
- {
- return false;
- return true;
- }
- void NERO_CALLBACK_ATTR CNeroDlg::AddLogLine(void *pUserData, NERO_TEXT_TYPE type, const char *text)
- {
-
- //((CNeroMFCappDlg*)pUserData)->AppendString("Log line:" +(CString)*text);
- return;
- }
- void NERO_CALLBACK_ATTR CNeroDlg::SetPhaseCallback(void *pUserData, const char *text)
- {
- return;
- }
- CString GetFileNameFromPath(CString path)
- {
- path=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
- path=path.Left (path.Find ('.'));
- return path;
- }
- void CNeroDlg::GenSPhoto(CString dir, CStringArray &array, DWORD &nNeedSpase, BOOL bCheckNo)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dir), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- CString str;
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- if(str.GetAt (str.ReverseFind ('\\')+1)=='m')continue;
- if(str.Right (2)=="ok")continue;
- if(bCheckNo)
- {
- if(::FindArray (&m_noarray, GetFileNameFromPath(str))==-1)
- continue;
- }
- if(m_bScale )
- {
- if(str.Find ("客户原片")!=-1 || str.Find ("\\修好的片")!=-1)
- {
- if(::FindArray (&m_noarray, GetFileNameFromPath(str))!=-1)
- {
- array.Add (str);
- CFile fp;
- fp.Open (str, CFile::modeRead);
- nNeedSpase+=fp.GetLength ();
- fp.Close ();
- }
- }
- else
- {
- array.Add (str);
- CFile fp;
- fp.Open (str, CFile::modeRead);
- nNeedSpase+=fp.GetLength ();
- fp.Close ();
- }
- }
- else
- array.Add (str);
- }
- }
- void CNeroDlg::GenSPhoto(CString dir, CString sType, CStringArray &array, CStringArray &dirarray)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(dir), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- CString str;
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- if(str.GetAt (str.ReverseFind ('\\')+1)=='m')continue;
- if(str.Right (2)=="ok")continue;
- if(m_bScale && (sType=="(初修)"||sType=="(原片)") )
- {
- if(::FindArray (&m_noarray, GetFileNameFromPath(str))==-1)
- {
- ::CreateDirectory (g_mainpath+"\\temp", NULL);
- ::CreateDirectory (g_mainpath+"\\temp\\"+m_id+"(未选的照片)", NULL);
- CString dir;
- dir=g_mainpath+"\\temp\\"+m_id+"(未选的照片)\\"+sType;
- ::CreateDirectory(dir, NULL);
- array.Add (str);
- dirarray.Add (dir);
- /* Image *img=NULL; 没有找到
- ::LoadImageFromBuf (&img, str);
- if(img->GetWidth())
- {
- CRect rc(0,0,800,800);
- RectFitDes(img->GetWidth(), img->GetHeight(), rc);
- Image *simg= img->GetThumbnailImage(rc.Width (), rc.Height (), NULL, NULL);
- Graphics graphic(simg);//防止GetThumbnailImage影响质量
- graphic.DrawImage(img, 0,0,simg->GetWidth(), simg->GetHeight() );
- delete img;
- ::SaveImageToFile(simg, dir+"\\"+::GetFileNameFromPath (str)+".jpg");
- delete simg;
- }*/
- }
- }
- }
- }
- int GetChildCount(CString str, CStringArray &array)
- {
- CString dirname=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
- int count=array.GetSize ();
- CString temp;
- for(int i=0; i<array.GetSize (); i++)
- {
- if(array.ElementAt (i)==str)
- count--;
- else if(array.ElementAt (i).Find (str)==-1)
- count--;
- else
- {
- temp=array.ElementAt (i);
- temp=temp.Left (temp.ReverseFind ('\\'));
- if(temp!=str)
- count--;
- }
- }
- return count;
- }
- void CNeroDlg::OnCancel()
- {
- // TODO: Add extra cleanup here
- if(NowDoingBurn) //如果正在工作 则不能取消
- {
- if(m_Burn.NeroBurnOK)
- {
- CDialog::OnOK();
- return;
- }
- if(m_Burn.NeroWorkError)
- {
- CDialog::OnCancel();
- return;
- }
- AfxMessageBox("已经开始刻录了,不能中断");
- return;
- }
- CDialog::OnCancel(); //否则取消
- }
- void CNeroDlg::DoBurnOrNot()
- {
- m_Burn.NeroAPIInit();
- m_Burn.NeroAPIBurn();
- }
- BOOL CNeroDlg::PreTranslateMessage(MSG* pMsg)
- {
- return CDialog::PreTranslateMessage(pMsg);
- }
- void CNeroDlg::EnableCtrls()
- {
- GetDlgItem(IDC_CHECK1)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK2)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK3)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK4)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK5)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK6)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_BUTchoosedir)->EnableWindow(m_bFromDir);
- }
- void CNeroDlg::OnRadio3()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- EnableCtrls();
- }
- void CNeroDlg::OnRadio4()
- {
- // TODO: Add your control notification handler code here
- OnRadio3();
- }
- void CNeroDlg::OnBUTchoosedir()
- {
- // TODO: Add your control notification handler code here
- CString dir;
- GetSavePath(dir);
- dir.IsEmpty();
- GetDlgItem(IDC_EDIT1)->SetWindowText(dir);
- m_photoarray7.RemoveAll ();
- CString path;
- path =dir;
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
-
- m_photoarray7.Add (str);
- }
- }
- if(m_photoarray7.GetSize ()==0)
- {
- AfxMessageBox("警告:目录中无照片!", MB_ICONSTOP);
- }
- m_nphotos=m_photoarray7.GetSize ();
- m_nspase=0;
- for( i=0; i<m_photoarray7.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray7.ElementAt (i), CFile::modeRead))
- {
- m_nspase+=fp.GetLength ();
- fp.Close ();
- }
- }
-
- m_nspase/=(1024*1024);
- str.Format ("照片:%d 占用空间:%dM", m_nphotos, m_nspase);
- GetDlgItem(IDC_STATIC7)->SetWindowText(str);
- }
- void CNeroDlg::OnCheck1()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto1)
- {
- if(m_photoarray1.GetSize ()==0)
- {
- CString path;
- path=g_path4+"\\";
- path+=m_id;
- path +="\\";
- m_realpath=g_path4;
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- if(str.GetAt (str.ReverseFind ('\\')+1)=='m')continue;
- m_photoarray1.Add (str);
- }
- }
- if(m_photoarray1.GetSize ()==0)
- {
- AfxMessageBox("没有找到精修片,将用初修片替代!");
- path=g_path2+"\\";
- path+=m_id;
- path +="\\";
- m_realpath=g_path2;
-
- CStringArray dirarray;
- CString str,temp;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- if(str.GetAt (str.ReverseFind ('\\')+1)=='m')continue;
- /* temp=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
- temp=temp.Left (3);
- if(FindArray(&m_noarray, temp)==-1)
- continue;*/
- if(::FindArray (&m_noarray, GetFileNameFromPath(str))==-1)
- continue;
- m_photoarray1.Add (str);
- }
- }
- }
- if(m_photoarray1.GetSize ()==0)
- {
- AfxMessageBox("没有找到初修片,将用原片替代!");
- path=g_path1+"\\";
- path+=m_id;
- path +="\\";
- m_realpath=g_path1;
-
- CStringArray dirarray;
- CString str,temp;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- if(str.GetAt (str.ReverseFind ('\\')+1)=='m')continue;
- /* temp=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
- temp=temp.Left (3);
- if(FindArray(&m_noarray, temp)==-1)
- continue;*/
- if(::FindArray (&m_noarray, GetFileNameFromPath(str))==-1)
- continue;
- m_photoarray1.Add (str);
- }
- }
- }
- m_nphotos1=m_photoarray1.GetSize ();
- m_nspase1=0;
- for( i=0; i<m_photoarray1.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray1.ElementAt (i), CFile::modeRead))
- {
- m_nspase1+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase1temp=m_nspase1;
- }
- else
- {
- m_nphotos1=m_photoarray1.GetSize ();
- m_nspase1=m_nspase1temp;
- }
- }
- else
- {
- m_nphotos1=0;
- m_nspase1=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos1, m_nspase1/(1024*1024));
- GetDlgItem(IDC_STATIC1)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::OnCheck2()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto2)
- {
- if(m_checkphoto5)
- m_checkphoto5=0;
- UpdateData(false);
- OnCheck5();
- if(m_photoarray2.GetSize ()==0)
- {
- CString path;
- path=g_path2+"\\";
- path+=m_id;
- path +="\\";
-
- CString str;
-
- if(m_noarray.GetSize ()==0)
- {
- AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
- return;
- }
-
- for(int i=0; i<m_noarray.GetSize (); i++)
- {
- str.Format ("%s%s.jpg", path, m_noarray.ElementAt (i));
- if(::CheckFileExist (str))
- {
- m_photoarray2.Add (str);
- }
- }
- if(m_photoarray2.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos2=m_photoarray2.GetSize ();
- m_nspase2=0;
- for( i=0; i<m_photoarray2.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray2.ElementAt (i), CFile::modeRead))
- {
- m_nspase2+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase2temp=m_nspase2;
- }
- else
- {
- m_nphotos2=m_photoarray2.GetSize ();
- m_nspase2=m_nspase2temp;
- }
- }
- else
- {
- m_nphotos2=0;
- m_nspase2=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos2, m_nspase2/(1024*1024));
- GetDlgItem(IDC_STATIC2)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::OnCheck3()
- {
- // TODO: Add your control notification handler code here
- /* UpdateData();
- if(m_checkphoto3)
- {
- if(m_checkphoto4)
- m_checkphoto4=0;
- UpdateData(false);
- OnCheck4();
- if(m_photoarray3.GetSize ()==0)
- {
- CString path;
- path=g_path1+"\\";
- path+=m_id;
- path +="\\";
- if(m_noarray.GetSize ()==0)
- {
- AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
- return;
- }
- CString str;
- for(int i=0; i<m_noarray.GetSize (); i++)
- {
- str.Format ("%s%s.jpg", path, m_noarray.ElementAt (i));
- if(::CheckFolderFileExist (str))
- {
- m_photoarray3.Add (str);
- }
- }
- if(m_photoarray3.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos3=m_photoarray3.GetSize ();
- m_nspase3=0;
- for( i=0; i<m_photoarray3.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray3.ElementAt (i), CFile::modeRead))
- {
- m_nspase3+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase3temp=m_nspase3;
- }
- else
- {
- m_nphotos3=m_photoarray3.GetSize ();
- m_nspase3=m_nspase3temp;
- }
- }
- else
- {
- m_nphotos3=0;
- m_nspase3=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos3, m_nspase3/(1024*1024));
- GetDlgItem(IDC_STATIC3)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- */
- }
- void CNeroDlg::OnCheck4()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto4)
- {
- /* if(m_checkphoto3)
- m_checkphoto3=0;
- UpdateData(false);
- OnCheck3();*/
- if(m_photoarray4.GetSize ()==0)
- {
- CString path;
- path=g_path1+"\\";
- path+=m_id;
- path +="\\";
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- if(str.GetAt (str.ReverseFind ('\\')+1)=='m')continue;
- m_photoarray4.Add (str);
- }
- }
- if(m_photoarray4.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos4=m_photoarray4.GetSize ();
- m_nspase4=0;
- for( i=0; i<m_photoarray4.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray4.ElementAt (i), CFile::modeRead))
- {
- m_nspase4+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase4temp=m_nspase4;
- }
- else
- {
- m_nphotos4=m_photoarray4.GetSize ();
- m_nspase4=m_nspase4temp;
- }
- }
- else
- {
- m_nphotos4=0;
- m_nspase4=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos4, m_nspase4/(1024*1024));
- GetDlgItem(IDC_STATIC4)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::OnCheck5()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto5)
- {
- if(m_checkphoto2)
- m_checkphoto2=0;
- UpdateData(false);
- OnCheck2();
- if(m_photoarray5.GetSize ()==0)
- {
- CString path;
- path=g_path2+"\\";
- path+=m_id;
- path +="\\";
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- if(str.GetAt (str.ReverseFind ('\\')+1)=='m')continue;
- m_photoarray5.Add (str);
- }
- }
- if(m_photoarray5.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos5=m_photoarray5.GetSize ();
- m_nspase5=0;
- for( i=0; i<m_photoarray5.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray5.ElementAt (i), CFile::modeRead))
- {
- m_nspase5+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase5temp=m_nspase5;
- }
- else
- {
- m_nphotos5=m_photoarray5.GetSize ();
- m_nspase5=m_nspase5temp;
- }
- }
- else
- {
- m_nphotos5=0;
- m_nspase5=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos5, m_nspase5/(1024*1024));
- GetDlgItem(IDC_STATIC5)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::OnCheck6()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto6)
- {
- if(m_photoarray6.GetSize ()==0)
- {
- CString path;
- path=g_path3+"\\";
- path+=m_id;
- path +="\\";
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- if(str.GetAt (str.ReverseFind ('\\')+1)=='m')continue;
- m_photoarray6.Add (str);
- }
- }
- if(m_photoarray6.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos6=m_photoarray6.GetSize ();
- m_nspase6=0;
- for( i=0; i<m_photoarray6.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray6.ElementAt (i), CFile::modeRead))
- {
- m_nspase6+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase6temp=m_nspase6;
- }
- else
- {
- m_nphotos6=m_photoarray6.GetSize ();
- m_nspase6=m_nspase6temp;
- }
- }
- else
- {
- m_nphotos6=0;
- m_nspase6=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos6, m_nspase6/(1024*1024));
- GetDlgItem(IDC_STATIC6)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::GetNo(CString str, CStringArray &array)
- {
- if(!str.IsEmpty ())
- {
- int pos=str.Find (",");
- while(pos!=-1)
- {
- if(FindArray(&array, str.Left (pos))==-1)
- array.Add (str.Left (pos));
- str=str.Right (str.GetLength ()-pos-1);
- pos=str.Find (",");
- }
- if(FindArray(&array, str)==-1)
- array.Add(str);
- }
- }
- extern bool SleepEx( DWORD dwMilliseconds );
- void CNeroDlg::OnOK()
- {
- ::DeleteDirectory (g_mainpath+"\\temp");
- ::CreateDirectory (g_mainpath+"\\temp", NULL);
- UpdateData();
- if(m_bScale)
- {
- if(!CheckDiskSpase())return;
- }
- if(m_nphotos==0)
- {
- AfxMessageBox("未选中照片!", MB_ICONSTOP);
- return;
- }
- if(m_nspase>650 && m_bDvd==0 && m_bScale==0)
- {
- AfxMessageBox("光盘空间不足!", MB_ICONSTOP);
- return;
- }
- m_Burn.m_DirArray.RemoveAll ();
- m_Burn.m_DirRealNameArray.RemoveAll ();
- CArray<BOOL,BOOL>bIsSelectDirArray;
- GetDlgItem(IDOK)->SetWindowText("刻录中, 请稍候...");
- GetDlgItem(IDOK)->EnableWindow(0);
- if(NowDoingBurn)
- return;
-
-
- CStringArray dirarray;
-
- using namespace helper_coffs;
- CStringArray srcarray;
- if(m_bFromDir)
- {
- CString str;
- GetDlgItemText(IDC_EDIT1, str);
- str.TrimRight ('\\');
- m_Burn.m_DirArray.Add (str);
- m_Burn.m_DirRealNameArray.Add (str);
- bIsSelectDirArray.Add (0);
- }
- else
- {
- if(m_checkphoto1)
- {
- if( m_realpath==g_path1 && m_checkphoto4)//没有精修片用原片代替,同时又要刻原片时, 把原片备份出来
- {
- SetDlgItemText(IDC_STATICTip, "照片复制中...");
- m_Progress.SetRange (0, m_photoarray1.GetSize ());
- CString path=g_mainpath+"\\temp\\"+m_id+"(精修)";
- ::CreateDirectory (path, NULL);
- CString str;
- for(int i=0; i<m_photoarray1.GetSize (); i++)
- {
- str=m_photoarray1.ElementAt (i);
- ::CopyFile (str, path+str.Right (str.GetLength ()-str.ReverseFind ('\\')), 0);
- m_Progress.SetPos (i);
- }
- m_Burn.m_DirArray.Add (path);
- m_Burn.m_DirRealNameArray.Add (path);
- bIsSelectDirArray.Add (0);
- }
- else
- {
- m_Burn.m_DirArray.Add (m_realpath+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (m_realpath+"\\"+m_id+"(精修)");
- if(m_realpath==g_path4)
- bIsSelectDirArray.Add (0);
- else
- bIsSelectDirArray.Add (1);
- }
- }
-
- if(m_checkphoto5)
- {
- m_Burn.m_DirArray.Add (g_path2+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path2+"\\"+m_id+"(初修)");
- bIsSelectDirArray.Add (0);
- }
-
- if(m_checkphoto4)
- {
- m_Burn.m_DirArray.Add (g_path1+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path1+"\\"+m_id+"(原片)");
- bIsSelectDirArray.Add (0);
- }
- if(m_checkphoto6)
- {
- m_Burn.m_DirArray.Add (g_path3+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path3+"\\"+m_id+"(设计片)");
- bIsSelectDirArray.Add (0);
- }
- }
- DWORD nNeedSpase=0;
- if(m_bScale)
- {
- SetDlgItemText(IDC_STATICTip, "照片裁切中...");
- int pos=m_combo1.GetCurSel ();
- CStringArray needsaclearray;
- CStringArray dirarray;
- for(int i=0; i<m_Burn.m_DirArray.GetSize (); i++)
- {
-
-
- GenSPhoto(m_Burn.m_DirArray.ElementAt (i), m_Burn.m_DirRealNameArray.ElementAt (i).Right (6), needsaclearray, dirarray);
- }
-
- m_Progress.SetRange (0, needsaclearray.GetSize ());
- for( i=0; i<needsaclearray.GetSize (); i++)
- {
- CString str=needsaclearray.ElementAt (i);
- CString dir;
- dir=dirarray.ElementAt (i);
- Image *img=NULL;
- ::LoadImageFromBuf (&img, str);
- if(img->GetWidth())
- {
- CRect rc(0,0,800,800);
- if(pos==0)
- {
- rc.right =1600;
- rc.bottom =1600;
- }
- else if(pos==1)
- {
- rc.right =1024;
- rc.bottom =1024;
- }
- else if(pos==2)
- {
- rc.right =800;
- rc.bottom =800;
- }
- else
- {
- rc.right =640;
- rc.bottom =640;
- }
- RectFitDes(img->GetWidth(), img->GetHeight(), rc);
- Image *simg= img->GetThumbnailImage(rc.Width (), rc.Height (), NULL, NULL);
- Graphics graphic(simg);//防止GetThumbnailImage影响质量
- graphic.DrawImage(img, 0,0,simg->GetWidth(), simg->GetHeight() );
- delete img;
- CString savepath=dir+"\\"+::GetFileNameFromPath (str)+".jpg";
- ::SaveImageToFile(simg, savepath);
- delete simg;
- CFile fp;
- if(fp.Open (savepath, CFile::modeRead))
- {
- nNeedSpase+=fp.GetLength ();
- fp.Close ();
- }
- else
- {
- /* ::CopyFile (str, savepath, 0);
- if(fp.Open (savepath, CFile::modeRead))
- {
- nNeedSpase+=fp.GetLength ();
- fp.Close ();
- }*/
-
- str.Format ("原片%s裁剪失败, 请查看此照片是否损坏。", savepath.Right (savepath.GetLength ()-savepath.ReverseFind ('\\')-1));
- AfxMessageBox(str);
- }
- }
- m_Progress.SetPos (i+1);
- ::SleepEx(10);
- }
- if(::CheckFolderFileExist (g_mainpath+"\\temp\\"+m_id+"(未选的照片)"))
- {
- m_Burn.m_DirArray.Add (g_mainpath+"\\temp\\"+m_id+"(未选的照片)");
- m_Burn.m_DirRealNameArray.Add (g_mainpath+"\\temp\\"+m_id+"(未选的照片)");
- bIsSelectDirArray.Add (0);
- }
- }
- SetDlgItemText(IDC_STATICTip, "光盘刻录中...");
- CString str;
- CArray<BOOL,BOOL>bIsSelectDirArray2;
- for(int i=0; i<m_Burn.m_DirArray.GetSize (); i++)
- {
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(m_Burn.m_DirArray.ElementAt (i)), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- str.TrimRight("\\");
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- bIsSelectDirArray2.Add (bIsSelectDirArray.ElementAt (i));
- }
- }
- }
- int addcount=0;
- if(m_bFromDir==0)
- {
- if(m_checkphoto2)addcount++;
- if(m_checkphoto3)addcount++;
- }
- if((dirarray.GetSize ()+addcount)==0)return;
- CStringArray *photosarray=new CStringArray[dirarray.GetSize()+addcount];
- for( i=0; i<dirarray.GetSize (); i++)
- {
- GenSPhoto(dirarray.ElementAt (i), photosarray[i], nNeedSpase,bIsSelectDirArray2.ElementAt (i));
- }
- if(m_bFromDir==0)
- {
- int pos=dirarray.GetSize ();
- if(m_checkphoto2)
- {
- m_Burn.m_DirArray.Add (g_path2+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path2+"\\"+m_id+"(初修)");
- dirarray.Add(g_path2+"\\"+m_id);
- photosarray[pos].Copy (m_photoarray2);
- pos++;
- nNeedSpase+=m_nspase1;
- }
- if(m_checkphoto3)
- {
- m_Burn.m_DirArray.Add (g_path1+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path1+"\\"+m_id+"(原片)");
- dirarray.Add(g_path1+"\\"+m_id);
- photosarray[pos].Copy (m_photoarray3);
- nNeedSpase+=m_nspase2;
- }
- }
- if(m_bScale)
- {
- nNeedSpase/=1024*1024;
- if(nNeedSpase>650 && m_bDvd==0)
- {
- AfxMessageBox("光盘空间不足!", MB_ICONSTOP);delete []photosarray;
- return;
- }
- }
- m_Burn.m_pDir=&dirarray;
- m_Burn.m_pPhotoArray=photosarray;
-
-
- if(m_Burn.NeroAPIInit()==0)
- {
- m_Burn.NeroWorkError=1;
- delete []photosarray;
- return;
- }
- m_Burn.m_name=m_name;
- m_Burn.m_bDvd=m_bDvd;
- m_Burn.NeroAPIBurn();
- NowDoingBurn=true; delete []photosarray;
- ::DeleteDirectory (g_mainpath+"\\temp");
- if(m_Burn.NeroWorkError==0)
- {
- CDialog::OnOK ();
- }
- else
- CDialog::OnCancel ();
- }
- void CNeroDlg::OnCheck7()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- CString version = _T ("Version 1.0");
- AfxGetApp()->WriteProfileInt (version, "cutphoto", m_bScale);
- }
- BOOL CNeroDlg::CheckDiskSpase()
- {
- CString sDrive = g_mainpath.Left(2);
- DWORD dwTotalDiskSpace,dwFreeDiskSpace,dwUsedDiskSpace;
-
- ULARGE_INTEGER uiFreeBytesAvailableToCaller;
- ULARGE_INTEGER uiTotalNumberOfBytes;
- ULARGE_INTEGER uiTotalNumberOfFreeBytes;
-
- if(GetDiskFreeSpaceEx(sDrive, &uiFreeBytesAvailableToCaller,
- &uiTotalNumberOfBytes,
- &uiTotalNumberOfFreeBytes))
- {
- dwTotalDiskSpace = (DWORD)(uiTotalNumberOfBytes.QuadPart / 1024 / 1024);
- dwFreeDiskSpace = (DWORD)(uiFreeBytesAvailableToCaller.QuadPart >> 20);
- dwUsedDiskSpace = dwTotalDiskSpace - dwFreeDiskSpace;
- }
- if(dwFreeDiskSpace>600)return 1;
- AfxMessageBox("磁盘空间不足!", MB_ICONSTOP);
- return 0;
- }
- void CNeroDlg::OnCloseupCombo1()
- {
- // TODO: Add your control notification handler code here
- int pos=m_combo1.GetCurSel ();
- if(pos!=-1)
- {
- CString version = _T ("Version 1.0");
- AfxGetApp()->WriteProfileInt (version, "cutphotosize", pos);
- }
- }
- void CNeroDlg::OnRadio1()
- {
- // TODO: Add your control notification handler code here
- OnRadio2();
- }
- void CNeroDlg::OnRadio2()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- CString version = _T ("Version 1.0");
- AfxGetApp()->WriteProfileInt (version, "bDvd", m_bDvd);
- }
- void CNeroDlg::OnDestroy()
- {
- UpdateData();
- CString version = _T ("Version 1.0");
- AfxGetApp()->WriteProfileInt (version, "m_checkphoto1", m_checkphoto1);
- AfxGetApp()->WriteProfileInt (version, "m_checkphoto2", m_checkphoto2);
- AfxGetApp()->WriteProfileInt (version, "m_checkphoto3", m_checkphoto3);
- AfxGetApp()->WriteProfileInt (version, "m_checkphoto4", m_checkphoto4);
- AfxGetApp()->WriteProfileInt (version, "m_checkphoto5", m_checkphoto5);
- AfxGetApp()->WriteProfileInt (version, "m_checkphoto6", m_checkphoto6);
- // TODO: Add your message handler code here
- CDialog::OnDestroy();
- }
|