Writing to an _iobuf in a DLL called from a multithreaded console app 
Author Message
 Writing to an _iobuf in a DLL called from a multithreaded console app

I am trying to write to a trace log from inside a DLL.  In the main
application I have allocated a structure using malloc().  One of the
elements is FILE *fptrace.  A pointer to this dynamically allocated
structure is then passed as an argument to the DLL function.  When the
function is called I get an application error (instruction at 0x77f6cc66
referenced memory at 0x00000010. memory couldn't be written).  Upon
debugging I found the following call trace:



_lock_file(void * 0x004bb168) line 228
fprintf(_iobuf * 0x004bb168, const char * 0x1005b4b4) line 62 + 9 bytes
vmSetupInOutConx(_OMEGACONTEXT * 0x00db55e8, unsigned long 0x80000001,
unsigned int 0x00000000, unsigned int 0x00000000, int 0x00000001, int
0x00000003) line 17 + 32 bytes
main(int 0x00000002, char * * 0x00dc0ee0) line 330 + 46 bytes
mainCRTStartup() line 206 + 25 bytes

Am I wrong in thinking this should work?  It does work if it is linked as a
static lib.

David George
Onyx Software



Tue, 20 Mar 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Multithreaded App calls a DLL many times

2. DLL: recognising windows or console app. calls

3. Need help converting a console app to windows app with a DLL

4. Problem calling VB COM dll from VC++ multithreaded COM EXE client

5. VB calling multithreaded DLL

6. Multithreaded DLL calling VB

7. settings multithreaded DLL/multithreaded

8. writing c++ client for events from console app

9. Writing to the console in a windows app

10. A console app written in MFC

11. VC 4.0 console apps - Is it possible to write a straight C app that calls an OCX?

12. Building a console app that doesn't require mscoree.dll in Visual C++ .NET

 

 
Powered by phpBB® Forum Software