Click here to Skip to main content
15,886,802 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
// in Header file declared the file //
C++
class CTIUSMO_RWDlg : public CDialog
{
// Construction
public:
    CTIUSMO_RWDlg(CWnd* pParent = NULL);    // standard constructor

    FILE * pFile;

}


C++
//    In Dlg.cpp

LPCTSTR ReadValue;

/* I'm not adding whole code here......Actually ReadValue is a pointer for shared memory , and It's getting data */   


ReadValue = (LPTSTR) MapViewOfFile(hMapFile2, // handle to map object
		FILE_MAP_ALL_ACCESS,  // read/write permission
		0,
		0,
		BUF_SIZE);

/* Here in array a[i} , Im getting all the values..., But when I do the fprint I'ts printing only first digit( say for ex.25565 means , it's printing only 2) */

    CString a[100];

    for ( int i=0;i<100;i++)
    {

         a[i] =  ReadValue;
         ReadValue=ReadValue+4;
         fprintf(pFile,"%s\n",a[i]);
    }

    fclose(pFile);


Is there anything else I need to do .... ??
Posted
Updated 13-Mar-15 1:11am
v2
Comments
Richard MacCutchan 13-Mar-15 6:01am    
Yes, delete all that and start again, it makes no sense.
Baaki 13-Mar-15 6:04am    
Dude., I didnt copy all my code..., If you have something to write the data in to .txt file.., jus tell me., else no problem.., jus you carry on
Richard MacCutchan 13-Mar-15 6:16am    
Chances are you have created a non-Unicode version of your program but the data is Unicode.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900