|
As covered on this forum many times before (which is why the "Search comments" link above exists), not all MAPI clients support every syntax. It wasn't even that long ago that most MAPI clients like Outlook, Outlook Express, Netscape, and others supported the "Body" parameter. This also means that a client must have a MAPI client registered.
Rather than relying on what's installed - which gives you little to no control as you've found - send the mail yourself using SMTP. There are many articles here on Code Project as well as on this forum. You can also get third-party libraries like IP!Works[^].
Using the System.Web.Mail namespace is also a bad idea because it requires a CDO library for the system. Only Win2K and above have this client library. NT4 uses something else, IIRC, and Windows 98/Me have nothing.
True SMTP support is being added to the .NET Framework for "Whidbey" (.NET 2.0) to replace this hazardous namespace.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hai all,
Somebody help me in this issue. I need to have a menu bar which is
RightToLeft aligned, which I can achieve by setting MainMenu's RightToLeft
property to "Yes". The problem that I get is, if one of MenuItems has
submenu...the arrow(or small triangle which indiates it has submenu) appears
in the left. I wanted to know when is this getting drawn. I want to trap
that and draw my own image to indicate that it has submenu. Below is the
code that I have written for DrawItem and MeasureItem for each MenuItem. Any
help is greatly appreciated.....
Thanks,
Madhavi.
private void menuItem1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
Rectangle rc = new Rectangle(e.Bounds.X+1 , e.Bounds.Y+1, e.Bounds.Width,
e.Bounds.Height-1);
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(51,102,153)), rc);
MenuItem s = (MenuItem)sender ;
RedrawSubMenuItems(s);
string s1 = s.Text +" |" ;
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Near ;
e.Graphics.DrawString(s1 , new Font("Ariel" ,9, FontStyle.Bold), new
SolidBrush(Color.FromArgb(255,255,128)) , rc , sf );
Console.WriteLine(e.State.ToString());
if ( e.State == (DrawItemState.NoAccelerator | DrawItemState.Selected) ||
e.State == ( DrawItemState.NoAccelerator | DrawItemState.HotLight) )
{
//e.Graphics.FillRectangle(new SolidBrush(Color.LightYellow) , rc);
e.Graphics.DrawString( s.Text , new Font("Ariel" , 9 , FontStyle.Bold |
FontStyle.Underline ) , new SolidBrush(Color.FromArgb(255,255,128)), rc
,sf);
//e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.Black)), rc );
}
|
|
|
|
|
Well I am knee deep into my first foray into socket programming. So i have a windows server based application that will listen for client requests and based on client requests does X Y Z. Well, I implemented a threadpool on the processing side, but I have found a major whole in my code. The socket seems to be only letting in once connection at a time. Yep, I did not implement thread pool on that end. So, does anyone have a sample code that I can use as a guideline to implement this or suggest somehting.
There was an article on code project that I cannot remember for the life of me. It dealt with getting a connection status of people connected to a server.
|
|
|
|
|
A quick search[^] on this site for "socket thread" yields many articles.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I have a binary which I wish to save to my local disk. I want to use a filestream to save this binary to my hard disk. In the case that it is already there, I want to delete it and then save it.
I used this code:
// Local is some file location
FileInfo fi = new FileInfo(local);
if(fi.Exists)
fi.Delete();
FileStream fstr = fi.Create();
fstr.Write(openedBinary, 0, openedBinary.Length);
fstr.Flush();
fstr.Close();
However, in the next line, I have another function that makes use of this binary which is now locally stored. SOMETIMES, that works, usually it doesn't. I don't quite know why! Can someone tell me why this would act unpredictably?
Cheers,
Jim
|
|
|
|
|
Okay, here's just one more thing i discovered. When I put a breakpoint on my open command, open the file externally (i.e. in Windows Explorer) close it, and THEN execute the open command it works. Its not a matter of waiting for a period of time, no matter how long I wait the open command won't work if I don't go and actually open the file.
Cheers,
Jim
|
|
|
|
|
Are you using a FileDialog control someplace in your application? The first thing you might want to try is simply using the full path for your file (local). That will probably solve your problem...
-DougW48
dwright@tdci.com
|
|
|
|
|
There's two things you must keep in mind - the application directory and the current working directory. When you start an application, the current working directory may not necessarily be the same as the application directory. Double clicking the EXE would yield this result, but a shortcut to your application may define a different working directory. A working directory can also be changed at runtime (i.e., while your application is running).
If you want that file to always be relative to your application, use the Application.StartupPath like so:
string filename = Path.Combine(Application.StartupPath, "file.dat"); Without specifying a full path starting from the drive path, the current working directory is used to resolve the file path.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I have a service that I built which sends emails out to subscribers which I have been testing for the past two weeks. I want to launch it into release mode running on my computer as a service, but I also want to be notified when the 'job' starts so I can monitor the logs.
I thought that I might like to have my computer beep a half dozen times when the job starts so that I will be notified.
However, it is a service therefore no window and no reference to windows.forms. I search through MSDN and codeproject and found many references to using DirectX and using MessageBeep but I don't really want to increase the size of my project to have references to large namespaces which will not really be used.
Is there another way to access the pc speaker and emit a tone via a service? If not, any other ideas how I could notify myself when a service starts processing work?
Tim
|
|
|
|
|
I have no idea if this actually works still in c#, or if you can do it in a service...but when I used to use C/C++, I would output \a to produce a generic system beep. In C++ it looked like this:
cout << "\a";
You might want to look at that as an option...
Good luck
- DougW48
dwright@tdci.com
|
|
|
|
|
That brought me back to Borland Turbo C and printf("\a")!
I tried Console.Write("\A") which I believe is the C# equivalent and unfortunately it didn't work...
Tim
|
|
|
|
|
Won't work since you don't have a desktop, UI, CONSOLE WINDOW to output anything to. So, no beep...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You can call the native implementation, you just need to P/Invoking the signature. The following will allow you to call MessageBeep .
[DllImport("user32.dll")]
static extern bool MessageBeep(uint uType);
|
|
|
|
|
A service can actually interact with the desktop because it can create a window station either one of two ways.- Run the service as SYSTEM and check the interactive option. This is highly discouraged, however, because a service rarely needs SYSTEM (like Administrative) privileges.
- Run the service as a user with interactive login rights. That user can still login interactively, but the service runs as that user. A separate window station (which hosts a desktop) is created for both.
You can read more about Windows Services - in general - at http://msdn.microsoft.com/library/en-us/dllproc/base/services.asp[^].
I am planning on releasing a new article about this hopefully this weekend if I get time to finish it up, so keep an eye on my articles if you'd like.
You could simply P/Invoke the native Beep API:
[DllImport("kernel32.dll", SetLastError=true)]
static extern bool Beep(
[MarshalAs(UnmanagedType.U4)] int dwFreq,
[MarshalAs(UnmanagedType.U4)] int dwDuration);
public void Beep()
{
if (!Beep(256, 500))
throw new Win32Exception();
} This is by far more simple.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Damn! :-> Beat me to it!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I'm trying to find a way to determine the size of the text in a LinkLabel. I want it to automatically resize itself. Other controls have a ContentsResized event, but the LinkLabel is sadly lacking. Any ideas? I was thinking that I could create a Graphics object from the control and call MeasureString to get the size of its text - when would be the best time to do this?
Will
|
|
|
|
|
Handle it in the TextChanged event. You are on the right track with using the MeasureString graphics object.
Good luck
- DougW48
dwright@tdci.com
|
|
|
|
|
That does make sense now that I've woken up a bit.
Thanks,
Will
|
|
|
|
|
Hi all,
been looking for a solution the following:
I have images of some buildings. The images are in perspective, and i would like to transform them so that it is in orthomode: top width is same as bottom width
Building on the initial photo image [perspective]:
/--\
/ \
/ \
/---- ---\
Building transformed to correct proportions:
----------
| |
| |
| |
----------
I've seen some people talk about Ransac but that needs 2 images from the same target so it can rectify based upon edge points.
I know the size of the building in meters. The corners are measured. Also i know the positions of the corners of the windows and doors.
Those points are 'picked' on the 'perspective image' also and the wish is to transform the perspective using the transformation parameters from the source- and target points into a new image.
Does anyone have an example, prefereably C#, or the theory behind this so i can reproduce the action?
Gdi 'only' has the option to rotate/move/skew but not something like the rectify i am looking for.
Hope someone can send me to the correct grid here )
Jan.
PS. the procedure is a little like creating a panorama --> identical points on the images should result in a combined image.
In my case i need the one image to be transformed to the coordinate system of the points of the measured building.
|
|
|
|
|
|
I want to know what are the classes that enable me
to controle by resource in C# like printer,flopy,cd room ,scanner,...
thanks.
|
|
|
|
|
Your english does not make sense.
If you're asking what classes to use to control the cd rom, floppy, printer, scanner, there's a wide variety of possibilities: for file and folder browsing, look at the System.IO namespace. For printing, look at System.Drawing.Printing.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Hi,
I want to know how to make the group headings appear in larger or bold type font.
Anyone know how to do this ?
|
|
|
|
|
And what "group headings" would those be? You need to be specific if you expect any sort of decent help.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
The "group names" then ? When you form the list into groups I want the group names to appear in bold or larger font.
"group name"
-------------------------
Group Item 1
Group Item 2
|
|
|
|
|