DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: type-declaration character does not match declared data type

  1. #1
    Join Date
    May 2006
    Posts
    45

    type-declaration character does not match declared data type

    I am getting compiler error "type-declaration character does not match declared data type" . It's highlighting Left$
    LVGetItemText = Left$(objItem.Text, nRet)

    Derclarations are as below.

    Private Type LV_ITEM
    Mask As Long
    Index As Long
    SubItem As Long
    State As Long
    StateMask As Long
    Text As String
    TextMax As Long
    Icon As Long
    Param As Long
    Indent As Long
    End Type


    Public Function LVGetItemText(lParam As Long, hwnd As Long) As String
    Dim objItem As LV_ITEM
    Dim nRet As Long
    'some code
    If nRet Then
    LVGetItemText = Left$(objItem.Text, nRet)
    End If
    exit function

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    Right click on Left$ and select "Definition". It should open the Object Browser and select the Left$ method of the VBA.Strings Module. If not, it is possible that you have Left defined someplace else in your code (or another library is overloading it)

    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  3. #3
    Join Date
    May 2006
    Posts
    45
    Yes it is not opening the object browser.

    Now i m using VBA.Left$ and it's working fine.
    Thks for the help.

  4. #4
    Join Date
    Mar 2007
    Posts
    1

    Thanks

    Hehe i know this post is pretty old, but just wanna say thanks for posting your solution of vba.left$

    I just had the exact same problem as you, so thx for ur solution.

  5. #5
    Join Date
    Jan 2008
    Posts
    1
    Yeah, thank you for your solution guys!

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Do you have the proper VBA references set in your project?

Similar Threads

  1. SQL servicer script, data type for MEMO
    By DH in forum VB Classic
    Replies: 2
    Last Post: 08-08-2007, 07:03 AM
  2. Replies: 0
    Last Post: 10-11-2002, 10:52 AM
  3. ADOXCE - adDate data type
    By Shawn August in forum Mobile
    Replies: 0
    Last Post: 04-10-2002, 01:44 PM
  4. Data Junction Announces XML Junction 7.51
    By Tim Frost in forum xml.announcements
    Replies: 0
    Last Post: 04-02-2001, 10:53 AM
  5. Data type
    By Sirichai in forum VB Classic
    Replies: 2
    Last Post: 12-28-2000, 09:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center