Click here to Skip to main content
15,921,884 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: is there someone can explain this code? Pin
Nick Seng11-Aug-04 15:09
Nick Seng11-Aug-04 15:09 
GeneralRe: is there someone can explain this code? Pin
Lisana11-Aug-04 15:24
Lisana11-Aug-04 15:24 
Generalhelp! error: BC30389: 'C' is not accessible in this context because it is 'Private' Pin
isnapols11-Aug-04 3:21
isnapols11-Aug-04 3:21 
GeneralRe: help! error: BC30389: 'C' is not accessible in this context because it is 'Private' Pin
Colin Angus Mackay11-Aug-04 4:00
Colin Angus Mackay11-Aug-04 4:00 
GeneralKodak Image controls Pin
Brad Fackrell11-Aug-04 3:02
Brad Fackrell11-Aug-04 3:02 
GeneralRe: Kodak Image controls Pin
Dave Kreskowiak11-Aug-04 5:18
mveDave Kreskowiak11-Aug-04 5:18 
GeneralRe: Kodak Image controls Pin
Brad Fackrell11-Aug-04 12:12
Brad Fackrell11-Aug-04 12:12 
GeneralWriting data to binary files Pin
Simon Kearn11-Aug-04 0:16
sussSimon Kearn11-Aug-04 0:16 
I need to store some data as binary in a file so that another system can read it in. Currently I am using VB 6.0 (not .NET) and have come across a few problems.

I have created a user defined type as follows;

Type mdecTask
sKeyerId As String * 9
stUTCStartSessionTime As Double
dTypingTime As Double
lTypingCount As Long
dAdminTime As Double
lAdminCount As Long
dVuiTime As Double
lVuiCount As Long
stUTCEndSessionTime As Double
lReasonForEndSession As Long
sOtherReason As String * 256
End Type

Public mTask As mdecTask ' Defines a record.

and have then written data to some of the structure.

I have then opened the file for binary access as follows;

'Open the log file and write to it the info so far collected
miFileNumber = FreeFile
Open msFileToOpen For Binary Access Write Lock Read Write As #miFileNumber

and then I have put the data into the file and closed it as follows;

Put #miFileNumber, , mTask
Close #miFileNumber

Everything seems to work fine, but when I view the file in a hex editor the time values I store are different, for example the UTC time obtained for the mTask.stUTCStartSessionTime is 1092217616, which I can see in the structure when I debug the application, but when I view the in hex the file, it's 41467AC4, when it should be 4119EB10. The order is around the other way in the hex file, i.e. C4 7A 46 D0 41 (the D0 should be ignored, I think?) and I known that's to do with big endian and little endian.

Does anyone have a reason why this is happening. Also when I try to read the file back into the structure using 'Get' its all zeroes.

GeneralRe: Writing data to binary files Pin
Simon Kearn11-Aug-04 5:42
sussSimon Kearn11-Aug-04 5:42 
GeneralRe: Writing data to binary files Pin
Dave Kreskowiak11-Aug-04 6:01
mveDave Kreskowiak11-Aug-04 6:01 
Generalpdf conversion example program Pin
franco_8210-Aug-04 20:30
franco_8210-Aug-04 20:30 
GeneralRe: pdf conversion example program Pin
Member 53081011-Aug-04 3:17
Member 53081011-Aug-04 3:17 
GeneralRe: pdf conversion example program Pin
Dave Kreskowiak11-Aug-04 4:53
mveDave Kreskowiak11-Aug-04 4:53 
GeneralMessageBox And MsgBox Pin
beowulfagate10-Aug-04 16:25
beowulfagate10-Aug-04 16:25 
GeneralRe: MessageBox And MsgBox Pin
Nick Seng10-Aug-04 16:47
Nick Seng10-Aug-04 16:47 
GeneralRe: MessageBox And MsgBox Pin
normanordas10-Aug-04 20:45
normanordas10-Aug-04 20:45 
GeneralMultiple Form problems Pin
Achithyn10-Aug-04 15:48
Achithyn10-Aug-04 15:48 
GeneralRe: Multiple Form problems Pin
Nick Seng10-Aug-04 16:11
Nick Seng10-Aug-04 16:11 
GeneralRe: Multiple Form problems Pin
Achithyn10-Aug-04 16:37
Achithyn10-Aug-04 16:37 
GeneralRe: Multiple Form problems Pin
Nick Seng10-Aug-04 16:42
Nick Seng10-Aug-04 16:42 
GeneralRe: Multiple Form problems Pin
Achithyn10-Aug-04 18:47
Achithyn10-Aug-04 18:47 
GeneralRe: Multiple Form problems Pin
Nick Seng10-Aug-04 20:15
Nick Seng10-Aug-04 20:15 
GeneralRe: Multiple Form problems Pin
Dave Kreskowiak11-Aug-04 1:26
mveDave Kreskowiak11-Aug-04 1:26 
GeneralRe: Multiple Form problems Pin
Achithyn11-Aug-04 7:23
Achithyn11-Aug-04 7:23 
GeneralRe: Multiple Form problems Pin
Dave Kreskowiak11-Aug-04 8:57
mveDave Kreskowiak11-Aug-04 8:57 

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.