|
-
Jan 2nd, 2002, 11:24 PM
#1
Thread Starter
Addicted Member
Adding events for a control variable....hmmm, how?
Attempting to learn good ol' MFC and ran into a stumbling block that I cannot seem to get past. How does one create events from an activex "class"??
I purchased a ACTIVEX control......SaxComm. Anyway, the documentation for it just plain sucks. In the IDE, I added the registered control to the project. This added a few of the control's classes to the project. I then added a member variable to the project's dialog class:
protected:
CSaxComm m_test;
Next, in initdialog, I initialized the control:
m_test.Create("SaxComm", NULL, CRect(0,0,0,0), this, NULL);
Now, here is the problem. Without visually placing the control on the dialog, how can I create a few events that the control supprts?
Thanks!
Phil
-
Jan 3rd, 2002, 01:28 AM
#2
Thread Starter
Addicted Member
Nevermind...figured it out Here is what I did to use a windowless activex control and process events (for example in a view class):
1) Add the activex control to your project
2) Add a class member of the control type
3) Use Create or CreateEx to create the control in the views oncreate
4) Create a dummy dialog
5) Add the activex control to the dialog
6) Use classwizard to add events
7) Copy the event sink maps and event handlers to your view class
8) Delete the dummy dialog
You can always code the event sink maps yourself.
PG
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|