Click here to Skip to main content
15,916,215 members
Home / Discussions / C#
   

C#

 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Dave Kreskowiak9-Oct-08 5:24
mveDave Kreskowiak9-Oct-08 5:24 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Spoon659-Oct-08 22:11
Spoon659-Oct-08 22:11 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Spoon6513-Oct-08 22:37
Spoon6513-Oct-08 22:37 
GeneralRe: Including c# v2.0 library in a c# v1.1 library. Pin
Dave Kreskowiak14-Oct-08 1:52
mveDave Kreskowiak14-Oct-08 1:52 
AnswerRe: Including c# v2.0 library in a c# v1.1 library. Pin
Dan Neely9-Oct-08 4:06
Dan Neely9-Oct-08 4:06 
QuestionTabular crystal reports using query not through wizard Pin
tanvir20909-Oct-08 2:11
tanvir20909-Oct-08 2:11 
JokeRe: Tabular crystal reports using query not through wizard Pin
nelsonpaixao9-Oct-08 13:46
nelsonpaixao9-Oct-08 13:46 
QuestionStartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
Piratenwichtl20009-Oct-08 0:25
Piratenwichtl20009-Oct-08 0:25 
Hi Guys,

the code I was using for one of my previous application worked perfectly.
But not any more - using visual studio 2008 and .Net 2.0.

I read a couple of articles .... I also came accross this sample:

http://www.codeproject.com/KB/cs/prettygoodsplashscreen.aspx

Well, after downloading and running this sample I got the same error again.
when puttin this in the Stat-thread-method:
CheckForIllegalCrossThreadCalls = false;

it works fine, but this is not the right solution in my opinion.

I appreciate any suggestions for a clean solution, how to show a splascreen before starting the application / showing the main form. (couldnt find anything useful on the internet)

thanks

best regards
tom

ps- my startupform code:

public partial class StartUpForm : Telerik.WinControls.UI.ShapedForm
{
private static Thread _splashLauncher;
private static StartUpForm _splashScreen;
private static event Error _RaiseException = null;

public StartUpForm()
{
InitializeComponent();
radWaitingBar1.StartWaiting();
label2.Text = "Initalising Software.....please wait...";
}

~StartUpForm()
{
radWaitingBar1.EndWaiting();
}

private static void RaiseException(string ErrorMessage, Exception ex)
{
if (_RaiseException != null)
_RaiseException.Invoke(ErrorMessage, ex);
}

public static void ShowSplash()
{
try
{
_splashLauncher = new Thread(new ThreadStart(LaunchSplash));
_splashLauncher.IsBackground = true;
_splashLauncher.Start();
}
catch (ArgumentNullException ex)
{
RaiseException("The start parameter is a null reference", ex);
}
catch (ThreadStateException ex)
{
RaiseException("The thread has already been started.", ex);
}
catch (SecurityException ex)
{
RaiseException("The caller does not have the appropriate SecurityPermission.", ex);
}
catch (OutOfMemoryException ex)
{
RaiseException("There is not enough memory available to start this thread.", ex);
}
}

private static void LaunchSplash()
{
_splashScreen = new StartUpForm();
try
{
Application.Run(_splashScreen);
}
catch (Exception ex)
{
RaiseException("A main message loop is already running on the current thread", ex);
}
}

private static void CloseSplashDown()
{
Application.ExitThread();
}

public static void CloseSplash()
{
MethodInvoker mi = new MethodInvoker(CloseSplashDown);
_splashScreen.BeginInvoke(mi);
}
}


code for application entry point:

static class Program
{
///
/// Der Haupteinstiegspunkt für die Anwendung.
///

[STAThread]
static void Main()
{
try
{

//CheckForIllegalCrossThreadCalls = false;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
StartUpForm.ShowSplash();
Application.Run(new Form1());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + ex.InnerException + ex.StackTrace + " " +
Thread.CurrentThread.ManagedThreadId);
}

}
}
AnswerRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
S. Senthil Kumar9-Oct-08 3:53
S. Senthil Kumar9-Oct-08 3:53 
GeneralRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
Piratenwichtl20009-Oct-08 4:10
Piratenwichtl20009-Oct-08 4:10 
GeneralRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
S. Senthil Kumar9-Oct-08 4:51
S. Senthil Kumar9-Oct-08 4:51 
GeneralRe: StartUpForm / Splashscreen - Crossthreading / InvalidoperationException Pin
Piratenwichtl20009-Oct-08 6:30
Piratenwichtl20009-Oct-08 6:30 
QuestionAccess C# Variable in to java Script Function Pin
mharoonkhan8-Oct-08 23:48
mharoonkhan8-Oct-08 23:48 
AnswerRe: Access C# Variable in to java Script Function Pin
SeMartens9-Oct-08 0:20
SeMartens9-Oct-08 0:20 
AnswerRe: Access C# Variable in to java Script Function Pin
vijaiganesh9-Oct-08 0:37
vijaiganesh9-Oct-08 0:37 
AnswerRe: Access C# Variable in to java Script Function Pin
Ennis Ray Lynch, Jr.9-Oct-08 3:16
Ennis Ray Lynch, Jr.9-Oct-08 3:16 
Questiondesign asynchronous interface Pin
George_George8-Oct-08 23:15
George_George8-Oct-08 23:15 
AnswerRe: design asynchronous interface Pin
Simon P Stevens9-Oct-08 3:17
Simon P Stevens9-Oct-08 3:17 
GeneralRe: design asynchronous interface Pin
George_George10-Oct-08 22:57
George_George10-Oct-08 22:57 
GeneralRe: design asynchronous interface Pin
nelsonpaixao9-Oct-08 13:49
nelsonpaixao9-Oct-08 13:49 
GeneralRe: design asynchronous interface Pin
George_George9-Oct-08 22:34
George_George9-Oct-08 22:34 
GeneralRe: design asynchronous interface Pin
nelsonpaixao10-Oct-08 13:09
nelsonpaixao10-Oct-08 13:09 
GeneralRe: design asynchronous interface Pin
George_George10-Oct-08 22:59
George_George10-Oct-08 22:59 
QuestionA potentially dangerous Request.QueryString value was detected from the client (ReturnUrl="...1111&#Write"). [modified] Pin
mimimimilaw8-Oct-08 23:05
mimimimilaw8-Oct-08 23:05 
AnswerRe: A potentially dangerous Request.QueryString value was detected from the client (ReturnUrl="...1111&#Write"). Pin
Guffa8-Oct-08 23:52
Guffa8-Oct-08 23:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.