Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Retrieve game name list? (programming Q)  (Read 1782 times)

0 Members and 1 Guest are viewing this topic.

EndTwist

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 480
  • Last login:May 26, 2022, 05:04:49 pm
  • Arg.
Retrieve game name list? (programming Q)
« on: September 09, 2003, 10:17:52 pm »
Hopefully someone can answer this for me:

1. How do I retrieve the MAME game list from VB? I've tried ShellExecute, Shell, and other various functions, but nothing works. The arguments I send are "-listfull >c:\filename.txt", but it won't save. I've also tried without the c:\, but it WILL NOT SAVE!

2. How do I get the names of NES games? Header?

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Online Online
  • Posts: 8188
  • Last login:Today at 01:38:20 pm
  • The Bears Still Suck!
Re:Retrieve game name list? (programming Q)
« Reply #1 on: September 10, 2003, 12:16:50 am »
shell should work.  However you won't know when the execution is done.  Look on deja.com for ShellAndWait.  It VB code that uses windows api to execute and wait for finish of execution.

BTW, it's easier to parse -listxml since you can use Microsoft XML 4.0 DOM docs in VB.
« Last Edit: September 10, 2003, 12:18:22 am by SirPoonga »

DinoRoger

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 139
  • Last login:October 24, 2005, 02:00:37 am
  • Hey, can I borrow a quarter?
Re:Retrieve game name list? (programming Q)
« Reply #2 on: September 10, 2003, 12:38:20 am »
Here is the Shell Wait code I use in most of my apps (VB6):

Private Declare Function OpenProcess Lib "Kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "Kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400


Sub Shell32Bit(ByVal JobToDo As String)
  On Error Resume Next
  Dim hProcess As Long
  Dim RetVal As Long
  hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell(JobToDo, 3))
    Do
      GetExitCodeProcess hProcess, RetVal
      DoEvents: Sleep 100
    Loop While RetVal = STILL_ACTIVE
End Sub


Example Use = Shell32Bit ("C:\MAME -fulllist > C:\ROMDUMP.txt")
« Last Edit: September 10, 2003, 12:51:59 pm by DinoRoger »

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Online Online
  • Posts: 8188
  • Last login:Today at 01:38:20 pm
  • The Bears Still Suck!
Re:Retrieve game name list? (programming Q)
« Reply #3 on: September 10, 2003, 03:42:53 am »
Don't you need to include some api calls there?

DinoRoger

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 139
  • Last login:October 24, 2005, 02:00:37 am
  • Hey, can I borrow a quarter?
Re:Retrieve game name list? (programming Q)
« Reply #4 on: September 10, 2003, 12:50:19 pm »
Sorry forgot that. Modified my post with all code this time.
« Last Edit: September 10, 2003, 12:50:49 pm by DinoRoger »

EndTwist

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 480
  • Last login:May 26, 2022, 05:04:49 pm
  • Arg.
Re:Retrieve game name list? (programming Q)
« Reply #5 on: September 10, 2003, 03:32:08 pm »
It still doesn't seem to work (I'm testing it on MAME 0.73)

Here is what I'm using:

Private Sub Form_Click()
Call Shell32Bit("C:\MAME\MAME -listfull > C:\ROMDUMP.txt")
End Sub

It shows the DOS window, but it wont save?! If I do it from the command prompt, it works, but otherwise--no?   ???

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:Retrieve game name list? (programming Q)
« Reply #6 on: September 10, 2003, 03:46:56 pm »
It still doesn't seem to work (I'm testing it on MAME 0.73)

Here is what I'm using:

Private Sub Form_Click()
Call Shell32Bit("C:\MAME\MAME -listfull > C:\ROMDUMP.txt")
End Sub

It shows the DOS window, but it wont save?! If I do it from the command prompt, it works, but otherwise--no?   ???

Try this:

Call Shell32Bit("CMD.EXE /c C:\MAME\MAME -listfull > C:\ROMDUMP.txt")

(replace cmd.exe with command.com for Win98)

EndTwist

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 480
  • Last login:May 26, 2022, 05:04:49 pm
  • Arg.
Re:Retrieve game name list? (programming Q)
« Reply #7 on: September 10, 2003, 03:50:51 pm »
[dramatic music]ba-ba-ba-baaaaa!

And that was the catch...It works!

Thanks everyone!  :D