Click here to Skip to main content
15,914,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHook in dll Pin
yingkou4-May-04 0:31
yingkou4-May-04 0:31 
GeneralRe: Hook in dll Pin
Monty24-May-04 1:44
Monty24-May-04 1:44 
GeneralObj to Source file Pin
Gurou4-May-04 0:29
Gurou4-May-04 0:29 
GeneralRe: Obj to Source file Pin
toxcct4-May-04 0:46
toxcct4-May-04 0:46 
GeneralRe: Obj to Source file Pin
Gurou4-May-04 1:24
Gurou4-May-04 1:24 
GeneralRe: Obj to Source file Pin
toxcct4-May-04 1:27
toxcct4-May-04 1:27 
GeneralSyntax error: identifier 'x' when 2 headers include each other Pin
Ylis4-May-04 0:27
Ylis4-May-04 0:27 
GeneralRe: Syntax error: identifier 'x' when 2 headers include each other Pin
toxcct4-May-04 0:39
toxcct4-May-04 0:39 
declare one class before defining the other :
sprite.h
<font style="color:blue;">#ifndef</font> SPRITE_H
<font style="color:blue;">#define</font> SPRITE_H
<font style="color:blue;">#include</font> "SDL.h"
<font style="color:blue;">#include</font> "SDLgraphics.h"
 
<font style="color:blue;">class </font>sprite {
  <font style="color:blue;">public</font>:
    sprite(<font style="color:blue;">char </font>* p_path, <font style="color:blue;">int </font>p_noFrames);
    <font style="color:blue;">void </font>Animate(SDLgraphics &p_g);
    SDL_Surface* GetSurface() { <font style="color:blue;">return </font>m_image; }
    SDL_Rect* GetRect() { <font style="color:blue;">return </font>&m_image->clip_rect; }
  <font style="color:blue;">protected</font>:
    <font style="color:blue;">float </font>m_x, m_y;
    <font style="color:blue;">int </font>m_noFrames;
    <font style="color:blue;">int </font>m_curFrame;
    SDL_Surface* m_image;
};
<font style="color:blue;">#endif</font>
 
 
SDLgraphics.h
<font style="color:blue;">#ifndef </font>SDLgraphics_H
<font style="color:blue;">#define</font> SDLgraphics_H
<font style="color:blue;">#include </font><unknown_file1.h>   <font style="color:green;">// your post don't precise what file is included</font>

<font style="color:blue;">#include </font><unknown_file2.h>   <font style="color:green;">// because the "<>" are treated as HTML tags</font>

<font style="color:blue;">#include</font> "SDL.h"
<font style="color:blue;">#include </font>"sprite.h"
 
<font style="color:blue;">class </font>sprite;                <font style="color:green;">// Add this line here...</font>
<font style="color:blue;">class </font>SDLgraphics {
  <font style="color:blue;">public</font>:
    SDLgraphics(<font style="color:blue;">unsigned int </font>p_flags);
    <font style="color:blue;">void </font>Init(<font style="color:blue;">int </font>p_width, <font style="color:blue;">int </font>p_height);
    <font style="color:blue;">void </font>Draw(sprite *p_sprite, SDL_Rect *p_area);
    <font style="color:blue;">inline void </font>Draw(sprite *p_sprite);
    <font style="color:blue;">void </font>Flip();
  <font style="color:blue;">protected</font>:
    SDL_Surface *m_scene;
};
<font style="color:blue;">#endif</font>





TOXCCT >>> GEII power


GeneralRe: Syntax error: identifier 'x' when 2 headers include each other Pin
Ylis4-May-04 0:54
Ylis4-May-04 0:54 
GeneralRe: Syntax error: identifier 'x' when 2 headers include each other Pin
Jens Doose4-May-04 0:39
Jens Doose4-May-04 0:39 
QuestionHooking a COM port ? Pin
Brian van der Beek4-May-04 0:12
Brian van der Beek4-May-04 0:12 
GeneralSDK problem Pin
Prakash Nadar3-May-04 23:57
Prakash Nadar3-May-04 23:57 
GeneralRe: SDK problem Pin
Jens Doose4-May-04 0:19
Jens Doose4-May-04 0:19 
GeneralRe: SDK problem Pin
2249174-May-04 0:39
2249174-May-04 0:39 
GeneralRe: SDK problem Pin
Prakash Nadar4-May-04 5:19
Prakash Nadar4-May-04 5:19 
GeneralRe: SDK problem Pin
Blake Miller6-May-04 8:25
Blake Miller6-May-04 8:25 
GeneralA question about OOP Pin
nguyenvhn3-May-04 23:55
nguyenvhn3-May-04 23:55 
GeneralRe: A question about OOP Pin
Jens Doose4-May-04 0:07
Jens Doose4-May-04 0:07 
GeneralRe: A question about OOP Pin
toxcct4-May-04 0:09
toxcct4-May-04 0:09 
GeneralRe: Template Pin
Antony M Kancidrowski3-May-04 23:13
Antony M Kancidrowski3-May-04 23:13 
GeneralRe: Template Pin
Jens Doose3-May-04 23:17
Jens Doose3-May-04 23:17 
GeneralRe: Template Pin
Anonymous3-May-04 23:39
Anonymous3-May-04 23:39 
GeneralRe: Template Pin
Jens Doose4-May-04 0:12
Jens Doose4-May-04 0:12 
GeneralRe: Template Pin
Antony M Kancidrowski4-May-04 2:53
Antony M Kancidrowski4-May-04 2:53 
GeneralRe: Template Pin
Anonymous4-May-04 3:41
Anonymous4-May-04 3:41 

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.