INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

problem with firing event

problem with firing event

(OP)
hi i have a big problem! i hava an ATL Class wich fires an event on init. I chatch it with javascript in the ie(thats ok).
If i want to fire the event from another c++ class it doesn't work. In this c++ class i have a pointer of the ATL Class with which i fire the event. (the c++ class calls a help-function of the ATL-Event using the pointer, which fires the ATL-Event(the same as in the beginning) but nothing happens).

To check if the help-function is called from the c++ class, a property of the ATL-Class is changed within the help-function. The property is changed but the event isn't fired.

When i call the same help-function manualy from the InternetExplorer the event is fired and the IE handles it.


CPP Class:
thephone.h

class thePhone
{
  private:
  CmyPhone *cgi;

  public:    
  void setCGI(LPVOID p);
  void testFunc();
}

thePhone.cpp:

void thePhone::SetCGI(LPVOID p)
{
    this->cgi = (CmyPhone*) p;
}

void thePhone::testFunc(){
    this->cgi->helpFunction();
}

ATL-Class:
myPhone.cpp:

STDMETHODIMP CmyPhone::init(void)
{    
    
    this->tp.setValues();
    this->tp.setCGI((LPVOID) this);
    this->tp.init();
    this->tp.start();    
    this->tp.se.setRef(&tp);
    this->fval = 11;
    this->tp.testFunc();        //also works!!!!
      return S_OK;
}

STDMETHODIMP CmyPhone::helpFunction(void)
{
        //works only if fired manualy from Internetexplorer
    this->Fire_myEvent

        //is always changed
    this->fval = this->fval + 22;

    return S_OK;
}





Please help me i don't know what to do!! MFG Tos

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close