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

C / C++ / MFC

 
AnswerRe: Showing powers, cubes and squares in a console window Pin
David Crow5-Sep-08 10:21
David Crow5-Sep-08 10:21 
AnswerRe: Showing powers, cubes and squares in a console window Pin
Sauce!7-Sep-08 1:45
Sauce!7-Sep-08 1:45 
QuestionHelp! how to force the control to display the + even though the item does not have any child items inserted Pin
DavidLeeFromKunming5-Sep-08 9:35
DavidLeeFromKunming5-Sep-08 9:35 
QuestionRe: Help! how to force the control to display the + even though the item does not have any child items inserted Pin
David Crow5-Sep-08 10:11
David Crow5-Sep-08 10:11 
AnswerRe: Help! how to force the control to display the + even though the item does not have any child items inserted Pin
DavidLeeFromKunming5-Sep-08 18:06
DavidLeeFromKunming5-Sep-08 18:06 
AnswerRe: Help! how to force the control to display the + even though the item does not have any child items inserted Pin
Mark Salsbery6-Sep-08 8:29
Mark Salsbery6-Sep-08 8:29 
GeneralRe: Help! how to force the control to display the + even though the item does not have any child items inserted Pin
DavidLeeFromKunming6-Sep-08 16:48
DavidLeeFromKunming6-Sep-08 16:48 
QuestionMultiple Events Pin
thenutz725-Sep-08 9:26
thenutz725-Sep-08 9:26 
Hello,
I am writing a BlackJack type program to learn C++/.NET. I'm, trying to raise an event from Shoe Class (DealtCutCard Event) which is used by Dealer Class. Dealer sets a flag and at the apprpriate time raises a DealerShuffles Event which the Shoe Class uses.

This code won't compile, the error is in the Shoe.h:
"improper syntax for specifying event in __hook/__unhook" line 25
"improper syntax for specifying event in __hook/__unhook" line 25
"improper syntax for specifying event in __hook/__unhook" line 25

If I comment out #include "Dealer.h" and the __hook init function this will compile, but now I can only raise events from Shoe it won't recieve events from Dealer.

How can I both call and handle events from between the same two classes?

BTW - note i NEED "Shoe.h" in Dealer because there are functions in Dealer that reference Shoes.
Using .NET 2003
Also, I tried substituting #include "Dealer.h" with class Dealer; as a predeclaration but that didn't work.



Dealer.h
#pragma once

#include "Bettor.h"
#include "Hand.h"
#include "Shoe.h"

#ifndef DEALER_H
# define DEALER_H

[event_source(native)]
[event_receiver(native)]

class Dealer
{
public:
	__event void DealerShuffles(void);
	Dealer(Shoe*);
	void InitShoeEvents(Shoe* pSource){
		__hook(&Shoe::DealtCutCard, pSource, &Dealer::ReadyToDeal);};
};
#endif 


Shoe.h
#pragma once

#ifndef SHOE_H
# define SHOE_H

#include "Dealer.h"

[event_receiver(native)]
[event_source(native)]
class Shoe
{
public:
	void Shuffle(void);
	//Initialize events from Dealer
	void InitDealEvents(Dealer* pSource){
		__hook(&Dealer::DealerShuffles, pSource, &Shoe::Shuffle);};
	//Events
	__event void DealtCutCard(void);
	//Variables
};
#endif

Questiondotted ip address to name? Pin
montiee5-Sep-08 9:06
montiee5-Sep-08 9:06 
QuestionRe: dotted ip address to name? Pin
David Crow5-Sep-08 10:19
David Crow5-Sep-08 10:19 
AnswerRe: dotted ip address to name? Pin
montiee5-Sep-08 10:48
montiee5-Sep-08 10:48 
Questionuse of "SECTION" within a hook dll ..? Pin
only_jack5-Sep-08 8:54
only_jack5-Sep-08 8:54 
QuestionCWnd not receiving PostMessage Pin
gatwork5-Sep-08 8:05
gatwork5-Sep-08 8:05 
Question[Message Deleted] Pin
hhh5-Sep-08 7:54
hhh5-Sep-08 7:54 
AnswerRe: Design Question Pin
Perspx5-Sep-08 10:17
Perspx5-Sep-08 10:17 
GeneralRe: Design Question Pin
hhh5-Sep-08 22:44
hhh5-Sep-08 22:44 
AnswerRe: Design Question Pin
john john mackey5-Sep-08 12:16
john john mackey5-Sep-08 12:16 
GeneralRe: Design Question Pin
hhh5-Sep-08 22:59
hhh5-Sep-08 22:59 
QuestionString literal expansion Pin
Jim Crafton5-Sep-08 7:44
Jim Crafton5-Sep-08 7:44 
AnswerRe: String literal expansion Pin
Michael Dunn5-Sep-08 8:07
sitebuilderMichael Dunn5-Sep-08 8:07 
AnswerRe: String literal expansion Pin
Garth J Lancaster5-Sep-08 15:00
professionalGarth J Lancaster5-Sep-08 15:00 
Questionhow to read data from com port Pin
manju23reddy5-Sep-08 7:40
manju23reddy5-Sep-08 7:40 
QuestionVC++ and CRystalReport Pin
kasi145-Sep-08 7:39
kasi145-Sep-08 7:39 
AnswerRe: VC++ and CRystalReport Pin
liquid_6-Sep-08 10:48
liquid_6-Sep-08 10:48 
QuestionThreads Pin
bhanu_85095-Sep-08 3:35
bhanu_85095-Sep-08 3:35 

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.