473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

It is invalid to show a modal dialog or form when the application

I have a 'solution' with a Webservice, Business layer and a data layer. In
the Business layer I've added a form that need to be started on the
server(this site has full rights, runs with Local System account), th BL is
called from the WS. So in my Business layer I've added code to start and
close the form, but I get the error:

"It is invalid to show a modal dialog or form when the application is not
running in UserInteractive mode. Specify the ServiceNotification or
DefaultDesktopOnly style to display a notification from a service application"

I've found info how to start a MessageBox, but I need to run the complete
form, not just a MessageBox.
How can I solve this?

Nov 16 '05 #1
4 7670
You are going to have to split up your process into multiple actions.
Basically, the WebService should not be showing any UI. What you can do is
have the UI make the call to the first web service, and if that succeeds,
show whatever UI element you need, then proceed to the next web service, and
so on, and so on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<an****@aleborg.se> wrote in message
news:27**********************************@microsof t.com...
I have a 'solution' with a Webservice, Business layer and a data layer. In
the Business layer I've added a form that need to be started on the
server(this site has full rights, runs with Local System account), th BL
is
called from the WS. So in my Business layer I've added code to start and
close the form, but I get the error:

"It is invalid to show a modal dialog or form when the application is not
running in UserInteractive mode. Specify the ServiceNotification or
DefaultDesktopOnly style to display a notification from a service
application"

I've found info how to start a MessageBox, but I need to run the complete
form, not just a MessageBox.
How can I solve this?

Nov 16 '05 #2
Hi!

I think you missunderstod me.
I call the webService, the WS calls a DLL(Business Layer). The BL contains
also a class file(the actuall BL) and a form, the form is called from the BL.

Client->webservice->BL->form
A dataset and som othe variables are passed to the form that render an
invoice from a panel and a bunch of labels, the panel with all containing
controls(labels and pictureboxes) are printed with a printdocument in the
form. That's how it works, is there any other way I can do this?

I tried to create a picture of the invoice on the client side and send the
image to the webservice and print it from there, but the quality was so bad
that it couldn't be used, tried to create png,gif,jpg,bmp and tiff, same
result with all. The code to render the image was the same that was used to
render the printdocument.

Regards
Anders Aleborg
"Nicholas Paldino [.NET/C# MVP]" wrote:
You are going to have to split up your process into multiple actions.
Basically, the WebService should not be showing any UI. What you can do is
have the UI make the call to the first web service, and if that succeeds,
show whatever UI element you need, then proceed to the next web service, and
so on, and so on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<an****@aleborg.se> wrote in message
news:27**********************************@microsof t.com...
I have a 'solution' with a Webservice, Business layer and a data layer. In
the Business layer I've added a form that need to be started on the
server(this site has full rights, runs with Local System account), th BL
is
called from the WS. So in my Business layer I've added code to start and
close the form, but I get the error:

"It is invalid to show a modal dialog or form when the application is not
running in UserInteractive mode. Specify the ServiceNotification or
DefaultDesktopOnly style to display a notification from a service
application"

I've found info how to start a MessageBox, but I need to run the complete
form, not just a MessageBox.
How can I solve this?


Nov 16 '05 #3
Anders,

You should not be calling any user interface functions in your web
service, at all. You can't show a form or render it on the server side, as
it would require interaction with the desktop (which your service should
never be doing, since there will probably be no desktop).

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<an****@aleborg.se> wrote in message
news:28**********************************@microsof t.com...
Hi!

I think you missunderstod me.
I call the webService, the WS calls a DLL(Business Layer). The BL contains
also a class file(the actuall BL) and a form, the form is called from the
BL.

Client->webservice->BL->form
A dataset and som othe variables are passed to the form that render an
invoice from a panel and a bunch of labels, the panel with all containing
controls(labels and pictureboxes) are printed with a printdocument in the
form. That's how it works, is there any other way I can do this?

I tried to create a picture of the invoice on the client side and send the
image to the webservice and print it from there, but the quality was so
bad
that it couldn't be used, tried to create png,gif,jpg,bmp and tiff, same
result with all. The code to render the image was the same that was used
to
render the printdocument.

