We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

.Net API Docs: How to Find DLL Definitions

tdenniso
tdenniso asked
on
Medium Priority
731 Views
Last Modified: 2007-11-27
This is a general question regarding how to find the information I'm looking for in the maze of .NET documentation.

While working on the my current project, I am converting some C++ code into C#. What I have to work with is pretty much a bunch of code snippetts. An example follows:

WSAQUERYSET wsaqueryset = new WSAQUERYSET();
wsaqueryset.dwNameSpace = NS_BTH;

One of the challenges I am faced with is finding where references to constants such as: NS_BTH are defined. I'm using the .Net help systems with limited success. I need to find where NS_BTH (as a generic example) are defined in that way, I can add the proper DLL imports into my code, such as:

[DllImport("ws2.dll")]
private static extern int WSAStartup(short versionrequested,byte[] wsadata);

I can find references to things like WSAQUERYSET and know which DLL it is defined in, but when it comes to the constants, no such luck.

Bottom line, how do I go about finding this type of documentation?

Thanks!
Tom
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
What is the C++ application for?  NS_BTH is the Bluetooth Namespace constant, but I agree with you that it is very difficult to find.

Bob

Author

Commented:
Bob:

The C++ "program" is just a bunch of code snippets that I've accumulated. The new C# program will have Bluetooth functionality, hence I really need to find the definitions.

Tom
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
Are these code snippets from working programs, or are they a collection of unrelated code?

Bob

Author

Commented:
Basically a collection of unrelated stuff. No one ever puts the includes, etc in the samples.

Tom
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
My first suggestion would be to search for files that have the NS_BTH string within them.  Starting from the C:\ (or C:\Program Files if you are adventurous).

Bob

Author

Commented:
I did that this morning (it sure took a while)! They only thing found were the sample snippets! ARGH!
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
I saw some comments about the Compact Framework not having Bluetooth classes and definitions in the first version.  I think that Windows CE.NET has Bluetooth support.

Bob

Author

Commented:
I THINK I'm using the most current version. I'm using Visual Stuido 2003, and I assume it came with the newer version.

Tom

Author

Commented:
Here's a more detailed example:

The constant NS_BTH is used in structure WSAQUERYSET.

In the online docs, it says Requirements:
Runs On: Windows CE OS
Versions: .Net 4.0 and later
Defined in: Winsock2.h
Include: (blank)
Link to: (blank)

I would expect the info I need to be in the Include column.

Tom
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
Windows CE.NET is a separate product from VS.NET 2003.  The Compact Framework is part of VS.NET 2003, but I don't think that it has Bluetooth support.

Bob

Author

Commented:
Bob:

I've actually been able to compile and run some of the Bluetooth functions (which are basically winsock). i.e.:

while(lookupresult != -1)
{
lookupresult = BthNsLookupServiceNext(handle, LookupFlags.ReturnAddr | LookupFlags.ReturnName , ref bufferlen, queryset);
if(lookupresult != -1)...... (etc).

I'd think I would not be able to compile if something was missing.

Tom
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Commented:
This is an excellent resource for all issues related to interop:
  http://www.dotnetinterop.com/

Microsoft realized many developers were having issues with interop, so they created this site just for related issues.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.