|
stat is probably not used so much theses days, GetFileTime() [^] will probably be what you need.
The best things in life are not things.
|
|
|
|
|
Sorry! Dint get your question.
Do you want file creation time?
|
|
|
|
|
I didn't post a question, I posted an answer.
The best things in life are not things.
|
|
|
|
|
|
Hi,
I am drwaing image using Image::DrawImage and same image using CDC::BitBlt with same x,y position.
But both methods are drawing image on diffrent axis(x,y). How could I draw on same position for both?
|
|
|
|
|
show code snippet or give more info..
|
|
|
|
|
using BitMlt:
CRect rect;
this->GetWindowRect( &rect );
this->GetParent()->ScreenToClient( rect );
CBitmap img;
CDC dc;
BITMAP bmp;
img.LoadBitmap(m_nImageID);
img.GetBitmap(&bmp);
CDC* pDC = this->GetDC();
dc.CreateCompatibleDC(pDC);
CBitmap* pOld = dc.SelectObject(&img);
pDC->BitBlt(rect.left, rect.top, bmp.bmWidth, bmp.bmHeight, &dc, 0, 0, SRCCOPY);
using Image::DrawImage
CRect rect;
this->GetWindowRect( &rect );
this->GetParent()->ScreenToClient( rect );
m_img = Gdiplus::Bitmap::FromResource(GetModuleHandle(0),MAKEINTRESOURCE(nImage));
grpx.DrawImage(m_img, 0, 0, m_img->GetWidth(),m_img->GetHeight());
|
|
|
|
|
What are the values of rect.left and rect.top in case 1?
The best things in life are not things.
|
|
|
|
|
left = 50 and top = 50 in both cases
|
|
|
|
|
Fine, but in the second case you are drawing at Point(0, 0) !
The best things in life are not things.
|
|
|
|
|
grpx.DrawImage(m_img, 0, 0, m_img->GetWidth(),m_img->GetHeight());
why don't you try using same rect.left and rect.top instead of 0,0 in drawimage??
Regards,
Gopinath.
|
|
|
|
|
Hello
How can i create one button for two events?
For example: I want to have one button for start/stop.
At the beginning of the application button name is start (start the event ), when I click the button second time it change the name to Stop (stop the event)????
I am very new to C# programming, i know to do this in VB6... Sorry for my bad english!
ThankYou
|
|
|
|
|
This is in the wrong forum, try the C# forum next door...
|
|
|
|
|
About the best redirect I've seen here. +5
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
glad you liked it...
|
|
|
|
|
|
Hi
Any sample or help?
Thanks
www.logicsims.ir
|
|
|
|
|
Hi,
Take a look at thisexample, it does detail the AT codes etc that may help you...
|
|
|
|
|
Hi all,
How can i browse image and display on dialog.Any good links for this.
Thanks
Manju
|
|
|
|
|
Check this link ->[^]
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
|
|
|
|
|
the problem of mine is: I defined four document templates "A B C D" in my program and I set the document template "A" as master document template others as slaves.that means I use the master document template to open data and transfer data to other document templates. so I only implement the OnOpenDocument() function of the master document template. after I have finished all the framework. my leader tell me that the view from the "B" document template should be display firstly or on top after the data is opened. so I have to hide the view of master document template and show the view of slave "B" document template. but I found the "B" is not activate, that means all the menu or toolbar command message loop are still clue to master document template. please tell me how to active the B document template and let it to response all the menu commands.
swandream
|
|
|
|
|
i am trying to Encrypting files SetEncryptionMethod(CZipCryptograph::encWinZipAes256)
its not encrypting full here is my code ...
CZipArchive zip;
LPCTSTR sar = _T("C:\\saad.zip");
LPCTSTR password = _T("1234");
zip.Open(sar,CZipArchive::zipCreate);
zip.SetPassword(password);
zip.SetEncryptionMethod(CZipCryptograph::encWinZipAes256);
zip.AddNewFile(filepath);
zip.Close();
// TODO: Add your control notification handler code here
MessageBox(_T("file is locked successfully"),NULL,MB_OK);
when i see in winhex its shows the which type of file and data ...
by using winrar i encrypted the file then drag into the winhex it does not show file type or etc
i looking to do it like that using the zip archive lib ........
is there any other way to do it in aip archive lib only ??????
thanking you
sarfarz
|
|
|
|
|
have you tried asking the author(s) of CZipArchive ?
|
|
|
|
|
|
hello everybody :
i created a dialog base program and it has a CListCtrl on the dialog. now ,i wanna print the datas of CListCtrl.but the reuslt was wrong.
may be the wrong in TextOut function
following 's my code , help me please.
BOOL CBingLiGuanLi::PrintList(CListCtrl *pListCtrl)<br />
{<br />
PRINTDLG pd; <br />
pd.lStructSize = sizeof(PRINTDLG); <br />
pd.Flags = PD_RETURNDC; <br />
pd.hDC = NULL; <br />
pd.hwndOwner = NULL; <br />
pd.hInstance = NULL; <br />
pd.nMaxPage = 1; <br />
pd.nMinPage = 1; <br />
pd.nFromPage = 1; <br />
pd.nToPage = 1; <br />
pd.nCopies = 1; <br />
pd.hDevMode = NULL; <br />
pd.hDevNames = NULL; <br />
if(!PrintDlg(&pd)) return FALSE; <br />
ASSERT(pd.hDC!=NULL); <br />
int nHorRes = GetDeviceCaps(pd.hDC, HORZRES); <br />
int nVerRes = GetDeviceCaps(pd.hDC, VERTRES); <br />
int nXMargin = 2; <br />
int nYMargin = 2; <br />
TEXTMETRIC tm; <br />
GetTextMetrics(pd.hDC, &tm); <br />
int nCharHeight = tm.tmHeight; <br />
int nCharWidth = tm.tmAveCharWidth; <br />
CHeaderCtrl* pHeader = pListCtrl->GetHeaderCtrl(); <br />
int nColCount = pHeader->GetItemCount(); <br />
int nLineCount = pListCtrl->GetItemCount(); <br />
int ColOrderArray[100]; <br />
COLATT ca[100]; <br />
pListCtrl->GetColumnOrderArray(ColOrderArray, nColCount); <br />
int nColX =nXMargin*nCharWidth; <br />
for(int iXinXi =0 ; iXinXi< nColCount; iXinXi++) <br />
{ <br />
ca[iXinXi].nColIndex = ColOrderArray[iXinXi]; <br />
LVCOLUMN lvc; <br />
char text[100]; <br />
lvc.mask = LVCF_TEXT|LVCF_SUBITEM; <br />
lvc.pszText = text; <br />
lvc.cchTextMax = 100; <br />
pListCtrl->GetColumn(ca[iXinXi].nColIndex, &lvc); <br />
ca[iXinXi].strColText = lvc.pszText; <br />
ca[iXinXi].nSubItemIndex = lvc.iSubItem; <br />
ca[iXinXi].nPrintX = nColX; <br />
nColX += nCharWidth * strlen(ca[iXinXi].strColText); <br />
if(nColX > nHorRes) <br />
{ <br />
DeleteDC(pd.hDC); <br />
AfxMessageBox("字段太多,无法在一行内打印,请试用较大的纸,或横向打印。"); <br />
return FALSE; <br />
} <br />
} <br />
DOCINFO di; <br />
di.cbSize = sizeof(DOCINFO); <br />
di.lpszDocName = "ListCtrl Data Printing"; <br />
di.lpszOutput = (LPTSTR) NULL; <br />
di.lpszDatatype = (LPTSTR) NULL; <br />
di.fwType = 0; <br />
StartDoc(pd.hDC, &di); <br />
StartPage(pd.hDC); <br />
int space = (nHorRes-nXMargin*nCharWidth-nColX) / (nColCount -1); <br />
for(int iKuanDu =1; iKuanDu<nColCount; iKuanDu++) <br />
{ <br />
ca[iKuanDu].nPrintX += iKuanDu*space; <br />
} <br />
for(int iLieBiaoTi =0; iLieBiaoTi<nColCount; iLieBiaoTi++) <br />
{<br />
TextOut(pd.hDC, ca[iLieBiaoTi].nPrintX, nYMargin, <br />
ca[iLieBiaoTi].strColText, strlen(ca[iLieBiaoTi].strColText)); <br />
}<br />
int nMaxLinePerPage = nVerRes/nCharHeight -3; <br />
int nCurPage =1; <br />
for(int i=0; i<nLineCount; i++) <br />
{ <br />
for(int j =0; j<nColCount; j++) <br />
{ <br />
if(i+1-(nCurPage-1)*nMaxLinePerPage > nMaxLinePerPage) <br />
{ <br />
EndPage(pd.hDC); <br />
StartPage(pd.hDC); <br />
nCurPage ++; <br />
} <br />
CString subitem = pListCtrl->GetItemText(j, ca[j].nSubItemIndex); <br />
TextOut(pd.hDC, ca[j].nPrintX,nYMargin+(j+1-(nCurPage-1)*nMaxLinePerPage)*nCharHeight,subitem, strlen(subitem)); <br />
<br />
<br />
} <br />
} <br />
EndPage(pd.hDC); <br />
EndDoc(pd.hDC); <br />
DeleteDC(pd.hDC); <br />
return TRUE; <br />
}
|
|
|
|