Regards
Anders Aleborg
"Nicholas Paldino [.NET/C# MVP]" wrote:
You are going to have to split up your process into multiple actions.
Basically, the WebService should not be showing any UI. What you can do
is
have the UI make the call to the first web service, and if that succeeds,
show whatever UI element you need, then proceed to the next web service,
and
so on, and so on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<an****@aleborg.se> wrote in message
news:27**********************************@microsof t.com...
>I have a 'solution' with a Webservice, Business layer and a data layer.
>In
> the Business layer I've added a form that need to be started on the
> server(this site has full rights, runs with Local System account), th
> BL
> is
> called from the WS. So in my Business layer I've added code to start
> and
> close the form, but I get the error:
>
> "It is invalid to show a modal dialog or form when the application is
> not
> running in UserInteractive mode. Specify the ServiceNotification or
> DefaultDesktopOnly style to display a notification from a service
> application"
>
> I've found info how to start a MessageBox, but I need to run the
> complete
> form, not just a MessageBox.
> How can I solve this?
>


Nov 16 '05 #4
ok, do you have any suggestions on how to solve my problem.
As I described in my prevus post with sending an invoice to a printer on the
server, through a webservice?

"Nicholas Paldino [.NET/C# MVP]" wrote:
Anders,

You should not be calling any user interface functions in your web
service, at all. You can't show a form or render it on the server side, as
it would require interaction with the desktop (which your service should
never be doing, since there will probably be no desktop).

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<an****@aleborg.se> wrote in message
news:28**********************************@microsof t.com...
Hi!

I think you missunderstod me.
I call the webService, the WS calls a DLL(Business Layer). The BL contains
also a class file(the actuall BL) and a form, the form is called from the
BL.

Client->webservice->BL->form
A dataset and som othe variables are passed to the form that render an
invoice from a panel and a bunch of labels, the panel with all containing
controls(labels and pictureboxes) are printed with a printdocument in the
form. That's how it works, is there any other way I can do this?

I tried to create a picture of the invoice on the client side and send the
image to the webservice and print it from there, but the quality was so
bad
that it couldn't be used, tried to create png,gif,jpg,bmp and tiff, same
result with all. The code to render the image was the same that was used
to
render the printdocument.

Regards
Anders Aleborg
"Nicholas Paldino [.NET/C# MVP]" wrote:
You are going to have to split up your process into multiple actions.
Basically, the WebService should not be showing any UI. What you can do
is
have the UI make the call to the first web service, and if that succeeds,
show whatever UI element you need, then proceed to the next web service,
and
so on, and so on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<an****@aleborg.se> wrote in message
news:27**********************************@microsof t.com...
>I have a 'solution' with a Webservice, Business layer and a data layer.
>In
> the Business layer I've added a form that need to be started on the
> server(this site has full rights, runs with Local System account), th
> BL
> is
> called from the WS. So in my Business layer I've added code to start
> and
> close the form, but I get the error:
>
> "It is invalid to show a modal dialog or form when the application is
> not
> running in UserInteractive mode. Specify the ServiceNotification or
> DefaultDesktopOnly style to display a notification from a service
> application"
>
> I've found info how to start a MessageBox, but I need to run the
> complete
> form, not just a MessageBox.
> How can I solve this?
>


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andrew Baker | last post by:
OK this has me perplexed, puzzled and bamboozled! I have a remoting service which I displayed a message box in. I then wondered what would happen if a client made a call to the service while the...
2
by: jamie | last post by:
I have a class that based on a timer will pop up a dialog based on a lasped amount of time. The problem is that in the timer elapsed event I create and use ShowDialog to show the timeout form:...
2
by: Ricky K. Rasmussen | last post by:
Hi NG, We have a rather large ASP.NET application that uses popups to display various dialogs to the user. In our work we've come over a rather annoying "bug": If we open a modal dialog using...
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
11
by: AMDRIT | last post by:
Hello Everyone, VB.Net 2003 I would like to open a form (Form2) modally from Form1, then from Form2 display Form3 modally. It seems that once I open that third form and then close it, the...
1
by: dan.c.roth | last post by:
oForm.Close() vs this.Close() in a modal dialog. oFrom.Close() calls Form.Dispose() but this.Close() ,say in the click event of the Form, does not. I can think of the reason for this but is...
36
by: OldBirdman | last post by:
I want a form that is Modal, PopUp, and Dialog, but that is hidden most of the time so that the fields are available to the code of my other forms. Modal means that only the form can have control,...
2
by: diogenes | last post by:
I have created many shortcut/popup (aka context, or right-click) menus for my application - instead of toolbars or standard drop-down menus. Within my custom menu, I am using...
5
by: Enij | last post by:
Hi All, If I type this code (VB.net 2003): Dim myDialog As frmTestDialog myDialog = New frmTestDialog myDialog.Show()
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.