Results 1 to 6 of 6

Thread: <?>

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    Trying to convert a class module to a dll.

    Error:

    Private object modules cannot be used in public object modules
    as parameteres or return types for public procedures, as
    public data memebers, or as fields of public user defined
    types.

    Code:
    Error is caused by this: How do I get around it. Without
    it the resizing won't work.
    
    Public Property Let Form(ByVal fPassForm As Form)
        
    Dim iCount As Integer
    Dim cControl As Control
    
        Set fForm = fPassForm
        
        ' Store form's original Width & Height
        
        lOriginalWidth = fForm.Width
        lOriginalHeight = fForm.Height
    
        ' Use error trapping to ignore components that don't
        ' support certain properties being read at run-time
    
        On Error Resume Next
    
        ' Store the form's component's properties
    
        iCount = 0
        ReDim aControls(fForm.Controls.Count)
    
        For Each cControl In fForm.Controls
            iCount = iCount + 1
            With aControls(iCount)
                If TypeOf cControl Is Line Then
                    .lLeft = cControl.X1
                    .lTop = cControl.Y1
                    .lWidth = cControl.X2
                    .lHeight = cControl.Y2
                Else
                    .lLeft = cControl.Left
                    .lTop = cControl.Top
                    .lWidth = cControl.Width
                    .lHeight = cControl.Height
                End If
            End With
        Next ' Each
    
    End Property
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  2. #2
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    Hi,
    I think(!) that maybe you would be better off putting that code inside a function rather than a property, which might well be the cause of your problem.

    Not 100% sure though.

    Shaun
    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

  3. #3

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    We'll try that now.
    Thanks
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    You cannot pass Specific Object Types to a Property, instead try Object or Variant, i.e.
    Code:
    Public Property Let Form(ByVal fPassForm As Object)

  5. #5

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Thanks Aaron I'll give it a go .
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Thanks Aaron
    Code:
          ;)        :)
    
              
               :(         
    
     :D                   :D
      :D                 :D
        :D             :D  
           :D :D :D :D
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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