Click here to Skip to main content
15,904,155 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VTables Pin
Hostalet Wandosell3-Sep-02 0:59
Hostalet Wandosell3-Sep-02 0:59 
GeneralRe: VTables Pin
Jeremy Pullicino3-Sep-02 2:06
Jeremy Pullicino3-Sep-02 2:06 
GeneralRe: VTables Pin
Joaquín M López Muñoz3-Sep-02 2:59
Joaquín M López Muñoz3-Sep-02 2:59 
GeneralRe: VTables Pin
Mike Nordell4-Sep-02 0:01
Mike Nordell4-Sep-02 0:01 
Generalpointer to property page Pin
Kash3-Sep-02 0:42
Kash3-Sep-02 0:42 
GeneralRe: pointer to property page Pin
Jawache3-Sep-02 0:50
Jawache3-Sep-02 0:50 
GeneralRe: pointer to property page Pin
Pavel Klocek3-Sep-02 0:50
Pavel Klocek3-Sep-02 0:50 
GeneralFILE and _FILEX problems.. Pin
Jawache3-Sep-02 0:41
Jawache3-Sep-02 0:41 
I am openeing a file using fopen and FILE*.

I am getting problems with this structure later It seems to think the FILE is a
_FILEX structure?!?!?!

When I open the file the call stack is.

fopen
_fsopen
_getstream


and the _getstream function definately returns a FILE object in the line

stream.c >>>>>>
retval = (FILE *)__piob[i];



but later it tries to read from the FILE stream using fgets. The call stack here
is

fgets
_lock_file


There is an exception in _lock_file I've figured out what it is and basicaly the
system thinks the FILE structure is a _FILEX structure and tries to access a non
existant member variable so it asserts.


void __cdecl _lock_file (
        void *pf
        )
{
        /*
         * The way the FILE (pointed to by pf) is locked depends on whether
         * it is part of _iob[] or not
         */
        if ( (pf >= (void *)_iob) && (pf <= (void *)(&_iob[_IOB_ENTRIES-1])) )
            /*
             * FILE lies in _iob[] so the lock lies in _locktable[].
             */
            _lock( _STREAM_LOCKS + ((FILE *)pf - _iob) );
        else
            /*
             * Not part of _iob[]. Therefore, *pf is a _FILEX and the
             * lock field of the struct is an initialized critical
             * section.
             */
            EnterCriticalSection( &(((_FILEX *)pf)->lock) );
}



An exception is raised at
EnterCriticalSection( &(((_FILEX *)pf)->lock) );


I have a STRONG suspision its a simple project settings or maybe library linkage
problem since I have the exact same code in another application and it works
fine....

Working on VC6 SP5
Windows 2000 SP2

Asim Hussain
e: asim@jawache.net
w: www.jawache.net
GeneralRe: FILE and _FILEX problems.. Pin
Tomasz Sowinski3-Sep-02 0:48
Tomasz Sowinski3-Sep-02 0:48 
GeneralRe: FILE and _FILEX problems.. Pin
Jawache3-Sep-02 0:59
Jawache3-Sep-02 0:59 
GeneralRe: FILE and _FILEX problems.. Pin
Tomasz Sowinski3-Sep-02 1:02
Tomasz Sowinski3-Sep-02 1:02 
GeneralRe: FILE and _FILEX problems.. Pin
Jawache3-Sep-02 1:10
Jawache3-Sep-02 1:10 
GeneralStopping the machine hibernating or going into standby Pin
Dave Merrifield3-Sep-02 0:01
Dave Merrifield3-Sep-02 0:01 
GeneralRe: Stopping the machine hibernating or going into standby Pin
Tomasz Sowinski3-Sep-02 0:19
Tomasz Sowinski3-Sep-02 0:19 
GeneralRe: Stopping the machine hibernating or going into standby Pin
Dave Merrifield3-Sep-02 3:54
Dave Merrifield3-Sep-02 3:54 
GeneralRe: Stopping the machine hibernating or going into standby Pin
Tomasz Sowinski3-Sep-02 3:58
Tomasz Sowinski3-Sep-02 3:58 
GeneralRe: Stopping the machine hibernating or going into standby Pin
Dave Merrifield3-Sep-02 4:02
Dave Merrifield3-Sep-02 4:02 
General#pragma code_seg Pin
-Dy2-Sep-02 23:56
-Dy2-Sep-02 23:56 
GeneralRe: #pragma code_seg Pin
Tomasz Sowinski3-Sep-02 0:09
Tomasz Sowinski3-Sep-02 0:09 
GeneralRe: #pragma code_seg Pin
Mike Nordell4-Sep-02 0:04
Mike Nordell4-Sep-02 0:04 
QuestionCan I override CEdit to show text in many color. Pin
sonshiro2-Sep-02 23:03
sonshiro2-Sep-02 23:03 
AnswerRe: Can I override CEdit to show text in many color. Pin
Tomasz Sowinski2-Sep-02 23:20
Tomasz Sowinski2-Sep-02 23:20 
GeneralRe: Can I override CEdit to show text in many color. Pin
sonshiro2-Sep-02 23:43
sonshiro2-Sep-02 23:43 
QuestionVirtual keyboard : should I do it myself ? Pin
Jerome Conus2-Sep-02 22:41
Jerome Conus2-Sep-02 22:41 
AnswerRe: Virtual keyboard : should I do it myself ? Pin
Andreas Saurwein3-Sep-02 0:29
Andreas Saurwein3-Sep-02 0:29 

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.