|
i think, you need to convert the number to string (like "123" for example) first using wsprintf, or any similar function like that. If not, if the value is zero, then it may be taken as the end of string (depends upon how you use the string stream).
|
|
|
|
|
Can you explain it with a simple example, please.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Here what I have done so far.
<br />
<br />
int temp = InMsg[0];
<br />
stringstream str(ios::in|ios::out|ios::binary);<br />
if(CopyTo(str) == 0)
{<br />
wchar_t* results = new wchar_t[1];<br />
swprintf(results, L"%d", temp);<br />
<br />
InMsg.Attach(results, 0);
}<br />
My attach function like this.
<br />
bool CRfMessage::Attach(istream& str, const UINT offset)<br />
{<br />
size_t buffer_size;<br />
<br />
if(str.bad()) <br />
return false;<br />
<br />
str.seekg(0,ios_base::end);<br />
<br />
buffer_size = str.tellg();<br />
<br />
char* payload = (char*)AdjustDataSize((UINT)buffer_size+offset);<br />
<br />
str.seekg(0,ios_base::beg).read(payload+offset,buffer_size);<br />
<br />
return true;<br />
}<br />
I appreciate your help all the time...
CodingLover
|
|
|
|
|
here's a simple way to do it without needing any libraries. it's not protected from overflow though, so be warned!
int main(int argc, char* argv[])
{
char ascii[100] = "example", *ascii_p = ascii;
wchar_t unicode[100], *unicode_p = unicode;
while (*unicode_p++ = *ascii_p++);
std::cout << ascii << std::endl;
std::wcout << unicode << std::endl;
return 0;
}
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hello to all,
there are some standard methods (like MAPI) of MFC through which we can send emails by programming.In these methods when we will click on "Send" option of menu item, firstly our email id will be connected to outlook express and then through it mail will be sent. But I am doing a project in which I want to do this without getting connected to outlook express GUI because I have created my own dialog box which contains some edit boxes,one button "Attach",another button "Send". Edit boxes are used to write email adresses to whom u want to send mail,to display attached file names and to write the actual message you want to send.After clicking on "Attach" button selected files should get attached to the mail and after clicking on "Send" button, mail should be sent along with the typed message and attached files,to the email addresses we typed in an edit box.In this I dont want to use outlook express.Can anyone tell me how to do this? It is really urgent so plz can anyone help me out?
Thanks and Regards,
Anay
|
|
|
|
|
AnayKulkarni wrote: Can anyone tell me how to do this?
By reading the mail-related articles here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Which C++ compiler is the best ? VC6, VC7, VC8?
Thanks
modified 7-Mar-17 16:30pm.
|
|
|
|
|
|
Usually the upper is the number, the better is the compiler.
The above rule is wrong when applied to their operative systems.
BTW the compiler name is CL .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I've read that VC6 generates the fastest executables. My impression is consistent with that. I like VC6's GUI better too. I seem to remember reading a claim that it wouldn't work on Vista, but I'm not sure about that.
|
|
|
|
|
VC6 has worked fine for me on Vista for years, you just have to run it elevated. I have a post on my CP blog about how to install it.
|
|
|
|
|
how to set the cmd line option in visual studio 2005
|
|
|
|
|
Go to menu option Project->Properties... and select "Debugging" and enter your command line options in "Command Arguments"
Rams
modified on Friday, October 31, 2008 5:31 AM
|
|
|
|
|
I Create a scroll view in my dialog.
CMyDlg::OnInitDialog()
{
...
CSize size(1600,1200);
m_scroll_view.SetScrollSizes(MM_TEXT,size);
}
When running, the scroll bar appears, and the thumbs' sizes are right. When I'm trying to scroll,
all is ok until LButtuonUp, the thumb will go back to the start of bar then.
What's the problem?
Thanks.
modified on Friday, October 31, 2008 7:35 AM
|
|
|
|
|
I'm guessing that as you don't show it, you don't have any handlers for the WM_V/HSCROLL messages that the scroll bar produces. Add a handler for those to your dialog, and then have a look at the docs for those messages.
Iain.
|
|
|
|
|
It's my careless, I changed the base class from CWnd to CScrollView ,
but I forgot to change it in BEGIN_MESSAGE_MAP .
I'm finding a better framework than MFC.
modified on Friday, October 31, 2008 9:24 AM
|
|
|
|
|
followait wrote: I'm finding a better framework than MFC
Rajesh's remark: "Impossible.".
Carlo's remark: "Impossible to fail."
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
followait wrote: I'm finding a better framework than MFC
Indeed, one that keeps you from forgetting to change the code generated by a Wizard. Yes, must find new framework, good idea. Keep up the good work!
led mike
|
|
|
|
|
Hi All
My parent dialog will open the child dialog. I would like to edit some
values in the child dialog and upon clicking the ok button, will load
the new data back to the parent dialog.Plz help me
Thanks in advance
|
|
|
|
|
See here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for help..It's working
|
|
|
|
|
MsmVc wrote: It's working
Nice to know.
MsmVc wrote: Thanks for help
You're welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
hi,
i want to create a resume support file download program using socket.
it can be like i am downloading a large file and stopping it for today and want to continue tomorrow from the bytes i left.
it is like 50kb today and 50kb tomorrow.
i dont want use third party resume support programs.
and the file is in a remote http server
normally i am requesting a file like the following
GET /filename.ext HTTP1.1
Host: host.com
Connection: Close
is there a way to request a file with another protocol and not with HTTP (port 80)
because http gives a header and other decoding stuffs
and i haven't used the byte range header of a http request which could
help me do my work...
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
modified on Friday, October 31, 2008 4:07 AM
|
|
|
|
|
You can user partial content 206 rule for reading a part of a file from remote server.
The header is "Range: bytes=100-200"
which fetches 100 bytes starting from 100th byte to 199.
|
|
|
|
|
Hay genius ,
i have a small doughs for a comment line "// or /*.........*/"
i am using lot of comments line in my mfc program,its taking a long time for execution and compiling .
1, if its taking a time for compile and execution. and one more doughs
2,if the command line occupy a memory space. if not means how to compiler identify command lines.
Regard's
Mathy's
|
|
|
|