|
System.Diagnostics.process.Start("paint.exe")
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
|
hellow to all
i had created a DataGridTableStyle , and DataGridTextBoxColumn , now i wanna to access the datagrid and get information about the width of every coloum in the datagrid , i had worte this line of code
(grdWorkMaps.TableStyles("ts").GridColumnStyles.Item("cs28").Width.ToString)
but it is not working for me .
anyone have anyidea ?
thxx
|
|
|
|
|
Newbi to the whole appdomain-ting but my understanding was that it is a controllable area of a process where I can load code where I can enforce security and at any time unload it.
I want to use it to extend my applications functionallity and at any time given a specific term can unload from memory and eventually restart. This way I could have memory intense parts loaded when I need them instead of all the time.
However I don't get this to work but I'm probably doing some beginners error?1
My code goes something like this:
AppDomainClient<br />
- Plugin.vb (class implementing AppDomainInterfaces.IPlugin)<br />
<br />
AppDomainInterfaces<br />
- IPlugin.vb<br />
- IPluginFactory (Inherits MarshalByRefObject)<br />
<br />
AppDomainApplication<br />
- MainForm.vb
I start the MainForm by creating an AppDomain. The appdomain object is passed to an instace of the IPluginFactory and used to CreateInstanceAndUnwrap an instance of the Plugin class. The Plugin class is returned as the IPlugin interface to the MainForm. In the constructor of the Plugin class a method EatMemory is called which allocates a very big string. This workes fine and the memory allocated by the application goes through the roof!
When I try to unload the AppDomain I don't get any errors but the memory is still occupied with the same number of bytes as before I ran the unload command:
AppDomain.Unload("MyCustomAppDomain") I was expecting it to decrease mack to what I had before I loaded the Plugin?
-- modified at 7:37 Monday 3rd July, 2006
|
|
|
|
|
matsnas wrote: When I try to unload the AppDomain I don't get any errors but the memory is still occupied with the same number of bytes as before I ran the unload command:
Did you determine this using the TaskManager or using the Performance Monitor or a Memory Profiler? If you used TaskManager, you picked possibly the worst tool you could use for checking the memory use of your app. TaskManager will show you the memory use of the entire virtual machine your app is running in (the .NET Common Language Runtime). This includes memory that the CLR has reserved for your app, but not in actual use by your application...
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 13:42 Monday 3rd July, 2006
|
|
|
|
|
Well actually I did but only because I didn't get the Performance Monitor working in a good way. Anyway I also tried to have my plugin display a WinForm in it constructor believing that it would go away when my plugin's appdomain was unloaded but it didn't.
I'm missing some vital part of understanding here I think. All documentation refer to the current AppDomain beeing "unloaded" but what do they actually mean by unloaded? Valid for unloading when the GC feels like it? I would have guessed that the AppDomain stopped/killed and all allocated memory space freed.
|
|
|
|
|
|
Thanks, I'll have a go at the examples you posted.
Just one question though, I was expecting to be able to have other programmers write plugins for my application but using AppDomains I would be able to securly shut these plugins down and unload them without disturbing the plugin host?
Note! Written from memory so there might be compilation errors...
namespace AppDomainHost<br />
public class Host<br />
<br />
private mAppDomain as AppDomain<br />
private mIPlugin as AppDomainInterfaces.IPlugin<br />
<br />
public sub New()<br />
Dim vEvidence As Evidence = AppDomain.CurrentDomain.Evidence<br />
mAppDomain = AppDomain.CreateDomain("MyAppDomain", vEvidence)<br />
mIPlugin = AppDomainInterfaces.Factory.CreateIPlugin(mAppDomain, "AppDomainClient", "AppDomainClient.Client")<br />
mIPlugin.Connect<br />
AppDomain.Unload(mAppDomain)<br />
end sub <br />
<br />
end class <br />
end namespace <br />
<br />
namespace AppDomainClient<br />
<serializable()> _<br />
public class Client<br />
implements AppDomainInterfaces.IPlugin<br />
<br />
private mForm as Form<br />
public sub New()<br />
mForm = new Form()<br />
end sub <br />
<br />
public sub Connect() implements AppDomainInterfaces.IPlugin.Connect<br />
msgbox("Connected")<br />
end sub <br />
end class <br />
end namespace <br />
<br />
namespace AppDomainInterfaces<br />
public interface IPlugin<br />
sub Connect()<br />
end interface<br />
<br />
public class Factory<br />
function CreateIPlugin(byval pAppDomain as AppDomain, byval pAssembly as string, byval pType as string)<br />
dim vIPlugin = directcast(pAppDomain.CreateInstanceAndUnwrap(pAssembly, pType), IPlugin)<br />
return vIPlugin<br />
end function <br />
end class<br />
end namespace
|
|
|
|
|
I really couldn't tell you. I've done plugin's before, but not in AppDomains. I've never needed the ability to unload plugin's.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Ok, I'm not sure I understand what happens or what to do about it but as the first article talks about leaking datum into the original AppDomain it seems like loading the Plugin loads an extra assemby into AppDomain.CurrentDomain.
I thougt that I was only calling a sub on the interface object IPlugin. Why is the AppDomainClient.DLL loaded and how do I prevent this? More correctly, how do I assure that my plugin can be removed from memory at any time?
|
|
|
|
|
I am having problem when i make procedure and declare parameter as datetime and when i call it in crysat report it asks for the value and as in the database that is saved as date only it does not return anything.Can anyone tell me what to do?
Mohinder Singh
|
|
|
|
|
What is the PDU format for Long SMS? I am bit confused in this case.
Mohinder Singh
|
|
|
|
|
Google is your friend! Results[^] for "PDU format Long SMS"
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How to sort the table column by clicking on particular column?
Mohinder Singh
|
|
|
|
|
you could use a datagridview instead of a table. on a datagridview, colums are sorted by clicking on their header.
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
Hello all,
Pls, someone help me.
I would like to compare two objects. It's equal value or not.
For Example
Dim emp1 As New Employee()
Dim emp2 As New Employee()
emp1.Name ="John"
emp2.Name ="John"
'emp1.Equals(emp2) return false I what to get true in this 'condition.
I know that emp1 and emp2 is the difference reference address. But I would to get the return True Value when all of it's property value is the same and else false. How do I get it.
Thanks in advance
!alien!
|
|
|
|
|
Overwrite the Equals method.
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
If this is the way you really want to do it, then you'll either have to supply a Equals override in your Employee class or add a DefaultPropertyAttribute[^] to your class specifying the Name property as the default property if none is specified in the expression.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
in a treeview,, if i do rename on any node,, by beginedit,,, but,,, after user chage it's name,, how can i detact tht,, wether new name is vbnullstring or not,,, ????????
|
|
|
|
|
You can check for this in the AfterLabelEdit[^] event of the TreeView control.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thanks,,,
your idea worked,,,
regards
manisha vyas
|
|
|
|
|
Hi,
I am developing a VB.NET desktop application. I am using Threading in my application. In the main thread I am creating a thread like this to start Scanning.
Try
Dim thrd1 As Thread
thrd1 = New Thread(AddressOf StartScanning)
thrd1.Priority = ThreadPriority.Normal
thrd1.Start()
Catch ex As System.Runtime.InteropServices.SEHException
MessageBox.Show(ex.Message & vbCrLf & "ErrorCode: " & ex.ErrorCode, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Stop)
Exit Sub
End Try
I am having a button on GUI to stop the scanning process. My problem is I am unable to click the STOP button (i.e. the button is not being clicked, enenthough i click on it). Not only this button, I am unable to click on any of the controls of my form.
Is there any problem with threading or something else?
Thanx,
Sujanakar
|
|
|
|
|
There's nothing wrong with the code you've posted. Perhaps the problem is in the StartScanning method?? Does the component you're using support being manipulated from the non GUI thread?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello everyone,
I have a little question. I have a datagridview with an unbound column, and some other columns inserted from a datatable as the datasource for the grid.
My problem is, the unbound column is always shown as the first column on the left. I need that column to be the last on the right. any idea on how to do this?
thanks in advance for your help!
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
You can set the order of DataGridView Columns using the DisplayIndex property.
DataGridViewName.Columns("ColumnName").DisplayIndex = X
|
|
|
|