?
Solved

IRDA SDK

Posted on 2002-04-17
8
Medium Priority
?
576 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 200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

850 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