|
Hi Everyone,
How to make a program in VC++ to send E-mail in which including :-Subject,To,Bcc,Cc,Text.
Thanx,
|
|
|
|
|
One solution is winsock.
Kuphryn
|
|
|
|
|
How to interact with mail server.
Thanxs.
|
|
|
|
|
Search Google for the format to logon to an email server. Format the outgoing string data. Send via winsock.
Kuphryn
|
|
|
|
|
Check out the following links:
http://www.axter.com/code/SendEmail.h
http://www.axter.com/code/SendEmail.cpp
This is a SendEmail that you can use with an SMTP server.
The class does all the leg work for you.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/
|
|
|
|
|
I am wondering if the VC compiler uses multiple threads in compiling source code, i.e. will compilation speed scale linearly with number of processors?
|
|
|
|
|
Stormwind wrote:
I am wondering if the VC compiler uses multiple threads in compiling source code
No. 
|
|
|
|
|
when i create a project following the wizard, I may find
the final installation files include all the files i put
into the file group of this project such as my exe file,
my icon file and so on.
Someone told me I can create a single setup.exe file by
using the tool PackageForTheWeb of installshield, but I
still want to know how can i create a project only include
some installshield stardard files (i.e. data1.cab,
licence.txt, setup.exe and so on) just like some other
softwares. I think all my own program files should be in
the data1.cab, shouldn't it?
Thank you.
|
|
|
|
|
Why don't run the same programe code on vc++ compiler,but it is run good on dev-c++ compiler.
The code is
#include "stdafx.h"
#include <windows.h>
LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char szClassName[ ] = "AltWind";
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;
wincl.hInstance = hInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure;
wincl.style = CS_HREDRAW | CS_VREDRAW;
//wincl.cbSize = sizeof (WNDCLASSEX);
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
//wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
if (!RegisterClassEx(&wincl))
{
MessageBox(NULL,TEXT("this program required windows nt!"),
szClassName,MB_ICONERROR);
return 0;
}
hwnd = CreateWindowEx(
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hInstance, /* Program Instance handler */
NULL);
ShowWindow (hwnd, nCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&messages,NULL,0,0))
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
return messages.wParam;
}
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static POINT aptFigure[10]={10,70,50,70,50,10,90,10,90,50,
30,50,30,90,70,90,70,30,10,30};
static int cxClient,cyClient;
HDC hdc;
//RECT rect;
//GetClientRect(hwnd,&rect);
//cxClient = rect.right - rect.left;
//cyClient = rect.bottom - rect.top;
int i;
PAINTSTRUCT ps;
POINT apt[10];
//HPEN hPen;
switch (message)
{
case WM_SIZE:
cxClient = LOWORD(lParam);
cyClient = HIWORD(lParam);
return 0;
case WM_PAINT:
hdc = BeginPaint(hwnd,&ps);
SelectObject(hdc,GetStockObject(GRAY_BRUSH));
for (i=0;i<10;i++)
{
apt[i].x=cxClient * aptFigure[i].x/200;
apt[i].y=cyClient * aptFigure[i].y/100;
}
SetPolyFillMode(hdc,ALTERNATE);
Polygon(hdc,apt,10);
for(i = 0;i < 10; i++)
{
apt[i].x += cxClient/2;
}
SetPolyFillMode(hdc,WINDING);
Polygon(hdc,apt,10);
EndPaint(hwnd,&ps);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0 ;
}
I am like programiing
|
|
|
|
|
No-one is going to wade through your code if you don't even say what the error is, but VC6 is one of the worst compilers for C++ standards conformance.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
:(The screen show a dialog box when this program running,the dialog box message is "this program required windows nt!" ,why? but think you too.
I am like programing
|
|
|
|
|
LOL - so the compiler works fine then. If it works with your other compiler and runs, chances are it's inserting a workaround for a function you're calling that is NT only. Or your build settings are creating the problem.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
I caeat a Win32 app.But it shouldn't this dialog message,help me to solve this problem. think you ,what are you using compiler?
I am like programing
|
|
|
|
|
sunjohn wrote:
I caeat a Win32 app.
I can see that, I'm not stupid.
sunjohn wrote:
But it shouldn't this dialog message,help me to solve this problem
Well, this code:
if (!RegisterClassEx(&wincl))
{
MessageBox(NULL,TEXT("this program required windows nt!"),
szClassName,MB_ICONERROR);
return 0;
}
seems to be your problem. Now, I presume this means you got the code from somewhere else, if you couldn't work out that this is the source of your dialog, and you blamed the compiler. Either way, your window class is failing to register.
sunjohn wrote:
what are you using compiler?
VS.NET 2003, but I've written lots of Win32 code in VC6.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
o!by the way ,I used operating system is win2000.
I am like programing
|
|
|
|
|
W2000 IS windows NT. Your message box seemed a bit odd to me. OK, in that case, you need to figure out why RegisterWindowEx is failing.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
yes!I need to figure out why RegisterWindowEx is Failing,but compiled this code have not error and warning.I don't know too.help!
I am like programing
|
|
|
|
|
Call GetLastError() when the function fails, and instead of showing a MessageBox saying "This program requires Windows NT" or whatever, show a messagebox with the error code GetLastError() returns. Then post the error code here.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
how to write?think you .
I am like programing
|
|
|
|
|
sunjohn wrote:
but compiled this code have not error and warning
So ?
Where did you get the starting code from ? It's obvious you did not write it. What are you trying to achieve ? I think you need to do some console programming first and learn enough about C++ to understand the difference between compile time and run time errors. That is friendly advice, not an insult.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
yes,but I studying programming windows ,very think you!
I am like programiing
|
|
|
|
|
sunjohn wrote:
but I studying programming windows
That's what I was scared of. You *can't* learn programming windows in C++, until you know some C++. You have the Petzold book ? You're doing things the hard way, you should probably use MFC if you're going to use C++.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
I have a few comments to make.
1. Format your source code because nobody will go through it and read it the way you have posted it. It's a mess. To learn how to format your source code so it would display properly read the Frequently Asked Questions section on this page.
2. Judging from your current and previous posts, I suggest that you read some Windows 32 Programing books or tutorials. Here is a website just for a start http://www.winprog.org/tutorial/
3. The answer to your question.
You can't comment out the parts where WNDCLASSEX's members are being initialized. You need to initialize all the members to their appropriate values. So comment out
//wincl.cbSize = sizeof (WNDCLASSEX);
//wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
to
wincl.cbSize = sizeof (WNDCLASSEX);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
and you program will run fine.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Toni78 wrote:
//wincl.cbSize = sizeof (WNDCLASSEX);
//wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wow. As you say, it was very ugly and so I only skimmed it, but I'm still amazed I missed an error like that !!!
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Christian Graus wrote:
wow. As you say, it was very ugly and so I only skimmed it, but I'm still amazed I missed an error like that !!!
I still like your signatures.
Come on, everyone would have missed those errors! It's the format. It was just pure luck for me to spot comment lines at a place where they normally shouldn't be.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|