|
sockets is the name of the interface/library usually used to to TCP or UDP communications.
earl
|
|
|
|
|
Salut AutreChien,
NorGUI wrote: When you say socket it is conection using TCPIP ?
Sockets are used to communicate using TCP or UDP protocols. When you say TCP/IP it means using TCP (Transmision Control Protocol) of the IP (Internet protocol) suite. It is the same thing.
NorGUI wrote: In your list there is not the DCOM, it is from you side not a possible solution ?
I am not an expert with COM, but here's what I know.
1) DCOM is an extension to COM that allow communication accross a network. In your case, on the same PC you only need COM.
2) COM is an object model. I think to use that with your applications, you would create a project to create that object. Then your applications will have to use this object, that will need to be installed (registered) on the PC. It will give you an object that you can use from different applications, independent of their programming model.
More info on COM[^]:
3) Where I work, we have created ActiveX controls to be used on IIS servers to access different resources. It works fine, but can be somewhat complex and sometimes hard to debug. I think ActiveX closely resemble COM.
4) This is all very Windows. Not portable.
5) If your application will not be exchanging data more then you mention and wont exchange across different PCs and you are already familiar with COM, then it may be the right choice for you.
Louis
* google is your friend *
|
|
|
|
|
An ActiveX control is a COM object that implements a particular set of interfaces.
earl
|
|
|
|
|
Salut Louis,
Point 5)
I do not have any experience with COM implementation and I do not know if it is easy to start and have operationel COM ?
And if I start with COM and I will comunicate between application there not on the same PC I will need to switch to DCOM and it will be again a lot of works, I think.
If I start with TCP/UDP it will possible to switch without any problem in any time to comunicate between aplication running on many PC.
I used TCP with IP connection but I do not know how to use TCP without IP (for sample when I will comunicate between aplication running ion the same PC and TCP protocol).
Thank you !
AutreChien
|
|
|
|
|
Salut AutreChien,
To communicate using TCP (TCP/IP is the same thing) you will be using sockets. You create a socket for TCP by specifying SOCK_STREAM as the familly (type). All the logic for transferring packets with this protocol is handled by the socket library so you dont need to worry about that. You then connect to a remote or local address (you probably will be using 'localhost' as the address for the local PC), then you send and receive data using the proper functions (send and recv) and giving a buffer with data to send (or buffer to receive data). It is traitforward at the base.
If you already used sockets then you already know how to do it. If not, you will need to read about sockets, there is a lot of info about that on the net and on this website.
An advice to you, do not use MFC sockets, the CSocket class, it is not very efficient. CAsyncSocket is acceptable since it does not have a lot of overhead built in it. Depending on your knowledge of sockets, you can go with basic socket object and create your own class or find a class here on CodeProject, just make sure it is not a class derived from CSocket.
If you are using Visual C++, look up the CAsyncSocket in the help (in MSDN) and you should find a sample called CHATSRVR (Chat server) it probaly will be a good starting point for what you want to do.
Here's a good reference[^] for Windows sockets.
Bonne chance et joyeuse programmation
Louis
* google is your friend *
|
|
|
|
|
I would encapsulate the code in a class so that the actual sharing mechanism would be hidden from the program. For the short term, I'd recommend using shared memory.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi all,
I want to Resize the CDialog when i Press the Mouse at the Edges of the CDialog.
Is it possible to Size Accordingly when i Press the CDialog at the Edges. and also when i Drag at the End of the Dialog it must size accordingly.
please give a snippet of code.
uday.
|
|
|
|
|
try thid
ShowWindow(SW_MAXIMIZE); in oninitdialog function
Ashish Dogra
MCA
Noida
|
|
|
|
|
ashish dogra wrote: ShowWindow(SW_MAXIMIZE);
Exactly how does this address Uday's need?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Set the Border property of the dialog to Resizable
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hi.. I must implement an interpreter in C programming language that will get the source code of a program in text file format and execute it.
but i don't know C language enough to write this interpreter. so I need this interpreter code that is written with C language.(or it can be C++) I searched this codes in google and some websites, but codes which I found are useless..
if you can help me, you gladden me.
please help me.. this effects my graduation..
*************************
a part from my homework;
Your interpreter program will accept and execute statements below:
• int variable_name
• cin>> variable_name
• cout<< variable_name
• variable_name = infix arithmetic expression (variable names, +, -, *, /, and parentheses (..)).
• for loop
• if else statement
(your interpreter does not need to recognize and execute nested for and if/else statements .
It should give error messages. Possible syntactic errors relating source code input are:
• Undefined variable <variable_name>
• Paranthesis mismatch
• Curly brackets mismatch
For the arithmetic expression evaluation you are free to use directly an existing evaluator program source code like polish notation within your interpreter.
|
|
|
|
|
Read #9 here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
ayshe wrote: please help me.. this effects my graduation..
Good luck !!!
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
I think its your homework not our homework.your question isnt specific its a global question
whitesky
|
|
|
|
|
ayshe wrote: but i don't know C language enough to write this interpreter.
Then you don't deserve to pass. What makes you think that people who earned their degree want to help you become their under skilled co worker ?
If you've done your course work, you'll probably find you CAN do this if you try. You'll also find people here helpful if you post specific questions when you get stuck rather than asking for someone to do it all for you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: Then you don't deserve to pass. What makes you think that people who earned their degree want to help you become their under skilled co worker ?
Hey! I resent that remark. I don't have a degree, and I still don't want to help them become my underskilled co-worker... (I have, however, honed my skills for 25 years, even if some days it doesn't seem like I bothered).
It never ceases to amaze me how stupid some people can be;
"Hmm. I have an assignment in a language I can't write in. I know, I'll get someone else to provide the code."
Does it never occur to them that they might have to explain how it works?
I confess, during my Computer Studies classes (I studied to GCE O & A levels in the UK), I did write 3 other people's projects for them, but to put it into context, they were all girls I was dating at the time! Nowadays, I charge money instead
Plus ca change, and all that...
(Of course, if I'd spent more time working in class instead of (ahem) socialising, who knows, I might have studied at University and got that degree)
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: I don't have a degree
Neither do I. I was just making a contrast that some have gone through what he's trying to do, on their own merits.
Steve S wrote: were all girls I was dating at the time!
ROTFL !!!
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian, I think you missed my real point; even us 'unqualified' guys wouldn't want people that stupid as coworkers
Christian Graus wrote: ROTFL !!!
See, before CodeProject, I had a social life....
(Actually, I married one of them, divorced a few years and two kids later, remarried again some time later - my current wife [I always call her that, it keeps her on her toes] understands the developer lifestyle, so I'm still married)
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: Christian, I think you missed my real point
No, I got it, just wanted to make sure you realised I wasn't being a snob.
Steve S wrote: [I always call her that, it keeps her on her toes]
LOL - I should try that.
Steve S wrote: understands the developer lifestyle
Mine is having a tough time with all the travel, I have to admit.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thanks for our all advices and depreciatory words...
I know this is only my homework. but this is not a coding course and my excellent(!) instructor wants this homework. thus, for pass this course; he orientate us to find codes. consequently, I and my friends search this codes in internet compulsorily. we found some codes but they are very advanced. so I though to ask my question in this area..
I don't discuss about deserve to pass.. because in this course, our instructor deserve to be dismiss...
Lastly; thanks my instructor for cause to read this dirty sentences..
|
|
|
|
|
hi
which message i should pass for selecting item in listControl.
for a simple list box there is lvnselchange message.
but for a ListControl which one should i use.
thanx
|
|
|
|
|
aavesh wrote: which message i should pass for selecting item in listControl.
Send the control a LVM_SETITEM message.
aavesh wrote: for a simple list box there is lvnselchange message.
Actually, that's the notification message (LVN_ITEMCHANGED ) that a list control control sends its parent when an item has changed. Perhaps you are thinking of the LB_SETCURSEL message.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i wrote the code under LVN_ITEMCHANGED event handler to get the current item.
its working and i'm displaying the current item from AfxMessageBox();
but exactly what is happining when i click on any item it shows me message(with the current selected text) two or three times.
why is this happeing and in which event i should write the code.
thanx
|
|
|
|