|
-
Jul 17th, 2001, 11:59 AM
#1
Thread Starter
Addicted Member
calling methods using hWnd
Hello,
I made two ActiveX controls, I want to call some methods in one ocx from
the other using its hWnd property. How can I do that?
thanks,
Belal
-
Aug 13th, 2001, 05:21 PM
#2
Lively Member
As I understand it, the ocx file is the compiled version of your control which acts pretty much like a dll. hWnd is a handle (effectively a pointer) to a particular instance of a window of a particular class. (Window in this case means pretty much any distinct area of the screen rather than Form)
So what you are asking doesn't really make sense from my perspective. You may be able to import the function/method using the Declare statement and use it that way, but I don't think that it would involve hWnd.
Anyway thats my 2 cents worth.
-
Aug 13th, 2001, 06:52 PM
#3
I think you believe that
1. your controls are Window class objects, and they have a HWnd
2. you can therefore call EnumChildWindows get the hWnd and mess with the window.
If you are sublassing your control inside of your OCX, you can use SendMessage with a user-defined message, have your homegrown version of WndProc do something with it. But why bother? You wrote the control, so you got to design the interface, so use it. OR change it to meet your needs.
But Amcrae is right - a hWnd never exposes a COM interface, just the standard Windows messaging. Expecting it to expose methods/properties as an interface is something that cannot happen. Goes against COM rules. Completely.
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
|