When using an NAudio MMDevice, how do I get the brand name of the device? - device

I can get the regular name of a device just fine through NAudio's MMDevice in VB.Net, but this often turns out to be something like "Speakers" or "Microphone". I need to get both that basic, generic name, as well as the brand name (like "Realtek High Definition Audio"). There doesn't to be any property or function attached to MMDevice that'll handle that, but that doesn't seem like something the whole API would just skip over like that. This is for Windows 7.

Wait, nevermind, guys. Sorry. Apparently I overlooked a function called DeviceFriendlyName. Sorry, I looked through the list and didn't see it for some reason. But if anybody searches for this information, just call that function on your MMDevice variable.

Related

langRestrict=en doesn't return any values anymore

I used to use queries like this when searching:
https://www.googleapis.com/books/v1/volumes?q=isbn:0590353403&langRestrict=en&maxResults=5&printType=books&showPreorders=false&fields=items(volumeInfo(authors,imageLinks,pageCount,title,industryIdentifiers))
Recently however, it seems that using langRestrict=en no longer return results. If I remove that, it works again.
https://www.googleapis.com/books/v1/volumes?q=isbn:0590353403&maxResults=5&printType=books&showPreorders=false&fields=items(volumeInfo(authors,imageLinks,pageCount,title,industryIdentifiers))
If I look at the book in question, the language is listed as language="un" now:
https://www.googleapis.com/books/v1/volumes?q=isbn:0590353403
Can anyone explain what changed, and should I be using langRestrict=un instead? (What language is un? I can't seem to find information on it.) Thank you.

How to write Windows Event log records with non-existing source

Somebody gave me a testing program to write records into the windows event log (but I don't have the sources). I understand the general way of writing and reviewing event log, but that program behaves very special in a way that I can write records, that have a source which does not exist.
There is not even a registry entry in .../eventlog/application, hence no formatting libs.
If I try that from my own code, I can write such a record but the Windows Event Viewer then always tells me something about "description cannot be found" (which is correct and I understand why that happens).
The question is now: Since that foreign test prog CAN do it, it must be possible somehow - but HOW?
Many thx!! :-)
OK, finally I found it (also, got the sources) - the prog creates the registry entry (probably happens when calling CreateEventSource()), it was just not visible until refreshing regedit :-|
And, it DOES register a formatting lib, only that it is something I cannot rely on: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\EventLogMessages.dll
Or, can I?
Ah, here we go for an explanation:
Difference between EventLog.WriteEntry and EventLog.WriteEvent methods
So, I cannot, as I'm not using .Net ... :-|
Now, if I NOW send another event from MY prog (with the same, newly created source, as the foreign prog), I see it in the event viewer normally.
That means, WriteEntry() actually does not write a different/special type of evt log record containing the text directly (contrary to the standard method of writing just a msg catalog ID + params) but rather there must be some trick in the formatting lib to make the EventViewer apply some kind of "default" formatting.
Any ideas how I could accomplish this? Except just copying the EventLogMessages.dll above? :-)
OK, finally found an answer about this one in http://msdn.microsoft.com/en-us/magazine/cc163446.aspx
"This file is called EventLogMessages.dll, and it contains 65,536 event descriptions, each of which consists of the string "%1", a placeholder for whatever string you want to write"
I was hoping for something like "messageid=*" but that seems to be too simple :-|
But maybe somebody else is interested in whats happening here ...

Using wildcards in Selenium IDE

