|
Rohit Sinha wrote:
I'm afraid you will have to write your own code for this, unless you decide to use something which is already out there.
I did: http://www.funduc.com/decenc.htm It does exactly what I need
Rohit Sinha wrote:
In any case, my suggestion would be to install your dll as a proxy for the server.
That is exactly what it is: a filter application for a certain mailserver (ArgoSoft). See http://triplef.marbus.net for more details.
Thanks for your reply
--
Alex Marbus
www.marbus.net
But then again, I could be wrong.
|
|
|
|
|
My program works fine under Windows 98, but crashes under Windows XP.
Is it MFC problem?
A debug version works fine though, only release version crashes when i open a file.
Is anything I should check or add to make it work under Win XP.
Thanks
|
|
|
|
|
As a rule, you need to provide more detail when you post questions. What statement does it crash on? Does it always crash in the same place?
Given that the debug version 'works fine' but the release version does not, I would guess that you have one or more uninitialized variables. Under debug, things tend to get set to a known state (usually zero) for you. Under release, that doesn't happen, and you get whatever garbage was in the variable when it was created or allocated. The reason things work under Win98 but don't under WinXP is that WinXP does a better job of validating parameters and such. You are getting away with this under Win98 simply because it's not checking something that WinXP does.
Software Zen: delete this;
|
|
|
|
|
Thank you, Gary.
At least I know now that I should check everything in my program now and it is not MFC's fault.
You gave me a clue. The crash happens when I open and close a file several times.
I wish I could send a code which causes it, but I still didn't find it.
Ok, thank you again.
|
|
|
|
|
hi,
Could somebody please give me pointers to some sample code
for printing a JPEG image ?
thanx,
Deepa
Deepa
|
|
|
|
|
The only sort of image you can print is one you have in memory. Therefore, to print a jpeg, you must first load it, using GDI+, or an external library. Then you just StretchBlt it to a printer DC, making sure to first set COLORONCOLOR as the mode for the DC.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
hello @all,
how can i write a CString into a .txt - file?
thank you very much
lucky
|
|
|
|
|
CStdioFile::WriteString() is the easiest way.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
can you give me an example?
how can i give the txt-file a name...etc..???
(the txt does not exist)
thanks a lot.
lucky
|
|
|
|
|
CString MyCString = "The Text";
CStdioFile csf("FileName.txt",
CFile::modeCreate | CFile::modeWrite | CFile::shareDenyNone);
csf.WriteString(MyCString);
Be sure to look up CStdioFile in MSDN.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Great!!!!!!!!!!!!!
thank you very much. After it I searched exactly.
lucky
|
|
|
|
|
If you want to use standard C++, the easiest way is this:
#include<iostream>
#include<fstream>
std::ofstream out("c:\myfile.txt");
out << myCString.GetBuffer();
myCString.ReleaseBuffer(0);
Something like that. An iostream inserter for CString is easy to write, I believe I did one in my inserters article. After that, you could just do out << myCString; Actually, that might work anyhow, but I suspect not.
Of course, iostreams adds about 40k to your final .exe, so if you don't care about using standard C++, you can use the MFC classes, which I'm afraid I am not very familiar with.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
my complete program is written in MFC and i think it is better the MFC classes to be used.
do you know links to articles to this topic?
thank you very much.
lucky
|
|
|
|
|
Lucky2002 wrote:
my complete program is written in MFC and i think it is better the MFC classes to be used.
Why ? Do you think they will work better ? The standard C++ classes almost always are better than the MFC alternatives, as well as working outside MFC ( i.e. the reason the MFC offers you a bare bones, no-where near as good alternative is to tie you to MFC and to Windows in general ).
Lucky2002 wrote:
do you know links to articles to this topic?
www://msdn.microsoft.com[^]
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Do you think they will work better ?
i do not think in this way.
i think your idea is very good and i will try it tomorrow.
thank you for the answer.
lucky
|
|
|
|
|
Christian Graus wrote:
Actually, that might work anyhow, but I suspect not.
You are correct, it asserts, that was the first thing I tried. However as you said something like this will work:
#inclide <iostream>
#include <fstream>
using namespace std;
std::ofstream of;
CString m_str;
m_str = "Writing this text";
of.open("test.txt", ios::out);
of << m_str.GetBuffer(sizeof(m_str));
m_str.ReleaseBuffer(0);
of.close();
Nick Parker
|
|
|
|
|
Just to clean this code up a little.....
#include <iostream>
#include <fstream>
std::ofstream of ("test.txt");
CString m_str("Some string");
of << m_str.GetBuffer(m_str.GetLength());
m_str.ReleaseBuffer(0);
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
Just to clean this code up a little.....
Christian Graus wrote:
And why did you use all of namespace std and then scope it explicitly as well ???
Again, . I was just typing something up quickly, thanks for pointing out some corrections.
Christian Graus wrote:
// you can close it if you like, but being a C++ class, it will do it itself when it goes out of scope.
I do this just out of practice, no other reason because it doesn't hurt.
Nick Parker
|
|
|
|
|
Nick Parker wrote:
I do this just out of practice, no other reason because it doesn't hurt.
You're not wrong. I am in the habit of NOT doing it when I write something quick and dirty. Guess what you need to do to file objects in C# ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
thank you very much, too.
lucky
|
|
|
|
|
thank you very much!!!
lucky
|
|
|
|
|
thanks
|
|
|
|
|
Yes - you hit compile
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
then i get an exe - machine code. not assembly code...
|
|
|
|
|
You can trace into a release build, I believe, and see the assembler. Otherwise, the answer is no.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|