|
Colin Angus Mackay wrote: But someone voted it a one - I'm curious as to why.
Yeah, I normally vote ppl 5 for a short sweet correct answer, hopefully someone will take note what a good answer is
|
|
|
|
|
hi guys !
need some help...
i m using Devmail.net component for downloading mails
but while using it i m having a problem
there occurs a Stack overflow Exception while downloading
msg.MessageSource (body of message) in some mails ,becuase of it my whole application crashes and i m unable to handle it in try catch block..
can any one help me in telling how to catch this exception
i m using c# and the programming language
can anyone hlp me as i tried a lot in Devmail.net help and forum but couldnt find the solution
its urgent...
thanks
abhinav
Systweak Inc.
jaipur India..
|
|
|
|
|
Unfortunatelly as of .net 2 you cannot catch this exception.
Here is the info from .net docs:
In prior versions of the .NET Framework, your application could catch a StackOverflowException object (for example, to recover from unbounded recursion). However, that practice is currently discouraged because significant additional code is required to reliably catch a stack overflow exception and continue program execution.
Starting with the .NET Framework version 2.0, a StackOverflowException object cannot be caught by a try-catch block and the corresponding process is terminated by default. Consequently, users are advised to write their code to detect and prevent a stack overflow. For example, if your application depends on recursion use a counter or a state condition to terminate the recursive loop.
|
|
|
|
|
hello!
i have a file,written in basic and i need to run it programmaticaly from a C# program, so that i could call methods, get answeres from them, etc.
i wrote a program using CodeDomProvider, which compiles program and it`s possible tj work with methods through Assembly
BUT!!!!
it works only on *.vb
and doent want to work with *.bas, even if i remane to yo *.vb
it doesnt compile, sends error messages. Suppose, there`s another file format or something...
i strongly need to compile it!!!!!
help please
|
|
|
|
|
What dialect of BASIC is it? There are a lot of them, and the code provider in the framework only handles Microsoft Visual Basic .NET.
---
b { font-weight: normal; }
|
|
|
|
|
You do not really think there is some kind of 'magic' built into the framework which enables it to compile every sort of programming language do you? As said there are hundreds if not thousands of basic dialects...
|
|
|
|
|
I suppose thats a kind of vb script - there`re no variable declarations no namespace, just sub after sub...
is there any chance to execute a sub from that file by C# program?
|
|
|
|
|
I dont think it would work, there could be some Modules that would do this or some COM objects and all, but that could mean data marshalling and other types of issues...
IMO if you can make a vb script as an exe that calls those subs for you and use C# to externall call them as a shell that might work out for you.
Depends on how "secure" you want this to be....
I'm sure that either way they are not going to be "secure" as you might think..
|
|
|
|
|
Hello,
can anyone tell me how i can make a program which is only running with a NotifyIcon as the only control ? (like etc. Daemon tools if anyone know that program)
Is it possible without creating a Form ?
Or should I Create a Form, then put a notifyIcon on it and let it be minimized from the start (and somehow never be able to be maximized) or maybe never draw itself ? (i guess there must be some "correct" way of doing this?)
Also i dont want program to be able to be selected when doing Alt+Tab etc.
Anyone know how to do this ?
Best regards
Martin
|
|
|
|
|
You could hide the form by setting Opacity to zero and I *think* if you set VisibleInTaskbar to false, it won't be shown when Alt+Tabbing.
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
You don't need a form to do this, you just need to start a message loop. In the following example, calling Application.Run() starts the loop meaning that the NotifyIcon won't vanish instantly.
public class TaskTray
{
[STAThread]
public static void Main()
{
new TaskTray();
if ( !Application.MessageLoop )
Application.Run();
}
private NotifyIcon nIcon = new NotifyIcon();
public TaskTray()
{
nIcon.Icon = new System.Drawing.Icon( typeof( TaskTray ), "myIcon.ico" );
nIcon.Visible = true;
nIcon.DoubleClick += new EventHandler( nIcon_DoubleClick );
}
public void nIcon_DoubleClick( object sender, EventArgs e )
{
nIcon.Visible = false;
Application.Exit();
}
} Hope this helps
Cheers,
Will H
|
|
|
|
|
Thanks,
that was just perfect and what i needed.
Thanks again
Best regards
Martin
|
|
|
|
|
I'm trying to serialize and save a remoting object and keep getting this error
runtime error: "Remoting cannot find field __identity on type
System.MarshalByRefObject."
I simply open a filestream
then serialize with binaryformater
and try to save to a file
any suggestion?
|
|
|
|
|
From your description, it looks like you're trying to serialize a remote object. Don't you think that idea is weird? The object itself lives (potentially) on another machine and you only have reference to it, so trying to serialize it locally sounds weird.
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
thanks for the posting
well, this whole app is weird
the object resides in another machine, but it returns this machine's infor to my server, how can i extract only that?
iddeally i would like to save the hash to a file and pick it from this file and reasign to the hash in a server reboot situation
here is a piece of my code
Public Class ServerProcess
Inherits MarshalByRefObject
Implements IAlertServer
''USES A HASH FOR NOW - DATABASE IN THE FUTURE
Private ActiveUsers As New Hashtable
'''CLASS DEFINED ON THE BOTTOM OF THIS FILE
Private MessageDelivery As New MessageDelivery
Private DeliveryThread As New Thread(AddressOf MessageDelivery.Deliver)
Private utils As New AlertUtils.AlertUtils
Public Property _ActiveUsers() As Hashtable
Get
Return ActiveUsers
End Get
Set(ByVal Value As Hashtable)
ActiveUsers = Value
End Set
End Property
Public Sub New()
MyBase.New()
DeliveryThread.IsBackground = True
End Sub
'''RETURNS HASHTABLE
Public Function GetUsers() As System.Collections.ICollection Implements AlertInterface.IAlertServer.GetUsers
Return ActiveUsers.Keys
End Function
''''USER LOGS IN, RUNS ALERTSEND, ALERTSEND CAPTURE LOGIN NAME AND SEND THROUGH
Public Sub AddUser(ByVal [alias] As String, ByVal client As IAlertClient) Implements AlertInterface.IAlertServer.AddUser
'''RegisteredUsers.ContainsKey
Dim SynchronizedCollection As Hashtable = Hashtable.Synchronized(ActiveUsers)
SynchronizedCollection([alias]) = client
'logwholehash(client)
Try
Dim fs As New FileStream("C:\temp\userss.bin", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)
Dim myformater As New BinaryFormatter
myformater.Serialize(fs, client)
fs.Close()
Catch ex As Exception
utils.LogException(ex)
End Try
MessageDelivery.UpdateUsers(ActiveUsers.Clone())
End Sub
|
|
|
|
|
blucas2005 wrote: the object resides in another machine, but it returns this machine's infor to my server, how can i extract only that?
Well, you could create a type on your side which holds just that information. You could then simply set values from the remote type to the local type and serialize the local type.
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
I should say it's pretty normal. If you're suspecting a memory leak, use Performance Monitor(perfmon.exe) and monitor the Bytes in Heap value (assuming you're not using any unmanaged resources). If it keeps increasing, you got a problem.
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
Hello,
How to create not scrollable row(s) in Excel file, like a header?
For example: I want that first 3 rows in my excel file would always stay on top.
Thanks.
|
|
|
|
|
Ehhh ummm... you know how to make it in excel and you want to generate a file like that programmatically ?
In that case, an easy solution would be to record a macro do the steps manually, and then port that macro recorded to Excel Automation.
A more cleaner way could be to use XMLSS but I dunno if this can be made using Excel XML (try to save the doc as XMLSS and see if it works, in that case you will get the XML entries to do that).
Good Luck
/// -----------------------
Braulio Díez
http://www.bdiez.com
/// -----------------------
|
|
|
|
|
Thanks for answer. Actually I dont know even how to create it in Excel, I have only seen that in one excel file. But your second way helped me very much to know a lot about some spreadsheet features. So, thanks again for a good advice.
|
|
|
|
|
Hi.
Select the last row you want to be fixed, then select Window...Freeze Panes from the menu bar
Regards, Graham.
|
|
|
|
|
Has anyone implemented a TreeListView using the Infragistics Controls? Specifically I am using the NetVantage 2005 Volume 3.
I am looking for something like
http://www.codeproject.com/cs/miscctrl/treelistview.asp[^]
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
The UltraTree has support for multi-column nodes. That will provide the functionality of the TreeListView and more.
Josh
|
|
|
|
|
In my project I have 2 use the methods from a Win32 API on WinForm.
I want to use P/Invoke to reference these methods.
In order to keep the API method calling code seperate from my WinForm can I define all the P/Invoke commands in other class and then refertence these methods through the intermediate class. Or is it must to have the p/invoke command in the same class where i am going to use them.....
The methods mechanism may look like the following:
My WinForm -- (MyClassObj)--> MyClass (contains methods that call API methods through p/invoke)
MyClass ------- (P/Invoke )----------> API
Any suggestions wherther it is possible or not. What should I do?
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
In my .NET port for a product that I sell I use a class with all of the P/Invokes in it. There are some examples of these classes online with MOST of the normal ones.
Steve Maier, MCSD MCAD
|
|
|
|