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

Managed C++/CLI

 
GeneralXML SAX in C++ Pin
adarsh_sebiz13-Feb-04 18:01
adarsh_sebiz13-Feb-04 18:01 
GeneralRe: XML SAX in C++ Pin
Ravi Bhavnani13-Feb-04 18:06
professionalRavi Bhavnani13-Feb-04 18:06 
Generalhelp me Pin
don7cry13-Feb-04 16:59
don7cry13-Feb-04 16:59 
QuestionAnyway to make code auto-format like it does in c#, and a few other c# formatting things? Pin
FocusedWolf13-Feb-04 16:19
FocusedWolf13-Feb-04 16:19 
GeneralReading/Writing file probs Pin
Tank_Aviator11-Feb-04 8:45
Tank_Aviator11-Feb-04 8:45 
GeneralRe: Reading/Writing file probs Pin
dj_oden14-Feb-04 1:05
dj_oden14-Feb-04 1:05 
GeneralRe: Reading/Writing file probs Pin
Nik Vogiatzis18-Feb-04 16:52
Nik Vogiatzis18-Feb-04 16:52 
GeneralRe: Reading/Writing file probs Pin
Nik Vogiatzis19-Feb-04 12:44
Nik Vogiatzis19-Feb-04 12:44 
hi james,

ok, i think i worked it out...

below is some code i wrote to do basically the same thing...

unsigned int   c, c2;
BinaryReader   *br;

br = new BinaryReader(File::OpenRead(sFilename));

c = (unsigned int) br->ReadByte();
c2 = (unsigned int) br->ReadByte();


now in my case i need to know at what point in the code i am as i get records from traffic control systems, and they give you the record length LOB as a 2-byte field followed by the actual data, however, if you don't need this capacity, then you can use the ReadByte function until you get to the end of the file...

what i did is wrap the whole thing in a try/catch block as if you attempt to read passed the EOF it will throw an exeception, so that is a good way to get out of any read loop you may have and then use it as an excuse to close the file...

anyway, hope this helps...

cheers
nik

Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
GeneralCalling Convention Trouble Pin
Pazzuzu10-Feb-04 23:54
Pazzuzu10-Feb-04 23:54 
GeneralCalling Dll's Pin
Pazzuzu10-Feb-04 3:46
Pazzuzu10-Feb-04 3:46 
GeneralSTRING* to LPTSTR Pin
bollwerj9-Feb-04 10:29
bollwerj9-Feb-04 10:29 
GeneralRe: STRING* to LPTSTR Pin
Dirk Moshage12-Feb-04 23:21
Dirk Moshage12-Feb-04 23:21 
GeneralRe: STRING* to LPTSTR Pin
bollwerj13-Feb-04 3:27
bollwerj13-Feb-04 3:27 
GeneralRe: STRING* to LPTSTR Pin
Nik Vogiatzis18-Feb-04 16:57
Nik Vogiatzis18-Feb-04 16:57 
GeneralRe: STRING* to LPTSTR Pin
bollwerj19-Feb-04 3:18
bollwerj19-Feb-04 3:18 
GeneralReal time Loop in Managed C++ Pin
Tank_Aviator8-Feb-04 11:48
Tank_Aviator8-Feb-04 11:48 
GeneralAdding XP Style Pin
Skute6-Feb-04 5:28
Skute6-Feb-04 5:28 
GeneralRe: Adding XP Style Pin
MKlucher8-Feb-04 17:21
MKlucher8-Feb-04 17:21 
GeneralRe: Adding XP Style Pin
dj_oden14-Feb-04 1:17
dj_oden14-Feb-04 1:17 
GeneralRe: Adding XP Style Pin
Skute14-Feb-04 5:20
Skute14-Feb-04 5:20 
GeneralListView Item Selection Problem Pin
bollwerj6-Feb-04 5:26
bollwerj6-Feb-04 5:26 
GeneralRe: ListView Item Selection Problem Pin
bollwerj6-Feb-04 9:23
bollwerj6-Feb-04 9:23 
GeneralRe: ListView Item Selection Problem Pin
hyph3n15-Feb-04 2:34
hyph3n15-Feb-04 2:34 
GeneralMaking a slow program run faster Pin
Tank_Aviator5-Feb-04 19:30
Tank_Aviator5-Feb-04 19:30 
GeneralRe: Making a slow program run faster Pin
dj_oden14-Feb-04 1:33
dj_oden14-Feb-04 1:33 

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.