Solved

IRDA SDK

Posted on 2002-04-17
8
543 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
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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

773 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