Hello,
I am migrating a windows form application to an ActiveX control application and am having problems with some aspects of it.
In the original project, there was a Form and a Module.
The Reason why there was a module, it is because they used constants, global variables and declarations such as:
Public Const GWL_WNDPROC = -4 'for chaining wndproc
Global lpPrevWndProc As Long 'prev handler in chain
Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
In the module there the following SUB:
Public Sub Hook()
lpPrevWndProc = SetWindowLong(gHW, GWL_WNDPROC, AddressOf WindowProc)
End Sub
Then, there is the funcion in the module WindowProc with the following declaration:
Function WindowProc(ByVal hw As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Here is the problem.
Within the WindowProc function, there is a case which depending on the value uMsg, calls diferent functions withing the form.
eg: frmAgent.OnConnectAlert(lP
aram)
However, it seems that the module is not able to comunicate in the same manner with the User Control (ActiveX Control) because from the module I cannot "see" the user control at all...
I have no problems calling functions/method that are within the module from the user control, but I cannot call back or set any properties of the user control from the module.
Any thoughts? opinions?
thanks
Start Free Trial