|
Ok, there's no secret about it. TO is an array of forms, TOS is an array of integers. So when I try to open a new form, first i must know which form to try to open. It's part of a dumb mechanism. My problem is with num. I am SURE I am not trying to open the wrong form, but I want to ask you, could the rest of the function that calls TO[num].Show() be the problem? And by the way, my program is full of try-catch but you see, this error doesn't throw any exception, it displays a part of the form it should display and it stops working. Then I get that nice message about sending the report and I wonder if microsoft's coders want to help me solve the problem...
|
|
|
|
|
Ok sounds good.
So TO[num] is available and not null?! the string you give to receive(...) is ok?
Then I see the problem, if you thought to check this. The programm should work, but it doesn't. I got a similar error a few weeks ago.
The application crushed while calling a method of an object which was definitivly ok. The solution - sound strange - was to build the project new. I started with an empty projectmap, added empty projects, copied the forms and classes in the directory added each class and compiled again. After that the programm runned whithout any mistake (did I mentioned that I hate .Net? ) !
Greetings,
Ingo
|
|
|
|
|
The solution to the problem remains illusive... please if anyone can help me... I wonder if the problem is that I am calling TO[num].Show() from
public void OnReceive(IAsyncResult ar) , now is have to go...
|
|
|
|
|
I don't think so. Why should there be a problem. It's just an event. But you can find out. Don't show the form, start a timer instead, then from the timer-event you can show the form after e.g. 100 ms. If that works, you got the problem, if it doesn't work you know that this isn't the problem.
Greetings,
Ingo
|
|
|
|
|
Ok, I am finally home and I am going to try the timer thing...
|
|
|
|
|
Tried the timer, it simply doesn't trigger. Nothing hasppens. It is incredible.
|
|
|
|
|
You can't display a form from a threadpool thread (which I think OnReceive is). This[^] article tells you why it's a bad idea to do any UI manipulation from a non UI thread. For your problem, I'd suggest calling Invoke like this
delegate void FormShowDelegate(Form f);
public void OnReceive(IAsyncResult ar)
{
TO[num].Invoke(new FormShowDelegate(ShowForm), new object[]{TO[num]});
}
private void ShowForm(Form f)
{
f.Show();
}
This of course, assumes that you populated the TO[num] array from the UI thread..
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thank you verry much. I found out that the function runs in a new thread (or something like that) and to call a function in the main thread I would use invoke a few hours ago. Still, thank you very much, I'm so happy the program works now
Cheers
|
|
|
|
|
I'm a bit of a tyro when it comes to .net, so I'm sorry if this question sounds very basic.
I want to create an EXE, which will offer a File Open dialog box. The user has to select a DLL which contains a class that implements a specific interface. I want to be able to create an instance of the class contained in the DLL and call some methods that it exposes, passing certain parameters and receiving return values.
How can I do this? I'd be grateful if anybody can kick me in the right direction.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
i dont mind to be
a stupid,better than being a moron - Adnan Siddiqi.
|
|
|
|
|
Hi Vikram,
Guess the following link will help you.
http://www.kdkeys.net/forums/785/ShowPost.aspx
Thanks and Regards
Pani
|
|
|
|
|
Thanks, Kodanda Pani.
I don't know VB, but I should be able to decipher it.
Thanks very much.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
i dont mind to be
a stupid,better than being a moron - Adnan Siddiqi.
|
|
|
|
|
Reflection is the way to go. You can use Assembly.Load[^] or one of its variations to get an Assembly object, then use the GetExportedTypes[^] method on that Assembly object to retrieve types in that assembly. You can then iterate over the types and use FindInterfaces[^] to check if that type implements the interface you want. Activator.CreateInstance[^] creates instances given the type and you should find it simple from there on.
Remember though, the assembly gets loaded in your AppDomain, so it won't get unloaded till your app (or your AppDomain) shuts down. So if some other process tries to write to that assembly, it will fail.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks, Senthil. I'll look into your links.
Would you be interested in writing an article with me, on something that uses this? If you're interested, I'll explain what it's about.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
Hello,
I want to get html flow when the page is called. I need to save the flow of page when user valid page to save it under txt file. Have you got an idea.
Thanks
|
|
|
|
|
|
In fact I want to save the contents of the page when the user valids it. To do this I try to use WebRequest command but I have an error when I called the page whith specifique control (security error). It's important for me to keep a trace of html contents. If you have another idea to do this tell me about it.
|
|
|
|
|
Hey howzit,
I am very new to the C# .NET environment and am learning every day, but I need to be able to launch the default mail recipient e.g. Outlook from my C# application. Could anyone help me out, please try keep the code simple.
Much appreciated!
|
|
|
|
|
The following snippet launch the systems default email client
<br />
System.Diagnostics.Process.Start("mailto:test@test.com");<br />
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Hey there,
Thanks for that code. Is there way of specifying which file(s) to include in the new email as attachments?
|
|
|
|
|
I don't know, but you can use third party component like DotNetOpenMail[^]
.Using "mailto:" you can specify subject ,body - but not file .
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Hi howzit?
Does anyone know how to add annotations to an EXISTING PDF programmatically? I have been fiddling with iTextSharp from SourceForge.net but it only allows you to create new blank PDF's and then add annotations.
Any help would be greatly appreciated!
|
|
|
|
|
|
i want to make an application that can find out what windows media is currently playing like the feature in MSN Messenger that displays what the user is currently listening to. is this possible and how would i go about it?
|
|
|
|
|
There is an article which explains something like this with the itunes library at http://msdn.com/coding4fun
|
|
|
|
|
Hello,
I have some experience in openGL. I plan to deploy in C#. But is there any way to use it in C#? Specifically I want to have a nopenGL view control on my C# form without loosing the features of C# form. I found CsGL.BaseCode but it says I should have CsGL.BaseCode.dll. But I do not have it. I have CsGL bins CsGL.dll and CsGL.native.dll but not that. Is any one can send me an example related to my problem?
I will be so glad to hear for your feedbacks.
|
|
|
|