Results 1 to 14 of 14

Thread: Mobile application doesnt have clipboard!!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Question Mobile application doesnt have clipboard!!

    mobile application doesnt have clipboard this object, so what is the control/ object can use to replace the clipboard???

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mobile application doesnt have clipboard!!

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Question Re: Mobile application doesnt have clipboard!!

    need to imports name space? what name space ? can u tell me how to use?
    Last edited by kenny_oh; Sep 2nd, 2005 at 06:47 AM.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mobile application doesnt have clipboard!!

    They are API functions so you don't add a reference and you don't import a namespace. Look up the Declare statement in the help documentation for information on declaring and calling API functions.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: Mobile application doesnt have clipboard!!

    hehehe.....never use API before, so dont know how to use, do u mind to teach me? i need the clipboard for cut , copy and paste in mobile based application

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mobile application doesnt have clipboard!!

    Why don't you want to use the help system? That's where I learned how to call API functions. Obviously you learn things with experience, but I read the help topic for the Declare statement just like I'm suggesting you do. It even has a link at the bottom to a topic entitled "Walkthrough: Calling Windows APIs". I think that should be all you need to get you started. You may think you do but you don't need somebody to hold your hand. Just get in and do it and if you make mistakes you'll learn more for having made them yourself. If you have issues with specific things then we're always here, but I'm here to help, not to do for you.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: Mobile application doesnt have clipboard!!

    i dont hv MSDN in my vb.net..........

  8. #8
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: Mobile application doesnt have clipboard!!

    Quote Originally Posted by kenny_oh
    i dont hv MSDN in my vb.net..........
    Well you have internet.

    www.msdn.com
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mobile application doesnt have clipboard!!

    As grilkip suggests, everything in the VS help system is reproduced in the on-line MSDN library. You need to be a bit more specific with your search terms, because the on-line library contains a lot more information than just that, but a search for "declare statement" still returns the topic for the VB.NET Declare statement on the first page as the ninth result.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: Mobile application doesnt have clipboard!!

    i have declare a cut function...but dont know why cannot work...is it my declarition wrong?

    VB Code:
    1. //declare function
    2.  
    3. Private Declare Function setClipboardData Lib "Clipbd" Alias "setClipboardData" (ByVal CF_TEXT) As Long
    4.  
    5. cut function:
    6. Private Sub mnuItmCut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuItmCut.Click
    7.  
    8.         If txtMessage.SelectedText <> "" Then
    9.             setClipboardData("")
    10.             setClipboardData(txtMessage.SelectedText)
    11.             txtMessage.SelectedText = ""
    12.         End If
    13.  End Sub

  11. #11
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mobile application doesnt have clipboard!!

    SetClipboardData will return an Integer, and it takes two arguments. CF_TEXT is a constant that you need to define. I usually use a Google search to find the values of API constants. Check my CodeBank submission here for an example of how to define and use API constants.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: Mobile application doesnt have clipboard!!

    the clipboard library correct?

  13. #13
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mobile application doesnt have clipboard!!

    It looks like you've picked a curly one. I've been doing a bit of research on your behalf and it seems that using the clipborad using APIs is relatively involved. I found a VB.NET example here, but keep in mind that this is for the full .NET Framework. I think you'll find that the clipboard functions are in the Clibd library, as you already alluded to, rather than the user32 library. Also, I don't think the GlobalAlloc, etc. functions exist on PPC. It looks like there are LocalAlloc, etc. functions that do the equivalent, but I've not tested any of them myself. Never done any CF work I'm afraid. Have you posted on the Mobile Development forum? If someone's already done this stuff that's where you'll find them.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  14. #14
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mobile application doesnt have clipboard!!

    You might also want to check out this site. It is an open source class library aimed at the CF and includes an inherited TextBox class that supports Cut, Copy and Paste methods. You could either use it directly or check out their source code to see how it's done, as presumably they use the same APIs that you're trying to. I'm guessing that their source will be in C#, but the principles will be the same. I guess the main difference could be that they may be using pointers in C# that you obviously cannot do in VB.NET. It's probably worth checking out regardless.
    Last edited by jmcilhinney; Sep 3rd, 2005 at 08:36 PM.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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