Click here to Skip to main content
16,008,719 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to copy binary data? How to get its length? Pin
Daniel Turini3-Aug-02 11:46
Daniel Turini3-Aug-02 11:46 
AnswerRe: how to copy binary data? How to get its length? Pin
Daniel Turini3-Aug-02 11:46
Daniel Turini3-Aug-02 11:46 
GeneralDetect an open window and active it if not active Pin
youssef3-Aug-02 5:47
youssef3-Aug-02 5:47 
Questionhow to use valarray Pin
Anonymous3-Aug-02 4:57
Anonymous3-Aug-02 4:57 
GeneralDocument/View trouble Pin
carlos del piero3-Aug-02 4:32
susscarlos del piero3-Aug-02 4:32 
GeneralRe: Document/View trouble Pin
Ernest Laurentin3-Aug-02 6:33
Ernest Laurentin3-Aug-02 6:33 
GeneralRe: this is actually how the situation is Pin
carlos dp4-Aug-02 2:25
susscarlos dp4-Aug-02 2:25 
Generalerror 1189 in mfc app. Pin
nss3-Aug-02 4:25
nss3-Aug-02 4:25 
In a non MFC app theres a try-catch thing like:

catch ( _com_error &e )
{
    _bstr_t bstrSource (e.Source());
    _bstr_t bstrDescription (e.Description());
    TRACE ( "Exception thrown for classes generated by #import" );
    TRACE ( "\tCode = %08lx\n", e.Error ());
    TRACE ( "\tCode meaning = %s\n", e.ErrorMessage ());
    TRACE ( "\tSource = %s\n", (LPCTSTR) bstrSource);
    TRACE ( "\tDescription = %s\n", (LPCTSTR) bstrDescription);

    AfxMessageBox ((LPCTSTR) bstrDescription);
}
catch (...)
{
    TRACE ( "*** Unhandled Exception ***" );
}


I am using this code in an MFC app, in a new class that I am making. When I compiled I got the error:

c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h>


When I looked this up in MSDN , I see

Fatal Error C1189
#error : user supplied error message

This error message is generated when there is an #error directive in the program. For example:

#undef _WIN32

#if !defined(_WIN32)
#error _WIN32 must be defined //error
#endif

int main() {
   return 0;
}



I only have #include "stdafx.h" in my new projects class .h file.

What can I do about this error?

Thanks,
ns
Generalall I have in my .h file is two includes and 1 import: Pin
nss3-Aug-02 4:30
nss3-Aug-02 4:30 
GeneralI have "automatic use of precompiled headers" Pin
nss3-Aug-02 4:35
nss3-Aug-02 4:35 
GeneralCRichEditCtrl MFC Pin
Anonymous3-Aug-02 1:58
Anonymous3-Aug-02 1:58 
GeneralRe: CRichEditCtrl MFC Pin
Pavel Klocek3-Aug-02 2:08
Pavel Klocek3-Aug-02 2:08 
GeneralRe: CRichEditCtrl MFC Pin
Nish Nishant3-Aug-02 3:28
sitebuilderNish Nishant3-Aug-02 3:28 
GeneralRe: CRichEditCtrl MFC Pin
Ernest Laurentin3-Aug-02 6:20
Ernest Laurentin3-Aug-02 6:20 
GeneralCRichEditCtrl MFC Pin
Anonymous3-Aug-02 1:58
Anonymous3-Aug-02 1:58 
GeneralCSplitterWnd Question Pin
Anonymous3-Aug-02 1:18
Anonymous3-Aug-02 1:18 
GeneralRe: CSplitterWnd Question Pin
Pavel Klocek3-Aug-02 2:18
Pavel Klocek3-Aug-02 2:18 
GeneralProblem In using tree control Pin
Prateeti2-Aug-02 23:23
Prateeti2-Aug-02 23:23 
GeneralModify the context menu string at runtime. Pin
Neha2-Aug-02 23:19
Neha2-Aug-02 23:19 
GeneralRe: Modify the context menu string at runtime. Pin
Nish Nishant2-Aug-02 23:27
sitebuilderNish Nishant2-Aug-02 23:27 
GeneralRe: Modify the context menu string at runtime. Pin
Neha2-Aug-02 23:57
Neha2-Aug-02 23:57 
GeneralRe: Modify the context menu string at runtime. Pin
Nish Nishant3-Aug-02 0:36
sitebuilderNish Nishant3-Aug-02 0:36 
GeneralRe: Modify the context menu string at runtime. Pin
JohnnyG3-Aug-02 5:23
JohnnyG3-Aug-02 5:23 
GeneralRe: Modify the context menu string at runtime. Pin
Neha3-Aug-02 0:27
Neha3-Aug-02 0:27 
GeneralRe: Modify the context menu string at runtime. Pin
Pavel Klocek3-Aug-02 2:29
Pavel Klocek3-Aug-02 2: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.