954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

API interchangable?

If I were to work on say an Instant Messenger project, and wrote the gui and event handling using wxWdigets, could I then use the windows API and use winsock to connect the two computers? Basically are API's interchangble in source code?

clutchkiller
Junior Poster
183 posts since Jul 2008
Reputation Points: 23
Solved Threads: 3
 

Try it and find out for yourself.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

well thats not very helpful =(. I am just looking for a simple idea if anyone can give me one. Nothing super in depth

clutchkiller
Junior Poster
183 posts since Jul 2008
Reputation Points: 23
Solved Threads: 3
 
well thats not very helpful =(. I am just looking for a simple idea if anyone can give me one. Nothing super in depth

The best way to learn how something works is to try it out yourself and test it on your own computer with your own code. If you want to every program professionally then you will have to learn how to do your own experiments to see what works and what doesn't.

If you want a simple answer then: yes you can probably mix the two, and no they are not interchangeable.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

I know this isn't what you are asking but may I suggest you use something a little more portable than winsock. That would be Boost asio. There are good examples of an echo client/server here: http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/examples.html

There are other options too, if you look around.

I suppose it doesn't hurt to learn the Windows API and Winsock for experience and to see another way of doing things, but someone would have to pay me very well to even think about using them.

adam1122
Junior Poster
181 posts since Mar 2009
Reputation Points: 22
Solved Threads: 28
 

You could just look at the APIs and see for yourself.

thoughtcoder
Junior Poster
141 posts since Mar 2009
Reputation Points: 231
Solved Threads: 12
 
You could just look at the APIs and see for yourself.

I suggested that too be apparently he is too lazy to do it.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
I suggested that too be apparently he is too lazy to do it.

Isn't that what "they" say about programmers: we're lazy?

adam1122
Junior Poster
181 posts since Mar 2009
Reputation Points: 22
Solved Threads: 28
 

lazy? Not at all, I know many different api's have functionality that allows you to do the same thing as winsock, but I am more familiar with winsock then other api's similar functions. Perhapes if you read my original SIMPLE question, these subtle insults would not be needed.

clutchkiller
Junior Poster
183 posts since Jul 2008
Reputation Points: 23
Solved Threads: 3
 
Isn't that what "they" say about programmers: we're lazy?

I've been called a lot of things in my life, but "lazy" isn't one of them. I would have taken only about an hour or less to find out the answer to that op's question, but he messed around for several hours trying to get someone else to do it for him.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
If I were to work on say an Instant Messenger project, and wrote the gui and event handling using wxWdigets, could I then use the windows API and use winsock to connect the two computers? Basically are API's interchangble in source code?
Try it and find out for yourself.
well thats not very helpful =(. I am just looking for a simple idea if anyone can give me one. Nothing super in depth
Perhapes if you read my original SIMPLE question, these subtle insults would not be needed.

As you see from these quotes, I did read your original post. It was you who started with the insults.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You