VB usage of winm.lib causes ST environment to go unstable?

Discussion of the space travel management game - Starship Tycoon

VB usage of winm.lib causes ST environment to go unstable?

Postby sumdawgy on Sat Dec 23, 2006 3:25 am

I was still having random events that sent my Starship Tycoon loopy for me..... :oops:

I finally found a culprit on my comp....

A lil' talking clock app I wrote that annouces time using wavs from my kids, nieces & nephews... ( :wink: sentimental.....)


Main Statement........
"Declare Function sndPlaysound Lib "winmm" Alias "sndPlaySoundA" _
(ByVal soundfilename As String, ByVal Flags As Long) As Long"


I'm not listing the entire module...(it's easy to find in a websearch anyway..)...besides, that function is almost all there is to the wrapper's usage anyway.

I'm using it in synch mode to play wav snippetts to make up complete times & play musical alerts.

:? anyone got any ideas? :?

-dawgy
Very funny Bones....
Scotty, please beam down Mr. Spock's Trousers!
User avatar
sumdawgy
Ships Engineer (junior)
Ships Engineer (junior)
 
Posts: 9
Joined: Fri Dec 15, 2006 9:56 pm

Postby cliffski on Sat Dec 23, 2006 12:04 pm

I use winmm within starship tycoon (using C++), for some timing related code. Maybe it conflicts?
User avatar
cliffski
Supreme Space Admiral
Supreme Space Admiral
 
Posts: 6407
Joined: Sat Feb 11, 2006 10:27 am
Location: UK

Postby sumdawgy on Sun Dec 24, 2006 6:02 pm

cliffski wrote:I use winmm within starship tycoon (using C++), for some timing related code. Maybe it conflicts?


I ran some tests and yeah....
Multiple simultaneous uses of that LIB from different processes are ......at best.....un-reliable. IT's more like a "legal" hack that MS doesn't/can't get rid of. If you're timing it with that... then that explains the moving starfield going in jerks when it's about to crash.

Hrm.
What about using an API like tick count that uses system time for your clock? The wavs normally start and retart so any instablilties work themselves out for sounds... Given that it was never intended for serious reliability, relying on it for timing could cause a heap of troubles.

:?: Could that be affecting your program when run thru the yahoo wrapper? (I don't know enough about that wrapper to more than ask.)

-dawgy
Very funny Bones....
Scotty, please beam down Mr. Spock's Trousers!
User avatar
sumdawgy
Ships Engineer (junior)
Ships Engineer (junior)
 
Posts: 9
Joined: Fri Dec 15, 2006 9:56 pm


Return to Starship Tycoon

Who is online

Users browsing this forum: No registered users and 1 guest

cron