|
You can't access the controls of the form wihtout a reference to the form object.
---
b { font-weight: normal; }
|
|
|
|
|
Hi.
I want to make a setup for my application that automatically and in background installs .Net Framework 2 with my application.
Can you help me, please?
Best wishes
|
|
|
|
|
How i can convert user define structure into byte array,or tell me how can i send struct through socket?
|
|
|
|
|
Use Binary Serilazation.
The only trick here is that the "other side" needs to know the class\struct structure (both must use the same dll describing the class\struct).
there is a good example on the MSDN help.
Gilad.
|
|
|
|
|
Make your structures as Serializable.
[Serializable]
struct Person
{
public string name;
public int age;
};
Use binary serialization/deserialization to convert your structures to byte array and vise versa
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Hi,
Can someone simply explain the usage and benefit of delegate with a simple example please?
Thanks
|
|
|
|
|
|
My program is about image processing for vets. We added the ability to send email using the built in .NET stuff, and the biggest client complaint is that they don't know if it sent or not, as it's not in their outbox. What I want to do is send the mail, by whatever means I don't care, and then if Outlook is present on the machine, stuff the message into the outbox, if it's not present, look for Outlook Express and do the same. What I don't want is to be tied to any version of Outlook, I want it to work for any version, and not require any version to be installed. I've looked through MSDN, but found nothing of value. I appreciate any suggestions.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I guess it would be tough to do it from managed code, as you'd need the interop DLLs for interacting with the outlook COM objects and I don't know of interop DLLs for one version of Outlook will work with another.
How about writing a MC++ library that directly uses COM to do the job? That way, you can easily check for the CLSIDs and create the right COM objects.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
remember that different versions of ms office (i.e Office XP Pro, Office XP Small Business edition) will have different CLSIDs. In the outlook object model there is a method that will tell you which version of outlook is installed. If you want i can give you an implementation of how I had setup to send emails via outlook through my application. I dont know if the same is possible via Outlook Express.
|
|
|
|
|
Christian Graus wrote: as it's not in their outbox.
I assume you mean, sent items rather than outbox?
Outlook programming is fraught with difficulties due to all the protection added due to the spate of worms that misused its wonderful application model. Things get worse when dealing with Outlook Express as it doesn't have an object model or support MapiEx.
Back in the day, I used to use MapiEx to interact with Outlook. This was in non-managed C++. You may be better off looking to see if MAPI will give you what you need.
A good starting point for Outlook related programming is http://www.outlookcode.com/[^]
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
Well, I had to solve a part of this problem about two years ago and it wasn't easy! As the poster below says it requires Extended MAPI if you want to bypass Outlook's Security model (if this doesn't matter then simple MAPI is OK). I also had the added complication of having to initiate the sending from 16-bit client applications.
What I found was that there was no simple example anywhere that provided the solution. I had to combine bits from a sample application from the book, Inside MAPI, plus MSDN code snippets, plus newsgroup snippets, plus trial and error. Then I had to solve the:
"works on my machine but not on yours"
"works in debug but not release"
issues.
Kevin
|
|
|
|
|
What about using something like
Process.Start("mailto:someone@somewhere.com?subject=Some Subject&body=Have a nice day"); That way the default mail client opens (be it Outlook, Outlook express or anything else) and a new mail is composed for the user to send. That way they'll see the mail leave their computer in the usual way.
The only disadvantage I couldn't solve so far is that you can't seem to add any attachments.
Regards,
mav
-- modified at 15:13 Sunday 18th December, 2005
Update: Adding &attachment=\"\"C:\\MyFile.txt\"\" actually does work with my Outlook 2002, too!
|
|
|
|
|
Here is the source code that i had used to send an email with attachments via Outlook(minimum version is 2000)
Outlook.Application oApp;
Outlook._NameSpace oNameSpace;
Outlook.MAPIFolder oOutlookFolder;
oApp = new Outlook.Application();
oNameSpace= oApp.GetNamespace("MAPI");
oNameSpace.Logon(null,null,false,true);
oOutlookFolder = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail);
Outlook._MailItem oMailItem = (Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
Outlook.Inspector myinspector;
myinspector = oApp.ActiveInspector();
oMailItem.Display(false); //display the blank email first
oMailItem.Subject = "Email with Attachments";
//filename is a string which represents the filepath of the file
//display_filename is a string which is the actual filename of the attachment
oMailItem.Attachments.Add(filename,1,1,display_filename);
oMailItem.Display(true); //display the email with the actual attachment.
To determine different versions of outlook you can try the version Method from the Outlook Object model as follows:
Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
string outlookVersion = oApp.Version;
I hope this helps.
cheers
-- modified at 17:34 Sunday 18th December, 2005
edit: The code in this sample will work with Outlook Object models 9.0,10.0 and 11.0.
|
|
|
|
|
This looks great, thanks. Now, what do I need to make this work ? Do I import Outlook COM dlls, or do I need the VS2005 Tools for Office ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
you dont need VS2005 tools for Office to use the Outlook COM dlls (Outlook object model). You can simply add the Outlook Object model via Add References (COM) in any visual studio IDE. You need to ensure that you have outlook installed on your development PC. If you dont then you can download the "Office XP Primary Interop Assembles" setup file from microsoft.com. This setup file will contain all the Office XP interop dlls associated with say Outlook, Word, Excel etc.
Once you have added the Outlook reference to your project simply type:
using microsoft.office.interop.outlook
hope this helps.
|
|
|
|
|
Perhaps an easier solution would be to cc the sender and have the emails filtered into a special folder. Or cc the email to a special address for this purpose only.
|
|
|
|
|
I want check if the user press the F1 to F12 keys
i try put it under keypress method of the form but the F1 to F12 key is not captured by key press event
i want to know how do i trigger F1 to F12 keys
thanks in advance....
Jalil
|
|
|
|
|
have you tried using the KeyDown eventhandler an example would be
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (Keys.F12.ToString() == e.KeyCode.ToString())
{
MessageBox.Show("F12 Key Pressed");
}
else
{
MessageBox.Show("F12 Key was not Pressed");
}
}
|
|
|
|
|
|
thanks for the reply it works.
|
|
|
|
|
I need to flush the IconCache. So i did this TweakUI thingy (iconsize - 1, refresh, iconsize + 1, refresh).
Key = Microsoft.Win32.Registry.CurrentUser;
Key = Key.OpenSubKey(@"Control Panel\Desktop\WindowMetrics", true);
Key.SetValue("Shell Icon Size", (Size-1).ToString());
SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS, 0);
Key.SetValue("Shell Icon Size", Size.ToString());
SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS, 0);
Key.Close();
i am using this DllImport
[DllImport("user32.dll")]
static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);
and these constants:
HWND_BROADCAST = 0xffff;
WM_SETTINGCHANGE = 0x001A
SPI_SETNONCLIENTMETRICS = 0x002A;
so i have the flush most of the time BUT the app stops at the 2nd send message somehow. anybody has an idea why?
|
|
|
|
|
Which app freezes? The one sending the message (code posted above) or the one that you're trying to get to update? If it's the one above it's probably another app not handling the broadcast fast enough. I believe that the SendMessage will not return in this case until all of the apps have handled HWND_BROADCAST. Can you change it to a PostMessage instead?
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
Hi all.
I saing from the beginning : My English is very bad!!!:-OOk,i am asking my questions...
I ManagementObjectSearcher ' s wanting to use sql clause constructor.Which can i sql clause to this constructor???Can you give them list to me....
Example:
private static System.Management.ManagementObjectSearcher nesne=new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");
"SELECT * FROM Win32_DiskDrive" <<<<----- As Of this .I want to my can use sql clause...Please help me!!!
Thanks...
|
|
|
|
|