dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: help with vb

  1. #1
    Join Date
    Jul 2007
    Posts
    3

    help with vb

    Hi, well in vb im trying to make a program that opens and shuts the disk tray from this link:

    http://www.freevbcode.com/ShowCode.asp?ID=7460

    why do I keep getting this message?

    Last edited by Phil Weber; 07-29-2007 at 04:37 PM.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Did you declare the mciSendString API function? Look at the Declarations section at the FreeVBCode link you posted.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Jul 2007
    Posts
    3
    Well i think so, how do u add the declaration, i right clicked the form > add > module > module > then pasted the declaration

  4. #4
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    35
    In the code window for Form1, scroll to the very top of the page an paste this:
    Code:
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
    That should take care of it.
    "Those who would sacrifice liberty for security, deserve neither liberty nor security." -- Benjamin Franklin

Similar Threads

  1. VB as a career choice?
    By steve in forum Careers
    Replies: 8
    Last Post: 08-08-2008, 09:46 AM
  2. re: moving from VB to C# -- more reasons
    By Jeff Johnson in forum .NET
    Replies: 6
    Last Post: 01-18-2007, 08:44 AM
  3. .NET vs. Enterprise Java: Who's Got Better Security?
    By Glen Kunene in forum Talk to the Editors
    Replies: 17
    Last Post: 03-23-2002, 01:43 AM
  4. Re: Writer's Uninformed Statements
    By Rich in forum .NET
    Replies: 38
    Last Post: 09-07-2001, 05:55 PM
  5. VB 6 does not get error from RAISERROR in SQL stored procdure
    By Allison Boughton in forum VB Classic
    Replies: 6
    Last Post: 03-05-2001, 01:27 PM

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