|
Why dont use of CString? and you can set Want Return to ture for edit control.
|
|
|
|
|
1) See the FAQ[^]. You should also right-click on the control and set the property "Want return" to true (or something like that, don't remember exactly what it was).
2) Why do you pass a pointer to a CSTring object when the function accepts a reference ? The error message is pretty clear.
So, just pass the object and get rid of the pointer.
|
|
|
|
|
Hi,
I am using ISAPI Filter in MFC. i can get client request in the OnPreprocHeaders().i want to display a text message like in the tag
Welcome to ISAPI Web World
how to do it in the OnSendRawData() method.
awaiting for reply
Regards
Jothi.G
|
|
|
|
|
can anybody tell me how to convert a jpg image to a 24 bit bmp image
thanks in advance
|
|
|
|
|
|
JPEG image is compressed file format. You need to decompress it first and then use it.
Look here[^] for compression and decompression algorithms.
Regards,
Paresh.
|
|
|
|
|
If you are using GDI+, it is easy. Load the image using GDI+, and save as "JPEG" with the compression required.
GDI+ supports BMP, PNG, TIF, JPG, GIF. Make sure you initialize GDI+ first and use the encoders. The following MSDN doc shows how to load BMP and save to PNG. With minor changes, your can save to JPG
http://msdn2.microsoft.com/en-us/library/ms533837.aspx
|
|
|
|
|
When i insert into a DBGrid Ctl to a dialog , and open attribute page to set some items,then click confirm , then the VC2005 flush and give a dialog to send error message to Microsoft! why like this ???
What Grid Control can i use in VC2005
i love c++
|
|
|
|
|
|
Did you see Database section on the codeproject?
|
|
|
|
|
Aren't you being a bit cocky there? Rushing us and demanding detailed answers? We ain't your slaves, neither is this the Shen Long of programming...
Windows Calculator told me I will die at 28.
|
|
|
|
|
We don't care if it's urgent.
We expect you to write your own code.
|
|
|
|
|
I need a help.
Actually I want to get the input text from user from window and I need to convert text to pdf how is it possible ? give me some hints.
|
|
|
|
|
Did you use of google for it?
|
|
|
|
|
|
Can I accomplish this?
My program has a table representing a bitmap
Writes down the bitmap into a file
Read the bitmap
Show it
Close window
Delete file
In VC++ 6 please
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Do you want to load image file?
|
|
|
|
|
yes
a file containing a bitmap from the application directory
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
You can use of CImage class for load jpg,bmp,....
|
|
|
|
|
I can't use CImage in VC++ 6!
What to do?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
By "table", do you mean a grid with pixels?
If so, you don't need to do that - Windows does it for you.
I would write the basic code for you, but shouldn't it go like this?
Read the bitmap
Show it
Do something with it
Writes down the bitmap into a file
Close window
And, not that I'm nosy, but why would you delete the file right after using it?
Windows Calculator told me I will die at 28.
|
|
|
|
|
the program has into a table a compressed file of type bmp
it writes the table into a file
decompress the file
read the bitmap
close and delete file
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Hi all,
I am trying to convert CString in char* using this code
CString inFName;
m_InList.GetText(i,inFName);
char *test= new char;
sprintf(test,"%s",inFName);
on a vc2005 compiler.
My problem is supoose i get "D:\COMPRESS\ziparchive.zip" in my CString variable then after converting it in char* variable the value in test is "D".
I am not getting what exactly is the problem.
Can anybody please help me in this.
Thanks in advance
|
|
|
|
|
neha.agarwal27 wrote: char *test= new char;
You have allocated memory for only one char. That why only first char is copied.
Why can't you use (LPCTSTR)inFName .
Regards,
Paresh.
|
|
|
|
|
You have two problems, I think.
1/ You are making a character pointer, but only pointing to one character. That's *1* byte of RAM. I can pretty much guarantee that your string is longer (remember it will finish with a NULL... So you will get two BYTE used, and quite likely more - so you could crash your program (if you're lucky) with string overflow. I think you're have compiled in debug mode, which will give you a little room either side of variables, which is why you're surviving this error.
2/ You are making a character pointer, but I bet your software has been compiled as UNICODE. Which means CString will be unicode too. Then you're just giving sprintf the raw CString object (not even ussing (LPCTSTR) in front of it. Frankyly, I'm surprised you don't get more than gibberish.
Answers...
If your string is not guaranteed to be US english friendly, converting it to char * is almost certainly a bad idea. What if your program was used in Korea?
If you're certain...
Look up the function WideCharToMultiByte in MSDN - and using google should be able to give you plenty of examples. If you use it with certain parameters (as described in msdn) then you can get the length of string you need to pass it. (There's a link on the msdn page to example code).
Iain.
|
|
|
|