I'm somewhat new to automation, and am learning everything auto-didactically, so forgive me if my terminology is a bit off. I've searched hi and low for an answer to this question, and I can't seem to find anything. I presume it's my small vocabulary when it comes to this stuff... anyway...
I'm attempting to write a test that performs all the actions necessary to complete a tutorial by using the recorder. However, for one particular step, the element ID changes. For example, the ID I'm trying to click is this:
//li[#id='message_661119']/div[2]/div[2]/a/img
However, for each new user that is performing the tutorial "quest", the number of the id changes.
Is there anyway to get Selenium to recognize, or use, wildcards? Example:
//li[#id='message_******']/div[2]/div[2]/a/img
Of course, the example above does not work.
Any advice would be immensely helpful. Thank you!!
You can use starts-with() for this:
//li[starts-with(#id, 'message_')]/div[2]/div[2]/a/img
It's one of the examples mentioned in Locating Techniques in Selenium's docs for starts-with().
In Target field of the command in Selenium IDE where you can see message_123123 click on a dropdownlist and choose an option which is related to xpath:idRelative or if this one doesn't work then try another options which do not include that annoying message_123123 so this way you'll identify webpage element by it's location but not id. I solved my issue this way

Input Method (IMKit) setup trouble

I'm trying to create a new input method using Input Method Kit. The documentation is very lacking, but I believe I'm setting the project up correctly and I place the input method into ~/Library/Input Methods after building it. However, I see strange behavior when looking at the list of input sources in Language & Text preferences.
The NumberInput sample seems to work fine for me, and there are no differences in my new input method that I can find, aside from the values for tsInputMethodIconFileKey, InputMethodConnectionName, InputMethodServerControllerClass, and CFBundleIdentifier in Info.plist. But I'm seeing these issues:
When I use my desired bundle identifier for the app, nothing shows up in the list. (This bundle ID doesn't exist anywhere else on my system.)
Changing the bundle identifier to be the same as the NumberInput sample makes it show up in the list, but when I select it, it sometimes duplicates entries in the list, and generally behaves weirdly.
As I make slight modifications to the bundle identifier, it seems to behave normally, but once I change it back to the original identifier (the desired one) it disappears from the list.
If I quit the process associated with my input method, selecting it in the menu again doesn't relaunch it.
Does anyone have any idea what's going on? Apple's documentation for IMKit is nearly nonexistant and it doesn't seem like many people have documented their own attempts at making input methods. Is there something I'm missing?
Thanks in advance!
P.S. Yes I've tried logging out and back in and even restarting my computer, nothing seems to significantly change the behavior I mentioned above.
This worked for me. Try this: make sure your bundle identifier contains "inputmethod" somewhere in the path. Example "com.blugs.inputmethod.IPAPalette". Yes AFAIK it's totally undocumented. Yes the documentation is awful. Hope this helps! Cheers.
The accepted answer here is very useful, adding .inputmethod. to your Bundle ID.
I'll add that I found a bit of documentation for this in TextInputSources.h, which contains a large number of comments and documentation not found in the Input Method Kit overview docs. Worth a read.
Carbon > Frameworks > HIToolbox > TextInputSources.h
In the Info.plist file, the value for the CFBundleIdentifier key must be a string that includes ".keyboardlayout."; typically this might be something like "com.companyname.keyboardlayout.MyKeyboardLayouts" (Before Leopard, it was required to be a string that began "com.apple.keyboardlayout", even for keyboard layouts not supplied by Apple).
and
If this key is not specified, an InputSourceID will be constructed by combining the BundleID with an InputModeID suffix formed by deleting any prefix that matches the BundleID or that ends in ".inputmethod."

VB6 intellisense problems

I am writing a simple application that utilizes option(radio) buttons in vb6.
I am attempting to make different buttons and labels appear based on which optionbutton has been selected. I attempted to use an if statement that looks like this:
If (EditOpenTicketRadioButton.value = True) Then
label.visible = true
elseIf(...) then....
and on.
things start acting strange when I begin to type the period after EditOpenTicketRadioButton. the only options that intellisense gives me are Count, Item, LBound, and UBound. I know from internet examples It should be like the above example right? it will not run with that syntax it gives me an error that states: compile Error: Method or data member not found. then it points me to the Load method for my form...
If anyone can help me make sense of this it would be greatly appreciated.
Thanks in advance!
From the (very, very) limited information you gave, I can only assume EditOpenTicketRadioButton is a victim of extremely poor name choice and is actually an array of radio buttons.
If that's the case, you need to figure out which button you mean, and use it like EditOpenTicketRadioButton(0) or whatever.

Resources