# Extract information from function definition returned by DefineDLLFunction

I have an application using DefineDLLFunction whose output is:

How to extract the information “DynamicDLLNamespaceDLLWrapper2” from the output above?

• Please make an effort on the formatting.. For space for a line of code, back ticks for inline code. ATM it is very ugly. – Öskå Jan 22 '14 at 11:54
• detailed info on formatting – Wojciech Jan 22 '14 at 12:24
• Part can probabl do it... – Ajasja Jan 23 '14 at 20:57
• Ajasja : Unfortunately this do not get what I want…If open1742 is my DefineDLLFunction, for open1742[[i]], i=0..4, I don’t obtain the requested information “DynamicDLLNamespaceDLLWrapper2” – rosu_constantin Jan 24 '14 at 15:45

This question was heavily edited to remove the (badly formatted) long preamble that explained the motivation. What the questioner is trying to do is call a DLL function with an argument whose type is dynamically defined in the call to DefineDLLFunction. To get the full name of this type programmatically, you need to extract the name of the dynamically-defined namespace from the function returned by DefineDLLFunction. This namespace is given by the context of the DRVUAOVoltageOut symbol, which is "WolframNETLinkDynamicDLLNamespaceDLLWrapper2" in the example (this got messed up a bit above because of bad formatting). The questioner wants to extract this context and use it to create the string name of the .NET type he wants to create to pass as an argument, which in this case will be "Wolfram.NETLink.DynamicDLLNamespace.DLLWrapper2+PT_AOVoltageOut".

Here is one way to do it. The original DefineDLLFunction call looked like this:

f = DefineDLLFunction["
public class PT_AOVoltageOut
{
public ushort chan;
public float OutputValue;
}