-
I cant seem to get the activex dll to work,
I declared all the subs as public, then when I tried to compile VB said something about
"private object modules cannot be used in public object modules as parameters or return types for public procedures, as public data members, or fields as public user defined types"
and when I declared all the subs as private I couldnt access any of them when I made a referance to the DLL.
-
I see the problem, but I dont know how to fix it
Code:
'this gives the error
Sub FormDrag(frm As Form)
ReleaseCapture
Call SendMessage(frm.hwnd, 161, 2, 0)
End Sub
'this doesnt
Sub FormDrag()
ReleaseCapture
Call SendMessage(frm.hwnd, 161, 2, 0)
End Sub
and I need the arguments.
-
You could pass frm as Object instead of Form, but then you could pass any object, you could of course use typename and check if it's a form
-
thank you, I will try that immediately!
-
when I check to see if the object is
"Form"
OR
Form (without the quotes)
it thinks its not a form and the code doesnt work, but if I dont check to see if its a form then it works.....
whats wrong?
-
I think it returns the form name, since it's the name of the class
Here's another better solution
Code:
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
'you put this
Sub FormDrag(frm As Form)
Dim length As Long, classname As String * 255
length = GetClassName(Me.hwnd, classname, 255)
If Left(classname, length) <> "ThunderForm" Then Exit Sub
ReleaseCapture
Call SendMessage(frm.hwnd, 161, 2, 0)
End Sub
-