problem with header files - Programmer

This is a discussion on problem with header files - Programmer ; Hi I am working with Visual studio 2005. I have a problem here .The problem looks simple but yet could not solve it, CListCtrlOne.cpp ******************** #inlcude "tab1.h" #include "MyListCTrlSomeX.h" CTab1 *tab1; CMyListCtrlSomeX *mylistCtrl; No Problem until when I wanted to ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: problem with header files

  1. problem with header files

    Hi

    I am working with Visual studio 2005.
    I have a problem here .The problem looks simple but yet could not solve
    it,


    CListCtrlOne.cpp
    ********************
    #inlcude "tab1.h"
    #include "MyListCTrlSomeX.h"

    CTab1 *tab1;
    CMyListCtrlSomeX *mylistCtrl;

    No Problem until when I wanted to use like this

    CListCtrl2.cpp
    ********************
    #inlcude "tab1.h"
    #include "MyListCTrlSomeY.h"

    CTab1 *tab1;
    CMyListCtrlSomeY *mylistCtrl;


    The error is I am missing identifier before;
    If I place in tab1.h in stdafx.h folder then replace from here,I get
    the dialog ID is not getting recognised.
    I can send the code if someone can help me.
    Thanks
    Bhargs


  2. Re: problem with header files

    I don't think you've provided enough details. Exactly which identifier is it
    that is missing? And which header file defines it?

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com

    wrote in message
    news:1148503055.873311.75950@y43g2000cwc.googlegro ups.com...
    > Hi
    >
    > I am working with Visual studio 2005.
    > I have a problem here .The problem looks simple but yet could not solve
    > it,
    >
    >
    > CListCtrlOne.cpp
    > ********************
    > #inlcude "tab1.h"
    > #include "MyListCTrlSomeX.h"
    >
    > CTab1 *tab1;
    > CMyListCtrlSomeX *mylistCtrl;
    >
    > No Problem until when I wanted to use like this
    >
    > CListCtrl2.cpp
    > ********************
    > #inlcude "tab1.h"
    > #include "MyListCTrlSomeY.h"
    >
    > CTab1 *tab1;
    > CMyListCtrlSomeY *mylistCtrl;
    >
    >
    > The error is I am missing identifier before;
    > If I place in tab1.h in stdafx.h folder then replace from here,I get
    > the dialog ID is not getting recognised.
    > I can send the code if someone can help me.
    > Thanks
    > Bhargs
    >




  3. Re: problem with header files

    1>c:\samples\sample 1\mylistseriesresltsctrl.h(17) : error C2143:
    syntax error : missing ';' before '*'
    When I click F4 and it points to CTab1*


  4. Re: problem with header files

    Give us a clue please.

    What is on line 17 of mylistseriesresultsctrl.h? Where is CTab1 defined?
    Also, where is mylistseriesresltsctrl.h included--you didn't even mention
    that in your original post.

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com

    wrote in message
    news:1148508175.496024.58410@i40g2000cwc.googlegro ups.com...
    >1>c:\samples\sample 1\mylistseriesresltsctrl.h(17) : error C2143:
    > syntax error : missing ';' before '*'
    > When I click F4 and it points to CTab1*
    >




  5. Re: problem with header files

    ok sorry Jonathan
    Here it is .
    line 17 points to CTab1 * tab1;

    CTab1 is derived from CDialog;

    I am using Visual Studio 2005 and it does not ask for the file as I
    created by using Project ->Create new class

    code *************
    #include"IconsListCtrl.h"
    //#include "Tab1.h"

    class CMyListSeriesResltsCtrl : public CListCtrl
    {
    DECLARE_DYNAMIC(CMyListSeriesResltsCtrl)

    public:
    CMyListSeriesResltsCtrl();
    virtual ~CMyListSeriesResltsCtrl();
    void SetApply();
    CIconsListCtrl *m_IconListCtrl; // new class
    //CTab1 *tab1;
    void SetIconToFill(CIconsListCtrl *pListCtrl ){
    m_IconListCtrl = pListCtrl;

    }


  6. Re: problem with header files

    Its still not clear what you are doing. CTab1 needs to forward declared or
    its header file included in header file of CMyListSeriesResltsCtrl.

    Something like:

    class CTab1;

    class CMyListSeriesResltsCtrl : public CListCtrl
    {
    .....
    CTab1 *tab1;
    } ; // Note this semi colon. This needs to be there as well.


    --
    Ajay Kalra [MVP - VC++]
    ajaykalra@yahoo.com


    wrote in message
    news:1148509901.686395.183420@i40g2000cwc.googlegr oups.com...
    > ok sorry Jonathan
    > Here it is .
    > line 17 points to CTab1 * tab1;
    >
    > CTab1 is derived from CDialog;
    >
    > I am using Visual Studio 2005 and it does not ask for the file as I
    > created by using Project ->Create new class
    >
    > code *************
    > #include"IconsListCtrl.h"
    > //#include "Tab1.h"
    >
    > class CMyListSeriesResltsCtrl : public CListCtrl
    > {
    > DECLARE_DYNAMIC(CMyListSeriesResltsCtrl)
    >
    > public:
    > CMyListSeriesResltsCtrl();
    > virtual ~CMyListSeriesResltsCtrl();
    > void SetApply();
    > CIconsListCtrl *m_IconListCtrl; // new class
    > //CTab1 *tab1;
    > void SetIconToFill(CIconsListCtrl *pListCtrl ){
    > m_IconListCtrl = pListCtrl;
    >
    > }
    >




+ Reply to Thread