|
in .h file:
Document(const char* filename=NULL);
Document(const wchar_t* filename=NULL);
The reason is here. You specified two default ctors because both of them are supposed to be called when no arhuments are passed to a ctor. So remove the default parameter value (=NULL) from one of ctors [or both of them].
--
=====
Arman
|
|
|
|
|
sandeepkavade wrote: Document(const char* filename=NULL);
Document(const wchar_t* filename=NULL);
Why not replace them with:
Document( const TCHAR *filename = NULL );
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have to transfer file via UDP. Please send me any sample codes or links or suggestions regarding this.
S.Yamini
|
|
|
|
|
I think its not good idea to send a file with UDP.
See this[^] thread
|
|
|
|
|
I have to use only UDP. Please send me any sample codes or link or suggestions
S.Yamini
|
|
|
|
|
|
You *can't* use UDP. UDP does not guarantee every packet will be delivered, which means the file received on the other end will most likely be corrupted.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Yes you can. You would need to implement some sort of "packet received" reply. If the sender didn't get it in time it would resend the packet. Such protocols exist.
Steve
|
|
|
|
|
That's a lot more work than it's worth. In fact, if such code exists, it would be a lot better to buy a library than to reinvent that particular wheel. Essentially, you're trying to turn UDP into TCP/IP. There's a reason both protocols exist.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: In fact, if such code exists, it would be a lot better to buy a library than to reinvent that particular wheel.
Agreed.
Steve
|
|
|
|
|
yaminisridaran wrote: I have to use only UDP
You can do it, but by the time you implement all the checking for dropped datagrams and out-of-
sequence datagrams, you'll have rolled your own TCP
Some tips: UDP datagrams can arrive out of order or not arrive at all. That means every
datagram will need a header containing some kind of info indicating it's position or index or
whatever so you can reassemble the data on the receiving end. You need to be able to resend
datagrams that don't arrive at all and allow for packets arriving out of order. This is the
stuff TCP does for you.
Good luck!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Can u send me the sample coding for TCP Server and TCP client
S.Yamini
|
|
|
|
|
|
'nuf said already. I would suggest too, "Don't use UDP"!
Anything I will say you will bring it down to whatever you want.
|
|
|
|
|
yaminisridaran wrote: I have to use only UDP
I would be interested to hear why?
As many (Mark, etc) told there is some overhead in re-inventing TCP datastream capability with UDP, not mentioning that you can't use HTTP proxies to get out of a firewalled networks. Since you haven't stated your requirements I wonder why you want to do this.
|
|
|
|
|
Hi,
I'm a beginner in programming in C++ so there's a lot of searching and trying to do.
I've been trying to retrieve the directory that contains the project file out of VC++. I searched around and it should be possible with the namespace VCProjectEngine. There are also some examples on the net but i haven't found one yet in C++.
So for the moment I haven't been able to make a working program were i can obtain my project directory (i want to place there a cfg file with some parameters).
I've tried it with VCProject.ProjectDirectory but can't get it to work.
Can anyone help me with an example on how it works/?
Thanks in advance!
|
|
|
|
|
What's your exact problem and purpose? Why to bother with VCProjectEngine at all?
--
=====
Arman
|
|
|
|
|
I have a small application that's converting an xml file in another format. In a .config file i wanted to specify file location, where to get the xml files and where to place the output files so it's not hard coded in my application.
This .config file is placed in my application directory.
How can i find it? I have seen some sugestions and tried several things but don't succeed in it. What's your proposal?
|
|
|
|
|
Hi,
Have you tried CDocument::GetPathName () ??
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
I need the header file afxwin.h for this and that's not a standard file in express edition.
I thought that namespace VCProjectEngine would be much easier!
|
|
|
|
|
Actually, you are trying to find the location of your executable. (The project file is only present on your development system.)
Look at GetModuleFileName - it will tell you the full path name of your executable file - no matter where it is run from.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
but then i need a header winbase.h/windows.h and that's not included with my Express Edition.
So i was searching for a workaround?
|
|
|
|
|
I would find that hard to believe... if you don't have windows.h and winbase.h, you can't develop windows applications - even the express edition allows that. I know the express doesn't have MFC support, but then GetModuleFileName is a Windows API call.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I did a search on my system and the files could not be found, strange? What do i need to have those files: Platform SDK?
I haven't created an executable yet for this small application but I can debug it! I'm going to try this today and see what happens with the application that i have so far.
Thanks for your time, I'm feeling like an idiot!
Regards
|
|
|
|
|
Yes, you need the Platform SDK. Once you install that, you should be in good shape.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|