Click here to Skip to main content
16,012,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multiple Displays problem- how to get the absolute coordinates Pin
Checker200316-Mar-06 20:36
Checker200316-Mar-06 20:36 
AnswerAnother thing to watch for Pin
normanS16-Mar-06 18:23
normanS16-Mar-06 18:23 
GeneralRe: Another thing to watch for Pin
Checker200316-Mar-06 21:33
Checker200316-Mar-06 21:33 
GeneralRe: Another thing to watch for Pin
normanS16-Mar-06 22:51
normanS16-Mar-06 22:51 
QuestionEnable Profiling. Pin
jerry1211a16-Mar-06 9:34
jerry1211a16-Mar-06 9:34 
QuestionVisual C++ 6.0 still alive Pin
thierrypp16-Mar-06 9:32
thierrypp16-Mar-06 9:32 
AnswerRe: Visual C++ 6.0 still alive Pin
John R. Shaw16-Mar-06 13:45
John R. Shaw16-Mar-06 13:45 
QuestionProgram crashes Pin
Eikthrynir16-Mar-06 8:21
Eikthrynir16-Mar-06 8:21 
Hi! I have a problem calling a function defined in a dll, like this:

__declspec( dllexport ) __int8 __cdecl
  freadCharacter( istream &inputStream, char &destinationCharacter )
{
  inputStream >> resetiosflags( ios::skipws ) >> destinationCharacter;
  inputStream >> setiosflags( ios::skipws );
  if ( inputStream.bad( ) )
    return 0;

  return 1;
}

In the program that uses the dll, I call the function in this manner:

char c;
ifstream src( "input.dat" );
if ( !src )
{
  cerr << "Error opening file input.dat\n" << flush;
  exit( EXIT_FAILURE );
}

freadCharacter( src, c );

When I run the program, it crashes.
It crashes exactly when trying to execute this line:

inputStream >> resetiosflags( ios::skipws ) >> destinationCharacter;

Can anybody help me by telling what is wrong with my code?
Is it a real problem that I call a function defined in a dll which takes a reference to istream as a parameter? I'm asking this because if I define the function in my application, it works perfectly.

Thanks in advance!
AnswerRe: Program crashes Pin
John R. Shaw16-Mar-06 14:22
John R. Shaw16-Mar-06 14:22 
GeneralRe: Program crashes Pin
Eikthrynir16-Mar-06 23:04
Eikthrynir16-Mar-06 23:04 
GeneralRe: Program crashes Pin
John R. Shaw19-Mar-06 10:22
John R. Shaw19-Mar-06 10:22 
GeneralRe: Program crashes Pin
Eikthrynir19-Mar-06 10:27
Eikthrynir19-Mar-06 10:27 
QuestionNew Time-Date Prblms--VC7 Pin
luhfluh16-Mar-06 6:57
luhfluh16-Mar-06 6:57 
QuestionCreate Sqlite DB Pin
MyChance16-Mar-06 6:42
MyChance16-Mar-06 6:42 
AnswerRe: Create Sqlite DB Pin
Jack Puppy16-Mar-06 7:38
Jack Puppy16-Mar-06 7:38 
GeneralRe: Create Sqlite DB Pin
MyChance16-Mar-06 15:14
MyChance16-Mar-06 15:14 
QuestionMS Embedded CE Pin
Greg Barnes16-Mar-06 6:30
Greg Barnes16-Mar-06 6:30 
AnswerRe: MS Embedded CE Pin
Trollslayer16-Mar-06 8:16
mentorTrollslayer16-Mar-06 8:16 
GeneralRe: MS Embedded CE Pin
Greg Barnes16-Mar-06 9:07
Greg Barnes16-Mar-06 9:07 
Questionstring conversion Pin
big_denny_20016-Mar-06 5:35
big_denny_20016-Mar-06 5:35 
AnswerRe: string conversion Pin
Monty216-Mar-06 5:43
Monty216-Mar-06 5:43 
GeneralRe: string conversion Pin
big_denny_20016-Mar-06 6:01
big_denny_20016-Mar-06 6:01 
GeneralRe: string conversion Pin
toxcct16-Mar-06 6:04
toxcct16-Mar-06 6:04 
GeneralRe: string conversion Pin
big_denny_20016-Mar-06 6:07
big_denny_20016-Mar-06 6:07 
GeneralRe: string conversion Pin
toxcct16-Mar-06 6:14
toxcct16-Mar-06 6: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.