OK, so I'm experiencing a highly frustrating set of circumstances. I am making an app that will allow you to type text and have it spoken by SAPI. That part is already done and is a windows forms app. You have the text box for typing, a control to adjust the rate, a speak button, and a menu bar that's not fully functional yet, but I have got the Exit option working. The problem comes into play when I create a function to get all the voices you have installed, grab their names and add those to the combobox. The code is valid, that's not the issue, the issue is I can't call the damn function. Now, I'm very new to C# and visual studio, which sort of presents its own unique little problems, in that getting an app up and running is stupidly easy, its more of wiring stuff up than coding. I think so far I put like 3 lines of my own code into it.
Anyway, I'm not exactly sure what the issue here is. Perhaps its me putting the function in the wrong place, but it won't let me put it some places. Anyway, fuck sakes, if I put it where it is happy to reside, which is like outside the main class but inside the namespace, I can't call it. If I type its nae, Intellisense will not pick it up, which is usually a good indicator that you're doing something wrong. If I complete it manually, it doesn't work, saying something about thinking I"m trying to define a new function rather than call one, even though I add the semicolon after the parens. Also, there is only some places in the code where intellisense picks up void, so I put it where it will, because as I said, if Intellisense doesn't try to complete something you typed, its a good indication something is wrong.
So no matter where I try to call the function from, or no matter where I place the function, no matter whether I make it static or public, it wants to throw a fit.
I don't want to create a static class just to do something I'll do once per launch of the app.
I also tried removing the function from the form.cs and putting it in in main.cs and making it public, but I couldn't even call it from somewhere else in main.cs, so if I can't do that, there's no way I'm gonna be able to call it in form.cs