Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Problem with "stdafx.h"

combobox

  • Please log in to reply
6 replies to this topic

#1 leoncappu85

leoncappu85

    CC Lurker

  • Just Joined
  • Pip
  • 3 posts

Posted 19 January 2011 - 11:54 AM

Hello,

I am starting to program a VCL application in Borland C++ Builder, and I have a problem when I try to include stdafx.h.

My simple code is this:

//---------------------------------------------------------------------------

#include "stdafx.h"
#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}

//---------------------------------------------------------------------------

Only with this lines I get the following Error Messages:

[C++ Warning] afxwin.h(2668): W8022 'CDialog::Create(const char *,CWnd *)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxwin.h(2702): W8022 'CStatic::Create(const char *,unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxwin.h(2739): W8022 'CButton::Create(const char *,unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxwin.h(2824): W8022 'CListBox::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxwin.h(2972): W8022 'CComboBox::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxwin.h(3039): W8022 'CEdit::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxwin.h(3066): W8022 'CScrollBar::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxwin.h(3321): W8022 'CFrameWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,const char *,unsigned long,CCreateContext *)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxwin.h(3460): W8022 'CMDIChildWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CMDIFrameWnd *,CCreateContext *)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxwin.h(3460): W8022 'CMDIChildWnd::OnUpdateFrameMenu(int,CWnd *,HMENU__ *)' hides virtual function 'CFrameWnd::OnUpdateFrameMenu(HMENU__ *)'
[C++ Warning] afxwin.h(3528): W8022 'CMiniFrameWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxdlgs.h(455): W8022 'CFindReplaceDialog::Create(int,const char *,const char *,unsigned long,CWnd *)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxdlgs.h(711): W8022 'CPropertySheet::Create(CWnd *,unsigned long,unsigned long)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxext.h(326): W8022 'CStatusBar::Create(CWnd *,unsigned long,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxext.h(441): W8022 'CToolBar::Create(CWnd *,unsigned long,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxext.h(500): W8022 'CDialogBar::Create(CWnd *,const char *,unsigned int,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxext.h(554): W8022 'CReBar::Create(CWnd *,unsigned long,unsigned long,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxext.h(727): W8022 'CSplitterWnd::Create(CWnd *,int,int,tagSIZE,CCreateContext *,unsigned long,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxdisp.h(114): W8010 Continuation character \ found in // comment
[C++ Warning] afxdisp.h(119): W8010 Continuation character \ found in // comment
[C++ Warning] afxdisp.h(125): W8010 Continuation character \ found in // comment
[C++ Warning] afxdisp.h(129): W8010 Continuation character \ found in // comment
[C++ Warning] afxdisp.h(655): W8022 'COleTemplateServer::UpdateRegistry(OLE_APPTYPE,const char * *,const char * *)' hides virtual function 'COleObjectFactory::UpdateRegistry(int)'
[C++ Warning] afxdtctl.h(69): W8022 'CDateTimeCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxdtctl.h(134): W8022 'CMonthCalCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(172): W8022 'CStatusBarCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(295): W8022 'CListCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(389): W8022 'CTreeCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(421): W8022 'CSpinButtonCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(472): W8022 'CSliderCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(501): W8022 'CProgressCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(542): W8022 'CComboBoxEx::DeleteItem(int)' hides virtual function 'CComboBox::DeleteItem(tagDELETEITEMSTRUCT *)'
[C++ Warning] afxcmn.h(584): W8022 'CHeaderCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(609): W8022 'CHotKeyCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(682): W8022 'CToolTipCtrl::Create(CWnd *,unsigned long)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(747): W8022 'CTabCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(772): W8022 'CAnimateCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(955): W8022 'CToolBarCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(1006): W8022 'CReBarCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(1094): W8022 'CRichEditCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Warning] afxcmn.h(1122): W8022 'CIPAddressCtrl::Create(unsigned long,const tagRECT &,CWnd *,unsigned int)' hides virtual function 'CWnd::Create(const char *,const char *,unsigned long,const tagRECT &,CWnd *,unsigned int,CCreateContext *)'
[C++ Error] Windows.hpp(2453): E2040 Declaration terminated incorrectly
[C++ Error] Imm.hpp(24): E2257 , expected
[C++ Error] Imm.hpp(28): E2257 , expected
[C++ Error] Imm.hpp(32): E2257 , expected
[C++ Error] Imm.hpp(36): E2257 , expected
[C++ Error] Imm.hpp(38): E2257 , expected
[C++ Error] Imm.hpp(48): E2257 , expected
[C++ Error] Imm.hpp(50): E2257 , expected
[C++ Error] Controls.hpp(2291): E2040 Declaration terminated incorrectly
[C++ Error] Controls.hpp(2385): E2316 'PCompositionForm' is not a member of 'Imm'
[C++ Error] Controls.hpp(2385): E2189 extern variable cannot be initialized
[C++ Error] Controls.hpp(2385): E2188 Expression syntax
[C++ Error] Controls.hpp(2385): E2293 ) expected
[C++ Error] Shlobj.hpp(124): E2238 Multiple declaration for 'FVSHOWINFO'
[C++ Error] shlobj.h(1487): E2344 Earlier declaration of 'FVSHOWINFO'
[C++ Error] Shlobj.hpp(125): E2238 Multiple declaration for 'FOLDERSETTINGS'
[C++ Error] shobjidl.h(2372): E2344 Earlier declaration of 'FOLDERSETTINGS'
[C++ Error] Shlobj.hpp(129): E2238 Multiple declaration for 'DESKBANDINFO'
[C++ Error] shobjidl.h(8279): E2344 Earlier declaration of 'DESKBANDINFO'
[C++ Error] Shlobj.hpp(138): E2238 Multiple declaration for 'SHELLFLAGSTATE'
[C++ Error] shlobj.h(4992): E2344 Earlier declaration of 'SHELLFLAGSTATE'

So the only thing I did was to create a new VCL project, write #include "stdafx.h" in top of the code, and add $(BDS)\include\Mfc to the Include Search Path (-I) in the project options.
Please if someone know what is happening it would be of great help!!!!!

Edited by dargueta, 19 January 2011 - 09:01 PM.
Added code tags

  • 0

#2 Flying Dutchman

Flying Dutchman

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1090 posts
  • Location:::1
  • Programming Language:C++, Python

Posted 19 January 2011 - 12:02 PM

Isnt stdafx.h Visual Studio header?
  • 0

The roots of education are bitter, but the fruit is sweet.


#3 leoncappu85

leoncappu85

    CC Lurker

  • Just Joined
  • Pip
  • 3 posts

Posted 19 January 2011 - 12:14 PM

Mmm maybe you are right, I have never worked with stdafx.h before.
What I actually need is to include a library file (named XCRFAPI.h), that inside has the following:

#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif

So I tried to include stdafx.h in my code, and there I got all the error messages. I am trying to avoid usign Visual Studio, as I have no experience with it, do you think I could do something in Borland to fix my problem?
  • 0

#4 Flying Dutchman

Flying Dutchman

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1090 posts
  • Location:::1
  • Programming Language:C++, Python

Posted 19 January 2011 - 02:49 PM

I don't have any experience with Borland's, so can't help you there. And isn't Borland kind of old? One good Visual Studio feature is the debugger, you can download express version which is free for 30 days I think, and try your code there.
  • 0

The roots of education are bitter, but the fruit is sweet.


#5 Skippy

Skippy

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 134 posts

Posted 19 January 2011 - 06:03 PM

try putting stdafx.h in angle brackets instead of quotes that way the compiler looks in the system include directory instead of the working directory.

#include <stdafx.h>

edit:

i think stdafx and one of the other headers included within the header

#include <vcl.h>

are conflicting..

why do you need stdafx? if you are using borderland I don't think you need stdafx.

Edited by Skippy, 19 January 2011 - 07:30 PM.

  • 0

#6 RenegadeFalcon

RenegadeFalcon

    CC Newcomer

  • Just Joined
  • PipPip
  • 11 posts

Posted 19 January 2011 - 07:17 PM

I don't have any experience with Borland's, so can't help you there. And isn't Borland kind of old? One good Visual Studio feature is the debugger, you can download express version which is free for 30 days I think, and try your code there.


The Express Editions of Microsoft's software are completely free, you just have to register in the first 30 days. Registering for a key is nothing more than signing in with a Windows Live ID and giving some information. Then it gives you a key, which you can use to activate the software.
  • 0

#7 leoncappu85

leoncappu85

    CC Lurker

  • Just Joined
  • Pip
  • 3 posts

Posted 20 January 2011 - 08:01 AM

Thank you, I will try Visual Studio and see what happens.
  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download