|
You have to include the files in the cpp files and use a forward declaration of classes:
class A;
class B
{
};
Including a header means that the code from the header will be 'pasted' instead of the include directive. Imagine then what happens in your case
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
boogalo wrote: // B.h ----
#ifndef B_H
#define B_H
#include "A.h"
class B
{
public:
B(void);
~B(void);
void foo(A* a);
};
#endif
Try the following code as this is due to deadlock for proptotypes of class A and class B
// B.h ----
#ifndef B_H
#define B_H
class A;
#include "A.h"
class B
{
public:
B(void);
~B(void);
void foo(A* a);
};
#endif
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_Laxman#ifndef B_H
#define B_H
class A;
#include "A.h"
#include "A.h" is redundant use only forward declaraton ie class A
never say die
|
|
|
|
|
sunit5 wrote: include "A.h" is redundant use only forward declaraton ie class A
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thank You all for the quick response!!!
That worked out well. now it's compiling
boogalo
|
|
|
|
|
instead fo including the header file you can do forward class declaration and
class A;
class B
{
public:
B(void);
~B(void);
void foo(A* a);
};
Regards
Anil
|
|
|
|
|
Hello,
I am trying to make a small paint application and want to allow user to draw only in three colors Black, White and Red.
I create a 4BPP DIB with a Pallete with White, Black and Red as top three entries and rest all initialized to black.
I copy the same Pallete on the Device Context.
When I Draw a Line with solid red pen and ROP set to R2_MASKPEN but the line is drawn in white color although it should appear as red.
Can anyone help me out here.
Regards,
Nauman Bin Ali
|
|
|
|
|
I've just found this in some code I've been given to maintain:
inline char * _fstrchr(const char *szStr, char ch)
{
return strchr(szStr, ch);
}
It's in a .h file, and it's used all over the place. Is there any benefit with this function over using strchr directly? I thought inlined functions basic replaced the _fstrchr token with the content of the function - as the function is not doing anything else, is there any point?
- Dy
|
|
|
|
|
-Dy wrote: thought inlined functions basic replaced the _fstrchr token
He used this token, _fstrchr , in the entire source. There's a benefit from this way:
Some time later when there is a need to alter the implementation, he only needs to modify one line, instead of using the text search function to find out all the occurrences of strchr .
Similar concept as:
#ifdef UNICODE<br />
#define _tcscpy strcpyW<br />
#else<br />
#define _tcscpy strcpyA<br />
#endif
Maxwell Chen
|
|
|
|
|
Hi
( I posted this question a time ago but not get proper reply may be it was not much clear sorry for posting again )
In windows XP we get messagefrom firewall to allow the application to run or Block when we run any application other then microsoft application by default.
I want to do something programaticaly that firewal will not ask the message before running my application (EXE) . i think we need to add in allow list programaticly;
How ca I do ti .
any idea / help / link
Thanks
Regards.
|
|
|
|
|
zahid_ash wrote: In windows XP we get messagefrom firewall to allow the application to run or Block when we run any application other then microsoft application by default.
I want to do something programaticaly that firewal will not ask the message before running my application (EXE) . i think we need to add in allow list programaticly;
Add your application.exe path at the following location in the registry.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\
StandardProfile\AuthorizedApplications\List
i have not tried the code but hope so it work. As the windows firewall adds the authorised application list here.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Another way to modify the firewall settings is to use the following command(s):
netsh firewall add allowedprogram executablepath DisplayNameInExceptionList Enable All
If you just enter netsh firewall add allowedprogram in a CMD window it will bring up the help.
Kelly Herald
Software Developer
MPC
|
|
|
|
|
I am writing a game using Visual C++ (Windows Forms Applications). But I find some difficulty in playing music while the game is started.
Could anybody answer me which function should I use and how to ??
|
|
|
|
|
Squallkin84 wrote: But I find some difficulty in playing music while the game is started.
Music will only play if you post your question in the C++/CLI[^] forum.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
I am so sorry .....
|
|
|
|
|
i wants to find a file in a given directory on MAC OS so can anybody tell me how can i use this method or other method which is able to find the file on given directory on MAC OS
Thanks & Regards
Banks
|
|
|
|
|
|
i am allready know this function is not on mac that why i posted this question on this forum and also i have written in this paragraph what is other function .
so if u know the other function then reply .
Thanks & Regards
Banks
|
|
|
|
|
If MacOS is OS/X, then you should be able to use opendir(), readdir(), e.t.c.
In OS/9, it's a completely different story.
|
|
|
|
|
Dear all,
I want to display(draw) a scroll thumb inside a window. for that I have to calculte the rectangle to draw the thumb
i have following data
1. Scroll Range - returned from a controll which is assiciated with this scroll bar. im drawing the thumb according to this value
2. the client rect of the destination window ( scroll window)
using this data, how we can calculate the scroll position. pls help me in this regard.
I have done some calculations but its not as a normal scroll bar
SaRath
|
|
|
|
|
hi my client has asked me for an IP and port that he will be opening for me so i can make web service call to his machine..
after doing some monitoring and some help my conclusion is, when we are makeing soapclient web service call we cann't force soapclient for specific port (e.g. request should be sent using port 2345 etc..)
so what should be my reply to client
MY IP and port 80 ?
------------------------------
Its not the fall that kills you; it's the
sudden stop at the end.
|
|
|
|
|
I have used a combox control in my program.
When I select item in the combox control, the item will be highlighted.
How to solve this problem?
Please help!
|
|
|
|
|
What problem?
|
|
|
|
|
The selected item was always being highlighted.
It is possible to make it not be highlighted?
|
|
|
|
|
LaHaHa wrote: The selected item was always being highlighted.
Override the CBN_SELCHANGE, use SetFocus to set the focus on the other control.
Maxwell Chen
|
|
|
|