|
|
Do you want to create a splash screen?
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I believe this has been a very long time(over 3 years) problem that no one in CP has figured out(or has claimed that they do) a solution to solve:
How do you send email in your C/C++/MFC programs if the SMTP server requires authentication?
Note: nowadays it's like 99.99% of SMTP servers in the world require authentication, damn it.
|
|
|
|
|
Anonymous wrote:
How do you send email in your C/C++/MFC programs if the SMTP server requires authentication?
You write the code yourself instead of using some built-in systems which can't.
Take a look at RFC2554 it says it all.
Basicly you send an AUTH command to the server, then it sends a Base64 encoded string back to you asking for a username, then you send the (Base64 encoded) username back to the server, then it asks for the password, and you send the password to the server.
Depending on what the server supports the "encoding" can also be MD5-Cram or MD5-Digest checksums instead of Base64 encoding.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Cool I want to know that, but where do you find article "RFC2554", I tried to search it on Yahoo and got a dead link.
|
|
|
|
|
See this link.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
http://rfc.net/rfc2554.html
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
In addition to what Anders said, some SMTP servers behave differently. They have a corresponding POP server and when you POP successfully from it, your IP address is added to an allowed list for a fixed time interval. During that time you can use the SMTP as a relaying SMTP, else it will ask you to authenticate once via POP.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
Yea, but thats baaaad behavior, because most mailprograms sends before they receive.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi all,
I am having a very strange problem with exception handling and variants. Here is a complete sample program that I have reduced the problem down to.
#include "stdafx.h"
#include <comdef.h>
class X
{
public:
VARIANT Test(BSTR name) const
{
VARIANT v;
VariantInit(&v);
return v;
}
};
int Test()
{
int index = 0;
try
{
throw 10;
X obj;
obj.Test(L"hi");
}
catch (...)
{
index = -1;
}
return index;
}
int main(int argc, char* argv[])
{
int i = Test();
return 0;
}
If anyone can give any insight as to why this problem occurs or how to get around it I would greatly appreciate it.
Thank you
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Works fine for me. No problems at all
|
|
|
|
|
I guess my question to you then are you using VC++ 6.0 and do you know of any settings in the compiler that could be causing this problem.
If I reorganize the Test function so that it does not use a VARIANT as a return type, but passed that value in as a reference arguement, it works fine for me as well.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Have you set the stack unwinding option (/GX)?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yes I have, thank you.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I was wondering what the quickest method to copy a folder and all of its sub-directories and files to another location would be. I am currently using a recursive function to find all files in all subdirectories then manually making the directories and copying each file over to the new location. Is there a way to copy all of this at once (like in windows when its shows the files flying from one folder to another and it makes all subdirectories in the new location)???
Any suggestions would be appreciated!
Thanks
|
|
|
|
|
SHFileOperation() is the one you are looking for!
It does have the progress window if you want to use.
It does do copy recursive sub-directories.
This does copy/rename/delete too...;) all in one package
I dont think this is the fastest way but application level safest way as its a high level api.
Thanks,
Ramu
|
|
|
|
|
1. What do i have to set the bmWidthBytes property to? MSDN says to set it to the number of bytes in each scan line, what is a scan line?
2. What do i have to set the bmPlanes property to? MSDN says "Specifies the count of color planes." what are color planes?
3. To create a valid bitmap picture, do i just save the entire BITMAP sctruct to the harddrive or is there another function that i should use?
Thanks in advance.
|
|
|
|
|
a scan line corresponds to the width of the screen, bmWidthBytes is the number of bytes required to represent on horizontal line of pixels.
the bmPlanes property refers to the number of color planes used by the device. Some printers require that the information for a scan line be sent one color at a time. e.g. send the red value of all the pixels, then send the blue values then the greens. In most cases set it to 1.
|
|
|
|
|
Thankyou. How do i then create a valid bitmap picture that can be opened in any picture viewer? Do i just use WriteFile? If so, how do i use it? What should i pass as the parameter that should be written and how many bytes shoul di write?
Thanks
|
|
|
|
|
If you have a BITMAPINFO structure, then you can write it out to disk, using IOStreams or Microsoft specific methods.
GDI+ will do this for you, for bmp/jpg/gif/I forget the others.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
I have created an MFC ActiveX control, in Visual C++ 6.0, that dynamically creates another ActiveX control at runtime. (I did this to create a high-level ActiveX control that wraps a low-level 3rd party ocx). The dynamically created ActiveX control has events that it fires, but I do not know how to handle these events?
Is there a way to pass the name of an event handler to the create() method and handle events this way? Do I have to use an event sink? Or reflection?
Any help, or code exmples, would be greatly appreciated...
Dave Janu
Dave Janu
Software Projects Manager
UEMSI
w137 n5560 Williams Place
Menomonee Falls, WI 53051
|
|
|
|
|
I had the same problem, I never did get it to work. You need to establish connection points in your code to correspond to the events in the 3rs party control. You then attach your connection points to the control by notifying it of their location. It kind of works like a reverse method call.
The wizards do this for you if you use them to create the control. When you have a dynamic control you have to do it yourself. Look at the Type library handling routines for a start.
I never saw a sample of this done dynamically. (I looked for a month.) I found hudreds of examples of connection points, but all were created at design time.
good luck.
Please send me a mail when you find an answer, I finally gave up and changed my design.
|
|
|
|
|
I am having problems installing a system wide hook from a service.
The hook is installed by the service when it starts. I am using PostThreadMessage() to forward messages from the hook DLL to my service's thread. At first I thought there was a problem sending the thread messages, but with further poking around I found that the DLL hook doesn't seem to be receiving any messages to forward.
I think this make be related to the "desktop" the service runs in. I have specified the "interact with desktop" flag when creating the service though.
Can anyone give me any ideas?
Thanks!
--
Dana Holt
Xenos Software
|
|
|
|
|
Hi.
I posted a thread about adding a feature to a program that searches a websites via Google. I have the basic design and implementaton done. Now I am debugging it.
I have successfully design and implement a chat program using TCP/IP and non-blocking mode via WAsynSelect(). I am using that same design with this website algorithm. I am running into a problem in this early debugging stage.
The program is I am not sure if TCP/IP and HTTP are the same or are similar. With TCP/IP and using WAsynSelect() mode, the non-blocking model relies on the Windows messaging system. With HTTP protocol, will the server, i.e. Google, send messages about the read, write, and/or close status of a socket (the socket connects the user computer to Google server via an Internet).
Thanks,
Kuphryn
|
|
|
|
|
HTTP is built on top of TCP/IP and is a TCP/IP based internet protocol. HTTP chat is funny in the sense, the client connects to the server, sends its request and then receives data till the server closes the socket connection from it's side. So it's not much of a chat in a way.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|