email dialog locked

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

email dialog locked

Postby mcsh » Tue Feb 17, 2009 2:30 pm

when i use
Code: Select all
VpeControl.MailDoc();
or
Code: Select all
VpeControl.SendKey(KeyFunction.Mail);
from C#, the compose new mail dialog from outlook 2003 is shown, i can use the keyboard to input text in the fields, tab between the fields, but the mouse-cursor stays at HourGlass/WaitCursor and i can't click in the email-dialog.
i have to click on the desktop or any other application and then back to the email to get the mouse working

vpe version is 4.0.4.5427
mcsh
 
Posts: 8
Joined: Tue Feb 17, 2009 1:50 pm

Postby IDEAL Software Support » Tue Feb 17, 2009 4:36 pm

Sounds like the same problem with your own toolbar like in the previous post.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby mcsh » Wed Feb 18, 2009 9:44 am

I found a workaround: instead of using
Code: Select all
vpeControl.SendKey(KeyFunction.Mail);
i now use
Code: Select all
System.Windows.Forms.SendKeys.Send("{F3"}");

this works for Print (F2) as well

what puzzles me: as SendKeys.Send works, it seems like vpeControl actually has the focus because it recieves the keystroke
mcsh
 
Posts: 8
Joined: Tue Feb 17, 2009 1:50 pm

Postby IDEAL Software Support » Wed Feb 18, 2009 1:41 pm

No one knows the depths of events which are sent between your app, your toolbar and VPE. In addition I remember a comment in our source code that there are very weird things going on, when calling Outlook via Simple MAPI.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby mcsh » Wed Feb 18, 2009 4:07 pm

it seems to be related how dotnet handles ToolStrips - when i use a MenuStrip, it works without trouble.
when using the ToolStrip decoupling the events asyncronously helps:
Code: Select all
private void tsb_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
    new MethodInvoker(delegate()
    {
        tsb_ItemClickedHandler(sender, e);
    }).BeginInvoke(null, null);
}

private void tsb_ItemClickedHandler(object sender, ToolStripItemClickedEventArgs e)
{
    if(this.InvokeRequired)
    {
        this.Invoke(new MethodInvoker(delegate()
        {
            tsb_ItemClickedHandler(sender, e);
        }));
        return;
    }

    if(e.ClickedItem == tsbPrint)
    {
        vpeControl.SendKey(KeyFunction.Print);
    }
}


ugly, but works.
mcsh
 
Posts: 8
Joined: Tue Feb 17, 2009 1:50 pm

Postby IDEAL Software Support » Thu Feb 19, 2009 10:20 am

This seems to be basically the same like using the PostMessage() WIN-API.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 0 guests

cron