Click here to Skip to main content
15,898,941 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Problems creating Native C++ object from within C++/CLI Pin
smea5-May-10 3:21
smea5-May-10 3:21 
AnswerRe: Problems creating Native C++ object from within C++/CLI Pin
Michel Godfroid5-May-10 3:23
Michel Godfroid5-May-10 3:23 
Questionrun , show and application in my project and handle its forms Pin
iman_kh28-Apr-10 3:45
iman_kh28-Apr-10 3:45 
AnswerRe: run , show and application in my project and handle its forms Pin
Xeqtr28-Apr-10 7:14
Xeqtr28-Apr-10 7:14 
QuestionDynamic label text? Pin
Lucidation26-Apr-10 9:52
Lucidation26-Apr-10 9:52 
AnswerRe: Dynamic label text? Pin
Richard MacCutchan26-Apr-10 11:38
mveRichard MacCutchan26-Apr-10 11:38 
QuestionHow to calculate MPEG1/2 Video RTP Packet Timestamp field Pin
vijaysinh.vansadia22-Apr-10 22:57
vijaysinh.vansadia22-Apr-10 22:57 
QuestionBinaryWriter writes empty file Pin
KlaasVersteeg20-Apr-10 21:43
KlaasVersteeg20-Apr-10 21:43 
Hi,

I'm trying to write a binary file, using BinaryWriter. My code does write a file, but it is empty. This is the code I'm using:
FileStream^ fs = gcnew FileStream(Convert::ToString(fileName), FileMode::Create);
BinaryWriter^ w = gcnew BinaryWriter(fs);

int rows = fileData->GetLength(0);
int cols = fileData->GetLength(1);
try
{
    for (int row = 0; row < rows; row++){
        for (int col = 0; col < cols; col++){
            w->Write(fileData[row,col]);
        }
    }
}
finally
    {
    w->Close();
    fs->Close();
    }


Does anyone have a clue why the written files is empty?

Thanks!
AnswerRe: BinaryWriter writes empty file Pin
KlaasVersteeg20-Apr-10 21:46
KlaasVersteeg20-Apr-10 21:46 
AnswerRe: BinaryWriter writes empty file Pin
Richard MacCutchan21-Apr-10 1:41
mveRichard MacCutchan21-Apr-10 1:41 
GeneralRe: BinaryWriter writes empty file Pin
KlaasVersteeg21-Apr-10 2:18
KlaasVersteeg21-Apr-10 2:18 
GeneralRe: BinaryWriter writes empty file Pin
Richard MacCutchan21-Apr-10 4:06
mveRichard MacCutchan21-Apr-10 4:06 
GeneralRe: BinaryWriter writes empty file Pin
KlaasVersteeg21-Apr-10 4:26
KlaasVersteeg21-Apr-10 4:26 
AnswerRe: BinaryWriter writes empty file Pin
Luc Pattyn21-Apr-10 6:04
sitebuilderLuc Pattyn21-Apr-10 6:04 
GeneralRe: BinaryWriter writes empty file Pin
KlaasVersteeg21-Apr-10 20:01
KlaasVersteeg21-Apr-10 20:01 
GeneralRe: BinaryWriter writes empty file Pin
Richard MacCutchan21-Apr-10 21:13
mveRichard MacCutchan21-Apr-10 21:13 
GeneralRe: BinaryWriter writes empty file Pin
KlaasVersteeg21-Apr-10 21:56
KlaasVersteeg21-Apr-10 21:56 
QuestionGenerics problem Pin
roshihans17-Apr-10 17:02
roshihans17-Apr-10 17:02 
QuestionRe: Generics problem Pin
roshihans20-Apr-10 23:44
roshihans20-Apr-10 23:44 
AnswerRe: Generics problem Pin
Ghydo22-Apr-10 23:57
Ghydo22-Apr-10 23:57 
GeneralRe: Generics problem Pin
roshihans24-Apr-10 8:47
roshihans24-Apr-10 8:47 
GeneralRe: Generics problem Pin
Ghydo24-Apr-10 22:23
Ghydo24-Apr-10 22:23 
QuestionPassing structure form VC++ to C# Dll Pin
Anu_Bala14-Apr-10 19:05
Anu_Bala14-Apr-10 19:05 
AnswerRe: Passing structure form VC++ to C# Dll Pin
Andreoli Carlo16-Apr-10 0:27
professionalAndreoli Carlo16-Apr-10 0:27 
QuestionWindows CE 6.0 Pin
jashimu13-Apr-10 5:14
jashimu13-Apr-10 5:14 

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.