Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. mmioInstallIOProcA not working???

mmioInstallIOProcA not working???

Scheduled Pinned Locked Moved Visual Basic
helpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DK KiloDunse
    wrote on last edited by
    #1

    Hi. I'm trying to play an .AVI file from a .dll, but the mmioInstallIOProcA fails. It returns NULL (eg. error) The code is: In module: Declare Function mmioInstallIOProcA Lib "winmm" _ (ByVal fccIOProc_4 As String, ByVal pIOProc As Integer, ByVal dwFlags As Integer) As Integer Public Function AsAny(ByVal obj As Object) As IntPtr Dim MyGC As GCHandle = GCHandle.Alloc(obj, GCHandleType.Pinned) 'get address of variable in pointer variable AsAny = MyGC.AddrOfPinnedObject() End Function Public Const MMIO_INSTALLPROC = &H10000 'mmioInstallIOProc: install MMIOProc Public Const MMIO_GLOBALPROC = &H10000000 'mmioInstallIOProc: install globally Public Const MEY = &H2059454D 'This is the value of "MEY " run through FOURCC In form: Public Delegate Function IOProc(ByRef lpMMIOInfo As MMIOINFO, ByVal uMessage As Integer, ByVal lParam1 As Integer, ByVal lParam2 As Integer) As Integer Public Structure MMIOINFO Public dwFlags As Integer Public fccIOProc As Integer Public pIOProc As Integer Public wErrorRet As Integer Public htask As Integer Public cchBuffer As Integer Public pchBuffer As String Public pchNext As String Public pchEndRead As String Public pchEndWrite As String Public lBufOffset As Integer Public lDiskOffset As Integer Public adwInfo0 As Integer Public adwInfo1 As Integer Public adwInfo2 As Integer Public adwInfo3 As Integer Public adwInfo4 As Integer Public dwReserved1 As Integer Public dwReserved2 As Integer Public hmmio As Integer End Structure In function: hInst = LoadLibrary("C:\test.dll") hRsrc = FindResource(hInst, "#101", "AVI") hGlobal = LoadResource(hInst, hRsrc) lpData = LockResource(hGlobal) fileSize = SizeofResource(hInst, hRsrc) Dim IODlgPro As IOProc IODlgPro = AddressOf myIOProc Dim res As Integer res = mmioInstallIOProcA(MEY, AsAny(IODlgPro).ToInt32, MMIO_INSTALLPROC + MMIO_GLOBALPROC) Error comes here.... returns 0 'Play the AVI file res = mciSendString("open AVI.MEY+ type avivideo alias AVI parent " & ParentHandle & " style child", 0&, 0&, 0&) DisplayError(res) res = mciSendString("play AVI", 0&, 0&, 0&) And ideers?

    D 1 Reply Last reply
    0
    • D DK KiloDunse

      Hi. I'm trying to play an .AVI file from a .dll, but the mmioInstallIOProcA fails. It returns NULL (eg. error) The code is: In module: Declare Function mmioInstallIOProcA Lib "winmm" _ (ByVal fccIOProc_4 As String, ByVal pIOProc As Integer, ByVal dwFlags As Integer) As Integer Public Function AsAny(ByVal obj As Object) As IntPtr Dim MyGC As GCHandle = GCHandle.Alloc(obj, GCHandleType.Pinned) 'get address of variable in pointer variable AsAny = MyGC.AddrOfPinnedObject() End Function Public Const MMIO_INSTALLPROC = &H10000 'mmioInstallIOProc: install MMIOProc Public Const MMIO_GLOBALPROC = &H10000000 'mmioInstallIOProc: install globally Public Const MEY = &H2059454D 'This is the value of "MEY " run through FOURCC In form: Public Delegate Function IOProc(ByRef lpMMIOInfo As MMIOINFO, ByVal uMessage As Integer, ByVal lParam1 As Integer, ByVal lParam2 As Integer) As Integer Public Structure MMIOINFO Public dwFlags As Integer Public fccIOProc As Integer Public pIOProc As Integer Public wErrorRet As Integer Public htask As Integer Public cchBuffer As Integer Public pchBuffer As String Public pchNext As String Public pchEndRead As String Public pchEndWrite As String Public lBufOffset As Integer Public lDiskOffset As Integer Public adwInfo0 As Integer Public adwInfo1 As Integer Public adwInfo2 As Integer Public adwInfo3 As Integer Public adwInfo4 As Integer Public dwReserved1 As Integer Public dwReserved2 As Integer Public hmmio As Integer End Structure In function: hInst = LoadLibrary("C:\test.dll") hRsrc = FindResource(hInst, "#101", "AVI") hGlobal = LoadResource(hInst, hRsrc) lpData = LockResource(hGlobal) fileSize = SizeofResource(hInst, hRsrc) Dim IODlgPro As IOProc IODlgPro = AddressOf myIOProc Dim res As Integer res = mmioInstallIOProcA(MEY, AsAny(IODlgPro).ToInt32, MMIO_INSTALLPROC + MMIO_GLOBALPROC) Error comes here.... returns 0 'Play the AVI file res = mciSendString("open AVI.MEY+ type avivideo alias AVI parent " & ParentHandle & " style child", 0&, 0&, 0&) DisplayError(res) res = mciSendString("play AVI", 0&, 0&, 0&) And ideers?

      D Offline
      D Offline
      DK KiloDunse
      wrote on last edited by
      #2

      Never mind..... made it work. ;) But thanks anyway.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups