Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 22nd, 2016, 01:45 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2016
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default HOW TO OPEN VHD FILE VIA OpenVirtualDisk API?

HELLO
I WANT TO OPEN VHD FILE VIA OpenVirtualDisk
I DID NOT FIND ANY VB6 CODE
Reply With Quote
  #2 (permalink)  
Old December 24th, 2016, 11:28 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2016
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I TRIED THIS
Code:
Private Declare Function OpenVirtualDisk Lib "VirtDisk" (ByRef VirtualStorageType As PVirtualStorageType, ByVal Path As String, ByVal VirtualDiskAccessMask As Long, ByVal Flags As Long, ByVal Parameters As Long, ByVal Handle As Long) As Long
Private Type GUID
 Data1 As Long
 Data2 As Integer
 Data3 As Integer
 Data4(7) As Byte
End Type
Private Type PVirtualStorageType
   DeviceId As Long
   VendorId As GUID
End Type
Const VIRTUAL_STORAGE_TYPE_DEVICE_UNKNOWN = 0
Const VIRTUAL_STORAGE_TYPE_DEVICE_ISO = 1
Const VIRTUAL_STORAGE_TYPE_DEVICE_VHD = 2
Const VIRTUAL_STORAGE_TYPE_DEVICE_VHDX = 3

  Const VIRTUAL_DISK_ACCESS_NONE = &H0
  Const VIRTUAL_DISK_ACCESS_ATTACH_RO = &H10000
  Const VIRTUAL_DISK_ACCESS_ATTACH_RW = &H20000
  Const VIRTUAL_DISK_ACCESS_DETACH = &H40000
  Const VIRTUAL_DISK_ACCESS_GET_INFO = &H80000
  Const VIRTUAL_DISK_ACCESS_CREATE = &H100000
  Const VIRTUAL_DISK_ACCESS_METAOPS = &H200000
  Const VIRTUAL_DISK_ACCESS_READ = &HD0000
  Const VIRTUAL_DISK_ACCESS_ALL = &H3F0000
  Const VIRTUAL_DISK_ACCESS_WRITABLE = &H320000
  
   Const OPEN_VIRTUAL_DISK_FLAG_NONE = &H0
  Const OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS = &H1
  Const OPEN_VIRTUAL_DISK_FLAG_BLANK_FILE = &H2
  Const OPEN_VIRTUAL_DISK_FLAG_BOOT_DRIVE = &H4
  Const OPEN_VIRTUAL_DISK_FLAG_CACHED_IO = &H8
  Const OPEN_VIRTUAL_DISK_FLAG_CUSTOM_DIFF_CHAIN = &H10
Private Sub Form_Load()
Dim vst As PVirtualStorageType, hnd As Long
vst.DeviceId = VIRTUAL_STORAGE_TYPE_DEVICE_VHD
w = OpenVirtualDisk(vst, "E:\1.vhd", VIRTUAL_DISK_ACCESS_ATTACH_RW, OPEN_VIRTUAL_DISK_FLAG_CACHED_IO, 0&, hnd)
BUT I GOT ERROR 87 ERROR_INVALID_PARAMETER

ANY HELP PLEASE?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between lightweight BC api and the other normal API? boy18nj BOOK: Beginning Cryptography with Java 2 June 19th, 2011 08:13 PM
Vb.Net 2003 : How to Open and Read an XML File to TEXT File. Lennie VS.NET 2002/2003 0 February 12th, 2010 04:18 PM
Facebook api vs Twitter api aspless Classic ASP Basics 3 October 15th, 2009 08:39 AM
Open the "Open File" dialogue box piratelordx Access VBA 4 March 14th, 2006 09:08 PM
How to open a file in c#? looooly C# 3 September 25th, 2004 03:39 AM



All times are GMT -4. The time now is 08:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.