|
1. edit your message and move your code block into a <pre></pre> tags block
2. why do you add line breaks by hand ?
3. don't do what you're trying to do. this is a security reason. let the user know that your application uses his email id to send mails.
|
|
|
|
|
1. I dont have any pre /pre tags block. Normal C++ code.
2. To make it look nice?
3. It is a user request to add it. The program is sending hundreds of emails. Waiting 5 seconds per email will take considerable time, the problem has to be solved somehow.
|
|
|
|
|
Abris wrote: 1. I dont have any pre /pre tags block. Normal C++ code.
i meant HTML in your message, not in your source code
Abris wrote: 2. To make it look nice?
it doesn't, it breaks the line in the middle of my screen !
Abris wrote: 3. It is a user request to add it. The program is sending hundreds of emails. Waiting 5 seconds per email will take considerable time, the problem has to be solved somehow.
then your application is badly designed. you shouldn't use Outlook for that then...
|
|
|
|
|
1-2. No comments.
3. Nope, not bad design since it is the only option that will work on our system.
|
|
|
|
|
Abris wrote: 1-2. No comments
much better
Abris wrote: 3. Nope, not bad design since it is the only option that will work on our system.
i think some APIs exist to send mails without having a particular client (like outlook) installed. you only have to know how to connect to the SMTP server....
|
|
|
|
|
I have had limited success with these APIs. The ones that I have gotten to work only works for internal email at the firm, when adding outside mail adresses they have all failed. With Outlook solution all mails have successfully reached the destination, but ofcourse with the cost of the security warning.
|
|
|
|
|
Abris wrote: 3. It is a user request to add it. The program is sending hundreds of emails. Waiting 5 seconds per email will take considerable time, the problem has to be solved somehow.
Use MAPI, SMTP, or CDO then. Trying to bypass Outlook's security is a bad idea.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Bypassing security is both a bad idea and a lot of fun. I thought bypassing microsoft security was something that all of us find funny
-- modified at 11:13 Tuesday 23rd January, 2007
|
|
|
|
|
Note the following remarks from MSDN:
If the button is in a dialog box and the dialog box is not active, the BM_CLICK
message might fail. To ensure success in this situation, call the SetActiveWindow
function to activate the dialog box before sending the BM_CLICK message to the button. Note that I have had limited success is using the BM_CLICK message, but often do well using BN_CLICKED - which is a good old fashioned WM_COMMAND based notification.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks for the tip, but unfortunately it does not work even when I add SetActiveWindow(hWnd); to the code or replaced BM_CLICK with BN_CLICKED, the Postmessage just do not have any effect
|
|
|
|
|
Abris wrote: or replaced BM_CLICK with BN_CLICKED,
You cannot just replace BM_CLICK with BN_CLICKED - you have to use WM_COMMAND as the message, the button's HWND as the LPARAM and the button's dialog control ID and BN_CLICKED as the WPARAM , wrapped into a WORD value. Look up the BN_CLICKED notification in MSDN for more information.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Sorry my mistake, should ofcourse have checked the manual before . But even when trying "SendMessage(hWnd, WM_COMMAND, MAKELONG(0x12A6, BN_CLICKED), (LPARAM)YesButton);" which should be the right way to send the message the Sendmessage/Postmessage has no effect on the button (with ActiviteWindow as hWnd). Anyone has more ideas?
|
|
|
|
|
I recently ran into this same problem but for entirely different reasons. I was using this article's[^] code for doing unattended sending of email. After a new XP image was placed on the PC, this program began to fail in a very unpredictable manner. Instead of getting a new image installed which unfortunately can take a lot of time here, I installed a very old version of the program that used simple MAPI and worked just fine with Outlook 97!. The very first time the program got invoked and went to send out about a dozen emails, up popped this dialog. Did I mention that this PC was running unattended Man was I pissed. Anyways, I reverted back to Noel's code and using it instead, does not cause that dialog to come up. If you are presently using something like simple MAPI, you should be able to convert to it easily.
Chris Meech
I am Canadian. [heard in a local bar]
I agree with you that my argument is useless. [Red Stateler]
Hey, I am part of a special bread, we are called smart people [Captain See Sharp]
The zen of the soapbox is hard to attain...[Jörgen Sigvardsson]
I wish I could remember what it was like to only have a short term memory.[David Kentley]
|
|
|
|
|
Oki, have gotten around the warning dialogue using this class. But the fact that the button still not can be presses is bugging me. Must be a way to press it since there are comercial products out there that does just what I wanted to do, more ideas please
|
|
|
|
|
|
Symantec apparently has a nice library of controls. I've alway likes their UI. I personally
can't stand UI coding so I'd sure like to use their code
Sorry, what was your question again?
Mark
|
|
|
|
|
In VC++, for following program,
class A
{
int a;
char b;
};
void main()
{
A a;
cout<
|
|
|
|
|
because the members are alligned on the size of the bigger member...
|
|
|
|
|
In order to acheive 1Byte alignment,try the following :
#pragma pack (1)
class A
{
int a;
char b;
};
#pragma pack (1)
Eli
|
|
|
|
|
this shouldn't be done unless you are on a very specific requierement (and plateform).
if you have to save some memory from the object size, better rearrange the members order first.
|
|
|
|
|
Hi toxcct ,
toxcct wrote: this shouldn't be done unless you are on a very specific requierement (and plateform).
It's correct , but from his question , i think that he ment that the data
should be 1Byte aligned.
toxcct wrote: if you have to save some memory from the object size, better rearrange the members order first.
It is not always possible (for example if you got an ICD of another
machine and you need to "Speek" with the same language of that machine -
you can't change the members order ).
Regards,
Eli
|
|
|
|
|
It is called padding - the size of the structure is padded with empty space to optimize its access. A 32-bit system moves data in 32-bit chunks faster than data that is not sized at 32-bits.
Note tha packing may also impact the size of the structure - structure members are normally aligned in order to optimize their access (non-aligned access is allowed x86 architecture, but it takes a performance hit). 32-bit values are aligned to start at a 32-bit boundary, 16-bit values are aligned to a 16-bit boundary, etc. by moving the start of the structure in memory so that it lies on its natural boundary (32-bit boundary, for example).
struct STest
{
DWORD m_dwValue;
char m_cValue;
};
struct STest2
{
DWORD m_dwValue;
char m_cValue;
int m_iValue;
};
struct STest3
{
DWORD m_dwValue;
short m_siValue;
char m_cValue;
};
The sizes of the structures (with default 32-bit padding) are 8 , 12 and 8 bytes, respectively, and are layed out in memory as follows:
FF FF FF FF 61 <code>CC CC CC</code>
FF FF FF FF 61 <code>CC CC CC</code> 11 00 00 00
FF FF FF FF 12 34 7A <code>CC</code> Bold ed bytes are the padding/packing bytes.
When laying out the order of members in a structure, if you place them so that they are more likely to fall on their natural alignment, you can reduce the footprint of the structure.
You may have to force the packing of a structure when sharing serialized (saved to some medium) data between two different applications/systems, like when sending data over a socket to a server - both systems have to agree on the packing/padding of the data in order to read it correctly.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hello, I have a problem that I simply can't solve on my own.
Background:
I have a single document MFC application where the user may doubleclick on a piece of text and thereby call forth a dialog window for editing the text. That text is displayed in a Static text box. If I make a change to the text I can use Ctrl+Z or Ctrl+Y to Undo/Redo and that is great but some users do not know all short-commands so I also want to make an Undo button and a Redo button to do the exact same things. Outside the dialog in my application the accelerators Ctrl+Z and Ctrl+Y are tied to my own-defined Undo/Redo functions that are specific to my application so how do I find out what events the Ctrl+Z and Ctrl+Y accelerators in the dialog triggers?
Problem:
Since Ctrl+Z/Ctrl+Y works in my dialog although they are not defined in my IDR_MAINFRAME Accelerators they must obviously be connected to functions that are specific for performing Undo and Redo in a Dialog window. How do I connect those functions to two Undo Redo buttons as well?
Visual Studio version:
Microsoft Visual Studio 2003
|
|
|
|
|
The standard edit control has its undo/redo functionality built it, just as the Rich Edit control does - you do not really have to do anything to and you get it for free.
You can implement the button handlers so that they send EM_UNDO messages to the edit control. Lookup the EM_UNDO message for more details.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks a bunch, that was just the info I neeeded!
|
|
|
|