Hi All How can i know Excel in install or not in system?
NewVC
Posts
-
Excel -
Catch(exception)Hi All How can i Use AfxmessBox through Catch(exception)?Plz help me i have code like this
try{
//Something here
}
catch(exception er)
{
AfxmessBox(er)
}Plz help me
-
Folder SizeHi All There is any API which will give folder size like
_stat function
.I am try to get size without open folder.Plz help me -
Problem in structThanks Michael
-
Problem in structHi All I got example of get file size from MSDN.But i have a problem to write out put in file.How to convert struct values to CString or any other solution. Example code is here
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>int main( void )
{
struct _stat buf;
int result;
char timebuf[26];
char* filename = "crt_stat.c";
errno_t err;// Get data associated with "crt_stat.c":
result = _stat( filename, &buf );// Check if statistics are valid:
if( result != 0 )
{
perror( "Problem getting information" );
switch (errno)
{
case ENOENT:
printf("File %s not found.\n", filename);
break;
case EINVAL:
printf("Invalid parameter to _stat.\n");
break;
default:
/* Should never be reached. */
printf("Unexpected error in _stat.\n");
}
}
else
{
// Output some of the statistics:
printf( "File size : %ld\n", buf.st_size );
printf( "Drive : %c:\n", buf.st_dev + 'A' );
err = ctime_s(timebuf, 26, &buf.st_mtime);
if (err)
{
printf("Invalid arguments to ctime_s.");
exit(1);
}
printf( "Time modified : %s", timebuf );
}
}How can i write it's values
buf.st_size
in file. Plz help me -
MultiThreadingCan you give me some code example?
-
MultiThreadingHi All How can i create and call multithreading?i am try to call a function through thread more than one time.Plz help me
-
Files\Foldercan you give me some dummy code?
CFileOperation fo;
CString string1; finalString=strFileName; char \* szMyString = (char \*)(LPCTSTR)finalString; CString string = \_T(szMyString); int nPosp = strFileName1.Find( \_T("\\\\Windows")); if( nPosp >= 0) { CString DirPath21 = strFileName1.Mid( 0, nPosp +1 ); return; } int nPosp1 = strFileName1.Find( \_T("\\\\Backup")); if( nPosp1 >= 0) { CString DirPath211 = strFileName1.Mid( 0, nPosp1 +1 ); return; } int nPosp2 = strFileName1.Find( \_T("\\\\Users")); if( nPosp2 >= 0) { CString DirPath212 = strFileName1.Mid( 0, nPosp2 +1 ); return; } CString DirPath121; int nPos = string.Find( \_T('\\\\') ,3); if( nPos >= 3) { DirPath121 = string.Mid( 0, nPos ); LPCSTR pF1=DirPath121; LPCSTR pT1="c:\\\\Backup"; if (!fo.Copy(pF1,pT1)); } else { string1=string; string1 +='\\0'; if(string1=="") { //break; } int nLen = string1.GetLength(); LPCSTR lpszBuf = string1.GetBuffer(nLen); string1.ReleaseBuffer(); LPCSTR pF=lpszBuf; LPCSTR pT="c:\\\\Backup"; if (!fo.Copy(pF,pT)); }
modified on Wednesday, March 18, 2009 8:39 AM
-
Files\FolderAs you reply i use this code.
CFileFind finder;
BOOL bWorking = finder.FindFile(\_T(Path)); while (bWorking) { bWorking = finder.FindNextFile(); if (finder.MatchesMask(FILE\_ATTRIBUTE\_HIDDEN | FILE\_ATTRIBUTE\_SYSTEM)) { \_tprintf\_s(\_T("%s\\n"), (LPCTSTR) finder.GetFileName()); } }
Path="C:\\Test\\abc.txt" or Path="C:\\tets.txt".In the both case currsor enter in while loop.But I need to check String have only file or Files/Folder Both. Plz help me
-
Files\Folderi use find ,mid and Right.But i need to check only root is Folder or Not?
-
Files\FolderHi All How can i identify root is file or folder?I have a String Path="C:\\Tets\\tr.txt" and String Path1="C:\\abc.txt".How can i identify Path root is Folder and Path1 root is File.Plz help me
-
Get USB Drive Letter sizeHi All How can i get USB Drive Letter size?Plz help me
-
Timer Problemvoid CTimer::OnTimer(UINT_PTR nIDEvent)
{
// TODO: Add your message handler code here and/or call default
OnBnClickeTimer();
CDialog::OnTimer(nIDEvent);
}void CTimer::OnStartTimer()
{
SetTimer(2,10000, 0);
}void CTimer::OnStopTimer()
{
KillTimer (0);
}BOOL CTimer::OnInitDialog()
{
OnBnClickeTimer();}
void CTimer::OnBnClickedTimer()
{check: for(;aq<10) { finalString=a1\[aq\]; char \* szMyString = (char \*)(LPCTSTR)finalString; CString string = \_T(szMyString); CString DirPath; CString string1=string; string1 +='\\0'; int nLen = string1.GetLength(); LPCSTR lpszBuf = string1.GetBuffer(nLen); string1.ReleaseBuffer(); LPCSTR pF=lpszBuf; LPCSTR pT="c:\\\\Backup"; if (!fo.Copy(pF,pT)); aq++; } OnStopTimer();
}
CString a1[aq] is external vaiable. Plz help me
modified on Tuesday, February 24, 2009 6:43 AM
-
Timer ProblemHi All I am useing timer in main dialog class.Calling Timer on On OnInitDialog function.But my dilaog become not responding.Plz help me.
-
Windows defender is blocking application to run from startup in VistaHi All I have a dialog based application(MFC) and application is running in background(through startup).But at the time of system boot my application has blocked by windows defender.I have attached application.exe.manifest.How can i remove the Windows defender is blocking application?Plz help me
-
Convert CString to Binary and Binary to CStringHow can I convert a CString variable to a binary string, so that I can write it to the text file in binary form and Read CString form? i am converting CString to Binary like this.
CString strRet;
CString strname="ABCDEF";for (int i = 0; i < strname.GetLength(); ++i) {
CString str; str.Format("%2.2x", strname\[i\]); strRet += str;
}
AfxMessageBox(strRet);But i don't know how to convert this Binary values to CString? Plz help me:rose:
-
COleDataObject errorHi All I am geting error when i am useing COleDataObject.I got some example code from net.It's very help full for me but when i am use the code then i am geting error.
COleDataObject odj1;
if( odj1.AttachClipboard() )
{
if( odj1.IsDataAvailable( CF_HDROP ) )
{
STGMEDIUM StgMed;
FORMATETC fmte = { CF_HDROP,
(DVTARGETDEVICE FAR *)NULL,
DVASPECT_CONTENT,
-1,
TYMED_HGLOBAL };
if( odj1.GetData( CF_HDROP, &StgMed, &fmte ) )
{
HDROP hDrop = (HDROP)StgMed.hGlobal;
UINT cFiles = ::DragQueryFile(hDrop, (UINT)-1, NULL, 0);
CString szText;
char szFile[MAX_PATH];
szText="";
for( UINT count = 0; count < cFiles; count++ )
{
::DragQueryFile(hDrop, count, szFile, sizeof(szFile));
szText += szFile;
szText += "\r\n";
}
m_pRich->ReplaceSel(szText);
if (StgMed.pUnkForRelease)
{
StgMed.pUnkForRelease->Release();
}
else
{
::GlobalFree(StgMed.hGlobal);
}
return;
}
}
}error geting
error C2079: 'odj1' uses undefined class 'COleDataObject'
error C2228: left of '.AttachClipboard' must have class/struct/union
error C2228: left of '.IsDataAvailable' must have class/struct/union
error C2228: left of '.GetData' must have class/struct/unionPlz help me
-
ClipBoard HookHi All How can i get files name from clipboard useing Clipboard hook?Plz help me
-
Compare two fileHi All How can i Compare two file data line by line?Plz help me
-
Static fontI have static text more than one.And i set the font only one static text.Every things is working fine but problem is that it's showing highlited in related to other static text.But i want to set only it's size and all things i want to show nornmal as like all normal satic text show.Plz help me Thanks in advance