|
Two thoughts
1 - is it a debug version
2 - is it building OK ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yeah, it builds app OK. and Runs OK. Only Debugging Hassle. I am applying the Upgrade Patch.
Tapas Shome
System Software Engineer
Keen Computer Solutions
1408 Erin Street
Winnipeg, Manitoba
Canada R3E 2S8
www.keencomputer.com
|
|
|
|
|
But it's a debug version ? What's the error ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Which kind of application you trying to build?
Web or Win?
Different scenarios for different types of applications. Also myriad reasons for the debug not to work.
Post the exact problem and I am sure we can help you with that.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
Hi everybody!
I'm using smtp client to send an email.
but for my surprise, even though I'm clicking the button that gives the command to send an e-mail, the e-mail itself is not sent until the application is closed!
that is extremly weird, does anyone have an idea how to overcome this problem, or maybe have encountered it?
Thanks!
|
|
|
|
|
Hello
Well, do you use Send() or SendAsync()? as another way of knowing what's wrong try to make a breakpoint when you click the button and monitor the code excutiong setp by step. Also if you handle the closing event and/or the dispose of the smtpclient, another breakpoint would be handy!
Regards
|
|
|
|
|
I'm using Send().
I debugged it, and it simply reads through the smpt.Send() and does nothing. It seems like it queues the sending till I close the application.
|
|
|
|
|
Hello
Well, err... I got one stupid solution but may work!! Make a smtpClient for each message, and after sending the message, dispose that client!! Maybe somehow in your code you got it to sned upon disposal!!
PS.
Have you entered any code in the dipose/closing methods?
Regards
|
|
|
|
|
I thought about it, but it seems that there is no dispose method! (thats even more weird!)
|
|
|
|
|
Hello
Two points:
1- Send() should be blocking!! How do you exit you application without completing send??
2- Try makeing SendAsync() and handle the SendCompleted event!! Maybe it will work!!
3- If nothing is working, debug through your application and see at which line the message is actually sent
Regards
|
|
|
|
|
I found out what wrong - and you would never guess what it is!
Its the norton internet security!
its delaying the e-mail sending until the process is closed.
I restarted my system without it and my program worked fine!
But that leads me to a whole new way of thinking about that problem (I don't want people to start disabling this option).
I thought of making a "sender", a console file that will make the sending itself, than after each sending it will terminate itself and the mail will be sent.
The problem is that I'm looking for a way to know if the mail was sent correctly or there was an error.
if I change my sender's program Main method to return "int", and I'd run that process from the main window, is there a way to get the value that is being returned from the sender?
Thanks alot for your help!
|
|
|
|
|
Hello
Great!! It's one of those problems that you have to think more stupid than your computer to figure out what's wrong!! I'm glad you made it though.
Anyway, if you want to get the ExitCode of your process:
int TimeOut = 60000;
Process MySender = new Process()
MySender.Start();
if(MySender.WaitForExit(TimeOut))
{
}
else
{
}
I hope it works this time -though I don't like this console idea!!-.
Regards
|
|
|
|
|
hehehe Yeah, I guess this problem killed most of my brain cells
I don't like that console idea either, but I already tried to create another class that will do the sending for me, and after the sending dispose it. But it still doesn't work (ARGH!!!!!).
I will try to make a new class in another project to make the sending for me, and than completly kill that process!
I hope that will work, if not - I'm out of ideas, just the console one.
I'm open for suggestions!
|
|
|
|
|
Hello
Well, uhm!! I got a non programmatic solution.. If you just want to make things easy for yourself, try in your program's documentaion -like some companies do- warn about this issue and tell the users how to make your program in the trusted programs list of NIS...
If I kill more brain cells;) and find out another way I'll keep you posted.
Regards
|
|
|
|
|
Yes that is a AV symptom.
To have the workaround, create a security and permission descriptor, usint the AV API using the Interop, and assign it to the context before making a call to Send. This exclusive permission will let the application send the mail without hitch.
There are other ways, like masquerading the hooks isntalled by the AV etc, but then they should be used in only extreme scenarios.
Let me knwo if you got it.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
Thanks!
I'll try to do that, if I have any problems... you'll hear from me .
|
|
|
|
|
Hey
well, it works with the console thing.
I really prefer not to post a warning and fix it this way because many users are using norton.
Thanks alot!
|
|
|
|
|
Hey, its working with the console thing.
unfortunately only with the console, I cannot find another way to override this norton checkup.
Thanks alot for you help!
if you come up with an idea, I will be more than happy to hear about it
|
|
|
|
|
please send the respective code for more precise answer
|
|
|
|
|
Hey, thanks for your help.
I'm sending an e-mail in the most simple way I can think of.
after I'm using smtp.Send() nothing happens, only after I close the app.
MailAddress sender1 = new MailAddress("none@unknown.com");<br />
MailAddress rcpt = new MailAddress("green.fuzer@gmail.com");<br />
<br />
MailMessage mailMsg = new MailMessage(sender1, rcpt);<br />
<br />
mailMsg.Subject = "Test Mail Sender";<br />
mailMsg.Body = "Body Testing";<br />
smtp.Send(mailMsg);
|
|
|
|
|
I have this RichTextBox. I want to send it the message behind the Keys.PageDown key. Seems to me it worked if I used the OnKeyPress, but OnKeyPress takes a char, not a Keys enum (so I tried to use OnKeyDown/OnKeyUp, but it didn't do anything).
I figured I could then try RichTextBox.ProcessKeyEventArgs, but then I quickly learned that it took a ref Message argument, not a KeyEventArgs argument (kinda deceptive if you ask me).
So, I tried to start giving it the right message, but I'm stuck on the last three parameters of Message.Create(). Where do I find a list of int messages (and its appropriate wparam and lparam arguments)?
I've tried looking in my MSDN, but "message" is kind of a vague term to look for (I looked and didn't see anything useful). And I tried to do a search on CP, but didn't see what I'm looking for.
All I want to send it is the pagedown key message. Can someone please help me fill in the blanks?:
public class myRichTextBox : RichTextBox
{
public void PageDown()
{
base.ProcessKeyEventArgs(ref Message.Create(this.Handle, [what goes here?]));
}
}
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Put in something like this:
Message msg = Message.Create(this.Handle, WM_KEYDOWN, new IntPtr((int)e.KeyCode), IntPtr.Zero);
base.WndProc(ref msg);
e.Handled = true;
DLLImport User32.DLL and declare WM_KEYDOWN message as:
public readonly static int WM_KEYDOWN = 0x0100;
Let me know if you got that!
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
Arjun "Mjolnir" Bahree, you rock.
It works perfectly, except that I had to take out the DllImport line because the compiler (just csc.exe) was giving me:
error CS0592: Attribute 'System.Runtime.InteropServices.DllImport' is
not valid on this declaration type. It is valid on 'method' declarations only.
However, I do have one little question... since I'm sending it a WM_KEYDOWN message, do I have to send it a keyup message as well? Will it think I'm holding down the pagedown key if I don't send it a keyup message?
(I just shortened the pre text so that it wouldn't stretch the browser window out)
-- modified at 16:16 Saturday 9th September, 2006
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Ohhh! The DLLImport line was for some more tasks that you could have achieved but I did not mentione for brevity's sake. And ideally it is meant to import user32.dll.
Yes you need to send keyup message. Else it will keep on sending the pagedown messages to the control.
Excelsior
Arjun Bahree
"By The Might of Mjolnir"
I Came! I Coded! I Conquered!
|
|
|
|
|
I wasn't sure if I should send it a keyup message as well (so it won't think I'm holding the key down), so I added it (WM_KEYUP, 0x0101).
By the way, a little while ago I found a list of windows messages (Googling "list of windows messages"), but didn't know how to use them.
Thank you, Arjun "Mjolnir" Bahree!
-Daniel
Typing too fast fro my owngood
|
|
|
|