Results 1 to 7 of 7

Thread: ActiveX Dll!

  1. #1
    Guest

    Unhappy

    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.

  2. #2
    Guest
    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.

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    Guest
    thank you, I will try that immediately!

  5. #5
    Guest
    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?

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    Guest
    thank you very much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width