Click here to Skip to main content
15,867,895 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question[Message Deleted] Pin
jitendrapothuru22-Jun-09 22:32
jitendrapothuru22-Jun-09 22:32 
QuestionRe: to maximise the dialog box and the fields in the dialog should also resize Pin
CPallini22-Jun-09 22:56
mveCPallini22-Jun-09 22:56 
Answer[Message Deleted] Pin
jitendrapothuru22-Jun-09 22:59
jitendrapothuru22-Jun-09 22:59 
GeneralRe: to maximise the dialog box and the fields in the dialog should also resize Pin
CPallini22-Jun-09 23:07
mveCPallini22-Jun-09 23:07 
AnswerRe: to maximise the dialog box and the fields in the dialog should also resize Pin
Stuart Dootson22-Jun-09 22:59
professionalStuart Dootson22-Jun-09 22:59 
AnswerRe: [Message Deleted] Pin
Cedric Moonen23-Jun-09 0:04
Cedric Moonen23-Jun-09 0:04 
QuestionSpider chart, star chart Pin
Ankata22-Jun-09 22:05
Ankata22-Jun-09 22:05 
QuestionSetFilePointer() + WriteFile() Problems? Pin
krish_kumar22-Jun-09 21:31
krish_kumar22-Jun-09 21:31 
Hii

In my program I'm reading the clusters in the volume using the appropriate physical offsets to the disk.



drive_handle=Createfile(L"\\\\.\\PhysicalDrive0",......);

for(  i=0;total_noof_clusters;i++)//assign 0 as logical startling offset.
{
// convert cluster logical offset to physical offset
// (source& dest same size,same file system)

 phys_offset_source= conversion(i);  // this value I get correctly
 phys_offset_dest= conversion(i);  // this value I get correctly


 DWORD dwPtr1=SetFilePointer(drive_handle,phys_offset_source,NULL,0);
 if (dwPtr1 == INVALID_SET_FILE_POINTER) // Test for failure
 {
 printf("\nSetFilePointer Failed to read from source,:%d\n",GetLastError());
 return 0;
 }


 if(!ReadFile(drive_handle,
                    bBuffer1,
                    cluster_size,
                    &dwRetBytes1,
                    0))
{
printf("\nUnable to Read the Disk Error: %d\n",GetLastError());   
return o;
}
   
 DWORD dwPtr2=SetFilePointer(drive_handle,phys_offset_dest,NULL,0);

 if (dwPtr2 == INVALID_SET_FILE_POINTER) // Test for failure
 {
 printf("\nSetFilePointer Failed to write position%d\n",GetLastError());
 return 0;
 }


 if(!WriteFile(drive_handle,
                    bBuffer1,
                    cluster_size,
                    &dwRetBytes1,
                    0))
{
printf("\nUnable to write he Drive Error: %d\n",GetLastError());   
return o;
}

} // next cluster





The above code not giving no (compilation and link)error messages,
But does not give the result.

How do we know the program reading correctly?
It returns the correct no of bytes read after one read operation .
When I wrote theses data into destination , nothing wrote.

What may be the problem??
Where is the mistake in the code ?

Any idea?
-----------
Thanking you
Krish
krishnampkkm is online now Report Post Edit/Delete Message
GeneralRe: SetFilePointer() + WriteFile() Problems? Pin
CPallini22-Jun-09 21:51
mveCPallini22-Jun-09 21:51 
GeneralRe: SetFilePointer() + WriteFile() Problems? Pin
krish_kumar22-Jun-09 22:41
krish_kumar22-Jun-09 22:41 
QuestionRe: SetFilePointer() + WriteFile() Problems? Pin
CPallini22-Jun-09 22:53
mveCPallini22-Jun-09 22:53 
AnswerRe: SetFilePointer() + WriteFile() Problems? Pin
Stuart Dootson22-Jun-09 22:29
professionalStuart Dootson22-Jun-09 22:29 
GeneralRe: SetFilePointer() + WriteFile() Problems? Pin
krish_kumar22-Jun-09 22:44
krish_kumar22-Jun-09 22:44 
GeneralRe: SetFilePointer() + WriteFile() Problems? Pin
Stuart Dootson22-Jun-09 22:58
professionalStuart Dootson22-Jun-09 22:58 
GeneralRe: SetFilePointer() + WriteFile() Problems? Pin
krish_kumar23-Jun-09 0:06
krish_kumar23-Jun-09 0:06 
GeneralRe: SetFilePointer() + WriteFile() Problems? Pin
Stuart Dootson23-Jun-09 0:08
professionalStuart Dootson23-Jun-09 0:08 
GeneralRe: SetFilePointer() + WriteFile() Problems? Pin
krish_kumar23-Jun-09 0:18
krish_kumar23-Jun-09 0:18 
GeneralRe: SetFilePointer() + WriteFile() Problems? Pin
Stuart Dootson23-Jun-09 0:22
professionalStuart Dootson23-Jun-09 0:22 
GeneralRe: SetFilePointer() + WriteFile() Problems? Pin
krish_kumar23-Jun-09 1:13
krish_kumar23-Jun-09 1:13 
QuestionCalling C#dll via C++ from Java Pin
Santhosh Sebastian22-Jun-09 21:12
Santhosh Sebastian22-Jun-09 21:12 
AnswerRe: Calling C#dll via C++ from Java Pin
KarstenK22-Jun-09 21:26
mveKarstenK22-Jun-09 21:26 
GeneralRe: Calling C#dll via C++ from Java Pin
Santhosh Sebastian22-Jun-09 21:44
Santhosh Sebastian22-Jun-09 21:44 
GeneralRe: Calling C#dll via C++ from Java Pin
Stuart Dootson22-Jun-09 22:31
professionalStuart Dootson22-Jun-09 22:31 
GeneralRe: Calling C#dll via C++ from Java Pin
Santhosh Sebastian22-Jun-09 23:42
Santhosh Sebastian22-Jun-09 23:42 
GeneralRe: Calling C#dll via C++ from Java Pin
Stuart Dootson22-Jun-09 23:49
professionalStuart Dootson22-Jun-09 23:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.