No sound when running this application... HELP!! And conversion to VB.NET

Posted on 2004-10-30
Last Modified: 2010-04-15

Dear EE,

First Question.

Above is a link of a simple virtual piano program using DirectX...
I downloaded it....
I have Microsoft Visual Studio.NET 2003/DirectSDK Summer 2004

The problem is when I builed the program.... THere were no sounds when I press the virtual keyboard keys...
Can someone help me out??

Second Question.
Just a very simple question... If I want to convert my C# to VB.NET files.. Is it all I need to do is just convert all the *.cs files to *.vb ( I mean just changing their language platform using for example "" ) right??

Thanks.. Your help will be highly appreciated..

Question by:joely2k
    LVL 14

    Expert Comment

    First question:
    The piano application is made for DirectX 9, so it possible doesnt work with lower versions

    Second question:
    Yes, only thing you need to do is convert the C# to VB.NET and the application should still work without extra changes.

    Author Comment

    Dear existenz2,

    Did you tried the program?
    My directx version is : DirectX 9.0c (4.09.0000.0904)   as I checked from dxdiag.....
    I even have DirectX SDK (summer 2004) installed.... I still dont know why it cant be played... :(
    LVL 14

    Accepted Solution

    I had another look at it and I found this in the code:

    string strFileName = @"c:\ding.wav";

    So it wants to play that file, but the author forgot to include it in the project. Therefor the application returns an error on:
    applicationBuffer = new SecondaryBuffer(strFileName, desc, applicationDevice);
    because it cant find the file.

    I tried replacing it with a different .wav file, but the I got an error saying the value was not in the expected range, so you'll need to play a bit with all the settings to get it to work.

    Author Comment

    YEAH~~ Thanks you so much... creditability to you..
    becos when I builed.. I cant see any error thats why I cant debug and dunno whats wrong...

    My last question on the conversion....
    Your reply
    Second question:
    Yes, only thing you need to do is convert the C# to VB.NET and the application should still work without extra changes.

    How bout the csproj?? It means we create a whole new vbproj and then just add in the forms/classes/modules... then each of them are the *.vb files itself... the results of the conversion just paste into them right?
    LVL 14

    Expert Comment

    It should be possible to convert the csproj file to an vbproj file, but I'm not sure how to do that. If it cant be done just add the converted .vb files (or code) into a new project and it should work again.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now