|
i want add an email to outlook's inbox
so i write the code like this...
_MailItemPtr pNewMail;
MAPIFolderPtr pInbox;
_ItemsPtr pInboxItems;
_NameSpacePtr pNameSpace;
_ApplicationPtr pApp("Outlook.Application");
pNameSpace = pApp->GetNamespace(L"MAPI");
pInbox = pNameSpace1->GetDefaultFolder(olFolderInbox);
pInboxItems = pInbox->Items;
pNewMail = pInboxItems->Add();
pNewMail->Subject = "Save Inbox";
pNewMail->SaveSentMessageFolder = pInbox;
pNewMail->Save();
pNameSpace->Logoff();
i want save email to inbox,but the result is save the email to draftbox.
i think have a mistake in the code,but i don't know.
anybody know how to Save email to inbox,please tell me,thanks!
Best Regards!
|
|
|
|
|
i have a block of codes but this error pops up everytime i run my program.
scenario:
i'm suppose to create a ticket reservation system and i dun even know how to code... alot of trial n error which wil take forever, due date's not enough time to read up everything )=
|
|
|
|
|
Can you please explain your problem in more detail? I mean on which part of code, you get this error?
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
The error means what it says, you're trying to pass too few parameters to a function. Not wanting to be rude, but that shouldn't be hard to work out.
fuschia wrote: i'm suppose to create a ticket reservation system and i dun even know how to code...
Well, I would suggest that if you've taken a course that is above your level you can either drop out, or work really hard to catch up.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Very right...
Do programming by loving it.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
This error occurs when number of parameters in function declaration do not match with number of parameters you are passing at the time of function calling. So check your function declaration.
Good luck
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
The easy solution is not to run your program.
Not tryng to be rude, but how the hell did you get a programming job?
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi all,
I am trying to instantiate a dialog box and keep getting the error message
'too few parameters, expected 2'
the offending piece of code is:
void CFisheriesView::OnAlmforeignkeys() {
COpenDB open; //ok
open.ALM(); //ok
CALMFKeyDlg dlg; //bombs out here
dlg.DoModal();
}
Anyone can give me some pointers? Thx,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Hi RalfPeter,
I guess your dialog class is derived from CDialog. Is that right?
If you create a mfc dialog application, use default settings and just go 'finish' to create the code, you may find the following piece of codes in your ...Dlg.cpp file:
<br />
CtestmfcDlg::CtestmfcDlg(CWnd* pParent )<br />
: CDialog(CtestmfcDlg::IDD, pParent)<br />
{<br />
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);<br />
}<br />
Here you can see that the CDialog class actually need two or one parameter to initialize. You need to do this in your code as well.
The IDD is a id to a dialog resource. you can create a new dialog resource by using 'add' option in the drop down menu of the resource explorer window.
Regards,
Chris
|
|
|
|
|
It looks like the constructor expects arguments. ie.
CALMFKeyDlg dlg(something_here, and_something_here);
You'll have to look at the definition of CALMFKeyDlg::CALMFKeyDlg to see what it expects.
Steve
|
|
|
|
|
Should you be able to create your own mfc42.dll from the MFC/SRC source files (plus whatever else is available to the VC++ developer)? I'd like to put some breakpoints in MFC code to debug a release-only problem.
dahill
|
|
|
|
|
No, you can't. Your release only problem is probably a problem with memory that you're not initialising properly, debug mode does it for you. The best way to check that stuff is to write logging code in your exe and read the log after running it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
A release-only problem screams uninitialized variable, or a pointer problem. I use TRACE statements.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i wanna get the device information from the registry and take it as parameter to connect to the particular bluetooth device.
I manage to get the service information but not device infomation.
Below is the code:
/////////////////////////////////////////////////////////////////////
typedef struct _BT_DEVICE /* BT Device structure */
{
BD_ADDRESS bdAddress; //Address of the devcie
UINT8 pageScanRepetitionMode; //Page scan repetetion mode
UINT8 pageScanPeriodMode; //Page scan period mode
UINT8 pageScanMode; //Page scan mode
UINT16 serviceClass; //Service class field
UINT8 majorDeviceClass; //Device class(Major) feild
UINT8 minorDeviceClass; //Device class(Minor) feild
UINT8 clockOffset[2]; //Clock offset
}BT_DEVICE, *PBT_DEVICE;
////////////////////////////////////////////////////////////////////
BOOL retResult = FALSE;
BT_DEVICE devices[1] = {0};
UINT8 retCount1 = 0 ;
BT_DEVICE device1 = {0};
HANDLE sdpHandle = NULL;
BT_SERVICE services[1] = {0};
UINT16 numServices1 = 1;
// INT16 testnumServices;
HANDLE sppConnection = NULL;
BT_SERVICE service = {0};
UINT16 frameSize = 1500;
PINT8 portName = (PINT8) SPP_COM_Port;
HKEY hkTimeZones;
int iErr = 1;
bool bShow = false;
INT dwIndexToFind = -1;
if(BT_IsInitialized())
{
if(BT_Open())
{
int count = 0;
if( RegOpenKeyEx(HKEY_LOCAL_MACHINE,REMOTE_BLUETOOTH_DEVICE_SETTING,0, 0,&hkTimeZones) == ERROR_SUCCESS )
{
DWORD dwIndex = 0;
TCHAR tcKeyName[512];
DWORD dwcbName = 512 * sizeof( TCHAR );
FILETIME ftLastWrite;
HKEY hkTimeZone;
HKEY hkTimeZone2;
AfxMessageBox(_T("test here"));
/*while( RegEnumKeyEx(hkTimeZones,dwIndex++,tcKeyName,
&dwcbName,NULL,NULL,NULL,NULL) !=
ERROR_NO_MORE_ITEMS || count <=1)
{
AfxMessageBox(_T("while"));
count++;
HKEY hkTimeZone;
if( RegOpenKeyEx(hkTimeZones,tcKeyName,0,
KEY_READ,&hkTimeZone) == ERROR_SUCCESS )
{
*/
//
DWORD dwDataSize = sizeof( BT_SERVICE );
if(RegQueryValueEx(hkTimeZone,_T("service"),NULL,
NULL,(BYTE*)&service,&dwDataSize)== ERROR_SUCCESS)
AfxMessageBox(_T("Got service"));
else
AfxMessageBox(_T("No service"));
DWORD dwDataSize2 = sizeof(BT_DEVICE);
if(RegQueryValueEx(hkTimeZone2,_T("device"),NULL,
NULL,(BYTE*)&device1,&dwDataSize2)== ERROR_SUCCESS)
AfxMessageBox(_T("Got device"));
else
AfxMessageBox(_T("No device"));
RegCloseKey( hkTimeZone );
RegCloseKey( hkTimeZone2 );
/*
}
else
AfxMessageBox(_T("subkey not open"));
dwcbName = 512 * sizeof( TCHAR );
}
RegCloseKey( hkTimeZones );
*/
}
else
AfxMessageBox(_T("Open Register fail"));
retResult = TRUE;
}
else
AfxMessageBox(_T("BT not yet open!"));
}
else
{
AfxMessageBox(_T("BT not yet initialized!"));
BT_Init();
SPPConnectToSerialPort();
}
sdpHandle = SDAP_GetConnection(&device1);
sppConnection = SPP_Connect(&device1, &service, &frameSize, NULL,portName);
if(sppConnection == NULL)
{
AfxMessageBox(_T("Finally SPP Not connect"));
}
else
{
AfxMessageBox(_T("Finally SPP connect"));
}
I fail to get the device1 info from the method above.
Another question, how could I put the define for the path REMOTE_BLUETOOTH_DEVICE_SETTING which is always vary?
Please give me any comment or suggestion on this.
Thanks
|
|
|
|
|
I need help coming up with code that can teach students how to make change.
Students enter a price while computing a 5.6% sales tax also. The program will allow the student to enter the amount of change, as well as how many $20's,$10, $1, quarters nickels, and pennies to return to the customer.
If someone could help me (as im am learning the basics) with that i just need help on how to change the amuont the customer paid to an integer, or all cents, so that all the calcualtions will b with integers.
J-Dub
|
|
|
|
|
Am I right in thinking that when you say 'students', it means you're running a class, but you can't write this yourself ?
To make a double an int, use the floor function in math.h. To get the floating point bit, you could always subtract the int from the full value. There may also be a function that does this ( I am answering under the influence of jetlag, and I don't remember one right now )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
when i say students i mean that this is part of the program...kinda like a story. in this program i need to b able to calcualte everything into change but i dont kno how to do that
J-Dub
|
|
|
|
|
OK - did my suggestion help ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I got myself into a dilemma. I started a C++ project using MFC. Later I extended the application to interface to a C# dll.
According to Microsoft docs, my C# DLL will only be able to access HTML help. However my application can only use WinHelp, because that is the way I originally built it. I would like to use the same help application for both. I have not been able to find any documentation on how I could modify my MFC application to use HTML help. If anyone has any suggestions or could point me in the right direction I would be most thankful.
Craig
|
|
|
|
|
Hi,
I have uninstalled VC++ express edition 2005 and back to VC++ 6.0 .
I wanted to get back to some projects and enhance some points as well as some complementary requests.
However, now with Visual C++ 6.0 , I cannot have the extension *.dsp, only *.dsw !!
How can I get back properly to VC++ 6.0 ?
Thanks a lot,
Regards
TPP
|
|
|
|
|
Right click on a dsp file, choose 'open with' and check 'always use this program' ( obviously select VC6 )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Thanks, but in fact, it is with VC++ express edition 2005, which is cancelled by now, and all my projects are in VC++ 6.0.
I do not think that the concept of VC++ express edition 2005 follows the framework of VC++7.0.
But if you have experienced, that is pretty good to know!!!!!!
Otherwise, the question remains, how to get back *.dsp files while working back with VC++ 6.0?
Regards
and thanks!
|
|
|
|
|
Hi again
I have various classes that I use fairly regularly (mainly to do with souncards). I was wondering whether it is worth while generating a dll with the classes.
What are the advantages of using dlls over just including the classes within my application (other than the exe will be smaller)?
Also, can you use threads in dlls as well (I am new to threads as well!)
Thanks for (yet more) help!
Mike
|
|
|
|
|
Hi Mike,
Well, I have no idea about the dll thing. Since you talked about something related to soundcard, have you tried "The Synthesis ToolKit in C++ (STK)" library before? You can download it from:
http://ccrma.stanford.edu/software/stk/[^]
I don't know whether it fit your application, but for mine, it just perfect.
Regards,
Chris
|
|
|
|