|
OK I discovered the answer to my question.
You have to open the file as a binary file rather than a text file by using the 'b' mode...
dst = fopen(dstr,"wb");
|
|
|
|
|
As a guess, this is probably happening on Windows, correct?.
The character '0x0A' is a linefeed character and in text mode it is being replaced with a two character sequence of '0x0A,0x0D'. These two characters are a linefeed character('0x0A') and a carriage return character('0x0D'). Both of these together are take as an end of line terminator in text files in Windows. As you have found, if you open the file in binary mode then this this substitution will not take place.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
The documentation[^] explains the reasoning behind this feature.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi, dear all
I create an application using MFC in C++ 6.0, it works fine in Window XP, and in Window 7 mostly, but there is a computer with Win7, SP1 that cannot run the application, the error message is "The application was unable to start correctly (0xc0150002") click OK to close it".
Can anybody tell me what cause this kind of error, how to fix it?
Thanks!
|
|
|
|
|
I'd guess that a DLL is not found. Can you try to debug the application with VS on the failing machine. If not, try to use the Dependancy Walker application to determine what DLL is failing to load. It might also be a bad DLL, in that it loads okay, but an entry point that is required is not found. Again Dependancy Walker will be able to tell you this.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Chris,
Thanks for your reply. Since the application is created by C++ 6.0, it cannot be debugged in Win 7. Maybe the dependency walker is the only way.
Thanks again!
|
|
|
|
|
|
Make sure to check the EventLog (Application + System) it can many times have interesting information, about failed program starts.
Also even if you find it impossible to install VC6 on Win7, then you can still debug using WinDBG (Windows Debugging Tools).
|
|
|
|
|
Rolf, thanks for your suggestion.
|
|
|
|
|
Hi
where i can found microsoft api for Upnp library(upnp.lib)
|
|
|
|
|
|
superman
i just need upnp.lib file.
first thing that search engine for upnp found is your answer link.
superman
|
|
|
|
|
Wouldn't you get it the same way you get any other windows dev lib? :shrugs:
That is to say, go here[^] and download the windows SDK.
From Superman's link, you can see it's been supported since Windows ME, so any SDK released between then and now should do the trick nicely.
Make it work. Then do it better - Andrei Straut
|
|
|
|
|
in windows sdk you can find UPnP.h
but youcant find upnp.lib in lib
problem is here
|
|
|
|
|
Friends,
I have created two application Server and Client connected with Socket(TCP/IP). Now If i send the data from client to server then i getting error in this line ar.WriteObject(&m_sListOut);" . I have cited the code below.
Code:
pSocket->creat();
pSocket->Connect(IPaddr,Port);
m_File = new CSocketFile(pSocket);
m_pArchIn = new CArchive(m_File,CArchive::load);
m_pArchOut = new CArchive(m_File,CArchive::store);
void SendDataToServer( )
{
CTransData oData; oData.m_sListOut.AddTail(sPackData);
pSocket->SendData(&oData);
}
void SendData(CTransData *pData)
{
if (m_pArchOut != NULL)
{
TRY
{
pData->Serialize(*m_pArchOut);
m_pArchOut->Flush();
}
CATCH(CFileException, e)
{
m_pArchOut->Abort();
delete m_pArchOut;
m_pArchOut = NULL;
}
END_CATCH
}
}
CTransData.cpp
void CTransData::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar.WriteObject(&m_sListOut);
}
else
{
m_sListIn = (CStringList*)ar.ReadObject(RUNTIME_CLASS(CStringList));
}
} I have written same code in the Server side application and server is able to send the data to client without any problem. In case of Client, could not send the data to server side. Knidly help me to fix this problem
|
|
|
|
|
ar.WriteObject(&m_sListOut);
You need to provide full details of what that error is.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
When this line "ar.WriteObject(&m_sListOut);" encountered
getting Error:
Debug Assertion Failed!
File: f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\map_pp.cpp
|
|
|
|
|
You need to use your debugger to check the stack trace and find out where your program is calling out to this module, and what is causing the assertion.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Trying to implement HtmlView in Dialog based app but getting pDisp is NULL;
IDispatch * pDisp = GetHtmlDocument();
What is the problem please guide.
|
|
|
|
|
The above does not explain much beyond what is shown in the documentation[^]. Are you certain that your view has a current loaded document?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Call Navigate2("about.blank", 0, "_self") before GetHtmlDocument()
|
|
|
|
|
I need to add a list control to my dialog box for the windows CE.6 device, such that the list contains some set of words.....can somebody help me out ??
|
|
|
|
|
Exactly what trouble are you having? Are you able to add other controls to the dialog? Is this an IDE or C/C++ (i.e., code) issue?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Friends,
I want to transfer structure data using socket in MFC. but i unable to transfer the data. Knidly help me to transfer data using TCP/IP socket. If possible kindly give sample code.
Thanks and Regards,
S.Shanmuga Raja
|
|
|
|
|
Just send it as a stream of bytes. As long as both ends of the socket use the same packing then you should have no problems.
One of these days I'm going to think of a really clever signature.
|
|
|
|