Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

.Net API Docs: How to Find DLL Definitions

Posted on 2004-04-05
15
Medium Priority
?
708 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
0
Comment
Question by:tdenniso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
15 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10760427
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
0
 

Author Comment

by:tdenniso
ID: 10760725
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
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10760751
Are these code snippets from working programs, or are they a collection of unrelated code?

Bob
0
RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

 

Author Comment

by:tdenniso
ID: 10760870
Basically a collection of unrelated stuff. No one ever puts the includes, etc in the samples.

Tom
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10760889
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
0
 

Author Comment

by:tdenniso
ID: 10760908
I did that this morning (it sure took a while)! They only thing found were the sample snippets! ARGH!
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10760961
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
0
 

Author Comment

by:tdenniso
ID: 10761009
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
0
 

Author Comment

by:tdenniso
ID: 10761041
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
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10761042
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
0
 

Author Comment

by:tdenniso
ID: 10761073
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
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 10761086
I found Winsock2.h, and found WSAQUERYSET within the include file, but that doesn't include all the values for the namespace.  I would imagine that this comes from the Bluetooth classes.

Bob
0
 
LVL 12

Expert Comment

by:farsight
ID: 10768067
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.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

704 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