Solved

IRDA SDK

Posted on 2002-04-17
8
550 Views
Last Modified: 2012-06-21
hi

I developed a programme using IRDA SDK .

the following code gives me the error even i included winsock32.lib or ws2_32.lib.

The platform SDK clearly specifies IRDA support.


the WSAGetLastError() returns me  10047
stating "Address family not supported by protocol family. "

this is from MSDN :

SOCKET ServSock;

     if ((ServSock = socket(AF_IRDA, SOCK_STREAM, 0)) == INVALID_SOCKET)
     {
             printf("\n error in sockets : %d", WSAGetLastError());
             return;
     }


apart form this if any one give me a sample code on IRDA it will be helpful.


Many Thanks!!!
0
Comment
Question by:havman56
[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
8 Comments
 

Accepted Solution

by:
adamretter earned 50 total points
ID: 6950957
I also receive the same problem on my WinXP Pro system.

If you search the Platform SDK it mentions using the IrDA the same way as tcp/ip sockets, however this does not seem to work for yourself of myself, however I dont have an IrDA port physically connected to my machine - so perhaps that is the problem.

In the PatformSDK it also mentions IrCOMM which is an older way of doing IR communication, this has been replaced by IrDA sockets now as far as I can see but may still be work a look.
0
 

Expert Comment

by:adamretter
ID: 6950971
I also receive the same problem on my WinXP Pro system.

If you search the Platform SDK it mentions using the IrDA the same way as tcp/ip sockets, however this does not seem to work for yourself of myself, however I dont have an IrDA port physically connected to my machine - so perhaps that is the problem.

In the PatformSDK it also mentions IrCOMM which is an older way of doing IR communication, this has been replaced by IrDA sockets now as far as I can see but may still be work a look.
0
 

Expert Comment

by:adamretter
ID: 6950973
I have also found this in the PlatformSDK


IrDA and Af_irda.h
The Af_irda.h header file must be included by Windows Sockets applications to support IrDA. Several incompatible versions of Af_irda.h have been distributed, including those shipped with Windows CE and Windows 95 Ir3.0 DDKs and SDKs. A common Af_irda.h header file that supports all three platforms is available with the Windows IrDA DDK. This file may continue to evolve as Windows programmatic elements and platforms continue to merge.

To compile for a target platform, one of the following must be defined:

_WIN32_WINNT
_WIN32_WCE
_WIN32_WINDOWS
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:havman56
ID: 6952761
adam

thanks for response...

i included the af_irda.h file and in my code.

i also defined _WIN32_WINDOWS in my project settings.


do u know any microsoft site so that we can palce teh querry.
0
 
LVL 2

Expert Comment

by:mirtol
ID: 7011951
Use wsock32.lib

:o)
0
 
LVL 11

Expert Comment

by:griessh
ID: 7122099
Dear havman56

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to

     "refund the points and PAQ at zero points"

since nobody had a satisfying answer for you.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 4

Author Comment

by:havman56
ID: 7122121
sure griesh

i solved the problem of my own

but iw aited long if anyone gives me good answer.

but instead of closing the question without points  i feel i can give points to adamretter ..who had taken initiative to solve my problem.


0
 
LVL 4

Author Comment

by:havman56
ID: 7122133
Thnaks for all but sopecial thaks to adam retter to take initiative in solving my rpoblem
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

728 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