Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

NewVC

@NewVC
About
Posts
78
Topics
36
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Excel
    N NewVC

    Hi All How can i know Excel in install or not in system?

    C / C++ / MFC question

  • Catch(exception)
    N NewVC

    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

    C / C++ / MFC question help

  • Folder Size
    N NewVC

    Hi 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

    C / C++ / MFC json help

  • Problem in struct
    N NewVC

    Thanks Michael

    C / C++ / MFC help tutorial question

  • Problem in struct
    N NewVC

    Hi 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

    C / C++ / MFC help tutorial question

  • MultiThreading
    N NewVC

    Can you give me some code example?

    C / C++ / MFC question help

  • MultiThreading
    N NewVC

    Hi All How can i create and call multithreading?i am try to call a function through thread more than one time.Plz help me

    C / C++ / MFC question help

  • Files\Folder
    N NewVC

    can 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

    C / C++ / MFC question help

  • Files\Folder
    N NewVC

    As 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

    C / C++ / MFC question help

  • Files\Folder
    N NewVC

    i use find ,mid and Right.But i need to check only root is Folder or Not?

    C / C++ / MFC question help

  • Files\Folder
    N NewVC

    Hi 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

    C / C++ / MFC question help

  • Get USB Drive Letter size
    N NewVC

    Hi All How can i get USB Drive Letter size?Plz help me

    C / C++ / MFC question help

  • Timer Problem
    N NewVC

    void 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

    C / C++ / MFC help

  • Timer Problem
    N NewVC

    Hi All I am useing timer in main dialog class.Calling Timer on On OnInitDialog function.But my dilaog become not responding.Plz help me.

    C / C++ / MFC help

  • Windows defender is blocking application to run from startup in Vista
    N NewVC

    Hi 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

    C / C++ / MFC question c++ help

  • Convert CString to Binary and Binary to CString
    N NewVC

    How 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:

    C / C++ / MFC question help tutorial

  • COleDataObject error
    N NewVC

    Hi 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/union

    Plz help me

    C / C++ / MFC help tutorial announcement

  • ClipBoard Hook
    N NewVC

    Hi All How can i get files name from clipboard useing Clipboard hook?Plz help me

    C / C++ / MFC question help

  • Compare two file
    N NewVC

    Hi All How can i Compare two file data line by line?Plz help me

    C / C++ / MFC question help

  • Static font
    N NewVC

    I 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

    C / C++ / MFC help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups