file not being released in a timely manner
I've written a vb.net webform based application. It uses CDO and it
runs through a list of database records and for each record, it
creates a new email object, attaches a single file, and then sends the
message. I use message.AddAttachment(AttachedFile) to attach the file.
After I've sent the message I copy the the file that was attached to
the message to a backup directory. I then delete the file. The copy is
instantaneous. However, it can take quite some time before the file is
actually deleted. It varies between a couple of seconds and more then
a few minutes. If I close the application, the file disappears within
a few seconds.
I believe that the email object is holding onto the file until Garbage
Collection completely reclaims the email object. I've added GC.Collect
right after the email is sent and after I've set the email to nothing.
It speeds up the deletion but not in a predictable manner.
What's the best approach to speeding up the reclamation of the email
object so that it releases the hold on the file? Do I have to take
into account that the email object is created using CDO? Is the CDO
library considered unmanaged and if it is does that complicate the
disposal of the email object?
Thank You,
Eric Tag: Clipboard Tag: 69599
ANN: Galois.Net
Hi,
I have posted recently a similar message, I believe it is particularly
interesting for people with a mathematical background. Also, the
whole application was developed with .Net Framework SDK only.
The beta version of Galois.Net is now available for download.
Galois.Net is made of two parts: the Galois Knowledge Environment
and a collection of Xml tags. The Environment is used to create and
share theories presented using the Xml tags.
You can download it at:
http://www.a2ii.com/galois/index.htm
More information about Galois.Net can be found below.
Daniel Perron, Ph.D.
Lead Developer Galois.Net
=========================================================
XML specifications for .Net components
The Visual C# compiler has an option switch that extracts the comments
within the source code of the program being written if the comments follow
a certain XML syntax. This simplifies the generation of reference documentation
for the application. Java compilers also have such a facility and we can probably
trace the original idea behind such a feature to the proposal for Literate Programming
made by Donald Knuth in the 80's. In this note, we would like to extend these
ideas using custom attributes provided by the .Net Framework.
We'll start by defining a custom attribute named Galois as follows:
using System;
namespace Galois
{
[AttributeUsage( AttributeTargets.All, AllowMultiple = true )]
public class GaloisAttribute : Attribute
{
string theory;
public string Theory
{
get
{
return theory;
}
set
{
theory = value;
}
}
public GaloisAttribute( string thm )
{
theory = thm;
}
}
}
We have created a namespace for this attribute and the attribute itself has
only one read-write property Theory of type System.String. You can compile
this code and reference it in your application. The Theory property of every
Galois attributes will be an XML string with tags chosen to allow specifications
in a certain logic, namely geometric logic. Geometry logic has nice mathematical
properties (the class of models of a given theory constitutes what mathematicians
call a topos). For example, we would like to attach a Galois attribute to an
interface that will be used in every Windows.Forms program that use a menu as follow:
using Galois;
public interface GTMenu {
[Galois(@"
<co a1='p' t1='Program'
a2='m' t2='Menu'
a3='s0' t3='Statement'
a4='s1' t4='Statement'
a5='s2' t5='Statement'
>
<if><pr n='Uses' a1='p' a2='m'/>
</if>
<tn><te a1='a' t1='Array'><pr n='ElementType' a1='a' a2='Statement'/></te>
<pr n='GetValue' a1='a' a2='0' a3='s0'/>
<pr n='Equals' a1='s0' a2='MainMenu.ctor'/>
<pr n='GetValue' a1='a' a2='1' a3='s1'/>
<pr n='Equals' a1='s1' a2='MenuItem.ctor'/>
<pr n='GetValue' a1='a' a2='2' a3='s2'/>
<pr n='Equals' a1='s2' a2='AddEventHandlerForClick'/>
</tn>
</co>
")]
void SetupMenu();
}
Let's look at the interface itself first. The interface is named GTMenu (for the
Galois Theory of Menu) and it contains only one method SetupMenu() (note also, the
"using" statement at the beginning to be allowed to use Galois custom attributes).
The Galois attribute itself is attached to the method SetupMenu of the interface. The
string that is passed to the attribute starts with the @ sign so we can break the
specifications on multiple lines and we use ' (a single quote) inside the string to
delimitate the XML attributes of the Galois.Net elements that we are now going
to describe.
The top-level element of the XML string is <co a1 ...>. The "co" element of a Galois
attribute defines a context which is a list of variables names and theirs types
(as in a1='p' t1='Program' for the variable p of type Program). Inside this context
element, we have an "if" element for the "if" part of a rule and "tn" element for
the "then" part of a rule. Galois.Net specifications are made up of contexts that
define the variables used in the rules. Inside the "if" element or the "tn" element
we can have relations (or predicates). In the specification above, we have inside
the "if" element, the relation Uses which is written as the element
"<pr n='Uses' a1='p' a2='m'/>" which says that "if the program uses a menu then ...".
Then what? The specification says that there exists an array of statements whose
first member is a MainMenu constructor, second member is a MenuItem constructor
and the third member is the statement 'AddEventHandlerForClick'. The "te" element
states that "there exists" a variable of type Array. The specification also uses
the predicates "GetValue" which is true if the value of the object at position,
say 0, is s0. Galois.Net specifications treat a function as a relation that defines
its graph. And if the function is a method then its first argument will be the name
of the given object (just like when the pointer "this" is passed to a function in
a given implementation of a compiler for an object-oriented programming language).
This specification can be displayed (in the Galois Knowledge Environment) as follow:
Context:
For All p: Program, m: Menu, s0: Statement, s1: Statement, s2: Statement,
IF (rule #1)
Uses( p, m )
THEN
THERE EXISTS a: Array ElementType( a, Statement )
GetValue( a, 0, s0 )
Equals( s0, MainMenu.ctor )
GetValue( a, 1, s1 )
Equals( s1, MenuItem.ctor )
GetValue( a, 2, s2 )
Equals( s2, AddEventHandlerForClick )
We can conclude that this context defines a language with:
4 sorts (Program, Menu, Statement, Array)
3 predicates (Uses,ElementType, GetValue) where
Uses < Program x Menu (we use < for the subset relation)
ElementType < Array x string
GetValue < Array x int x Statement
the constants 0, 1, 2, MainMenu.ctor, MenuItem.ctor, AddEvenHandlerForClick,
and a geometric theory with a single axiom.
Any interpretation (or model) of this geometric theory will involve assigning "universes"
for the different sorts. Usually these universes are just plain sets, but generally, they
can be taken to be objects in any given topos. Then the predicates will be subsets of
the appropriate product of sorts and the constants are elements of the sets that
represent the given sorts.
The values for the statements in the above specification i.e. MainMenu.ctor, ... were
chosen to reflect the knowledge that would be needed to implement a menu in a
Windows.Forms
application.
A program that implements the GTMenu interface with its Galois attribute could be
written as (when compiling, remember to add a reference to GTMenu.dll compiled earlier):
using System;
using System.Drawing;
using System.Windows.Forms;
class CreativeGL : Form, GTMenu {
public void SetupMenu() {
Menu = new MainMenu();
MenuItem menu = new MenuItem( "A menu" );
Menu.MenuItems.Add( menu );
MenuItem miOne = new MenuItem( "One Item" );
menu.MenuItems.Add( miOne );
miOne.Click += new EventHandler( miOneHandler );
}
public CreativeGL() {
SetupMenu();
}
public void miOneHandler( object o, EventArgs ea ) {
MessageBox.Show( "You clicked the menu item" );
}
public static void Main() {
Application.Run( new CreativeGL() );
}
}
This is just a test program but it shows an important idea: A program can be seen
as a model for the theory specified in the Galois attribute (of the interface that
is implemented by the program). A more detailed specification makes it easier to
associate values to symbols in the specification i.e. to define a model. Because
the tags of the Galois attributes were chosen to express specifications in geometric
logic these remarks can be made formal. As a simple consequence of this formal theory, a
"bug" has a nice interpretation in this setting: since a rule in a Galois specification
essentially represents the claim that an abstract geometric object is contained in
another one, a bug is a point of the smaller object which is not covered by the "bigger"
one.
Creating components with Galois attributes wouldn't be very interesting if we were
not going to exploit this extra information contained in the specification. Luckily,
the .Net Framework makes it very easy to extract custom attributes from components.
The Galois attribute used above was written to express the minimum information needed
to create a Windows.Forms with a menu (we could make it more precise to include the
information that we need to add the menu item to its container). Similarly, the same
approach could be used to express the minimum information needed to created a client
network application, a server network applicaton etc... And more generally, we can
use Galois specifications to make explicit the information that programmers assumed
when they are writing their code. This way, we could extract all the theories
contained in all the code written by a given programmer and treat this as a representation
of his/her expertise.
Going one step further, we can imagine a programmer displaying this representation
in the form of a Web service that is used to "contract out" this expertise. We believe
that custom attributes, as used with Galois.Net to specify components, fill an important
gap in providing a nice semantic for component-based software development. Tag: Clipboard Tag: 69597
Assemblies for custom component not loading
Hi all,
I've got a solution containing several projects for some components I'm
trying to develop:
A, B, C
A inherits from System.ComponentModel.Component. Its purpose is to house
some base functionality for my suite. B inherits directly from A and does
it own thing. Likewise C is a more specialized component of type B, so it's
inheriting straight from B. Compilation goes fine and all three resultant
dll's are in C's bin\debug folder.
So we have A.dll, B.dll and C.dll all in the same folder. I then added a
registry key for the AssemblyFolders key with this output as the default
value for the key. Reopen vs.net and my components (all called Class1), are
showing up in the ".Net Components" box when you click the Add/Remove
context menu. I put C on the toolbox.. drag and drop it on the form and
nothing is placed on the component tray. I used fuslogvw to log assembly
binding and got entries for A and B:
*** Assembly Binder Log Entry (2/19/2004 @ 4:03:27 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll
Running under executable C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\IDE\devenv.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = A, Version=1.0.1510.28187, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\IDE\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Private path hint found in configuration file:
PublicAssemblies;PrivateAssemblies.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: A, Version=1.0.1510.28187, Culture=neutral,
PublicKeyToken=null
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/A.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/A/A.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/PublicAssemblies/A.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/PublicAssemblies/A/A.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/PrivateAssemblies/A.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/PrivateAssemblies/A/A.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/A.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/A/A.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/PublicAssemblies/A.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/PublicAssemblies/A/A.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/PrivateAssemblies/A.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio .NET 2003/Common7/IDE/PrivateAssemblies/A/A.EXE.
LOG: All probing URLs attempted and failed.
B's failure log is the same as A's except for the name it looks for.
Can anyone shed some light on my problem or tell me something else to try?
Fred Palmer
fred@codesoldier.com Tag: Clipboard Tag: 69596
WSDL generates array rather than data type
In generating a proxy using WSDL, a collection type I have defined is
transformed into a simple array. This later causes data to not be
passed correctly in the web service client. Here's a partial example:
<xs:complexType name="MyResponse">
<xs:sequence>
<xs:element name="MyList" type="MyList" minOccurs="0"/>
<xs:element name="OtherData" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="MyList">
<xs:sequence>
<xs:element name="MyListDetail" type="MyListDetail" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="MyListDetail">
<xs:sequence>
<xs:element name="DetailId" type="xs:string" minOccurs="0"/>
<xs:element name="DetailDescription" type="xs:string"
minOccurs="0"/>
</xs:sequence>
</xs:complexType>
The pertinent generated C# code looks like:
[System.Xml.Serialization.XmlTypeAttribute(Namespace="xxxxx")]
public class MyResponse {
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public MyListDetail[] MyList;
Note that the generated .cs code types MyList as simply an array of
MyListDetail objects rather than typing it as a MyList object. This
seems to cause a problem where the data put into the MyListDetail
objects do not appear on the client side after calling the web
service. If a "dummy" element is added to the MyList definition, the
actual MyList data type is generated, and the data passed in the
MyListDetail objects are passed back to the client as expected:
<xs:complexType name="MyList">
<xs:sequence>
<xs:element name="dummy" type="xs:string" minOccurs="0"/>
<xs:element name="MyListDetail" type="MyListDetail" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
[System.Xml.Serialization.XmlTypeAttribute(Namespace="xxxxx")]
public class MyResponse {
...
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public MyList MyList;
...
Is this some kind of optimization "feature" of WSDL, or are we doing
something incorrectly?
Thanks! Tag: Clipboard Tag: 69595
Reference objects and simultaneous calls
Hi:
I'm not too clear on how method calls are handled by referenced
objects.
If an object is referenced in two different places and a call to the
same method is called by both relatively quickly, are different
threads spawn for each caller's method call, or is it a single thread?
thanks for info in advance
Steve Tag: Clipboard Tag: 69592
Publish WMI instances from W32 service consumes memory without stop
Hello to all,
I'm developing a Win32 .Net service that publishes information into WMI by
using Publish method, however once an instance is published, memory usage
starts to grow without stop at a rate of 1Kb/sec. This problem only appears
when publishing information through a service. Also I noticed that problem
only appears on some machines (most of them) since a couple of my machines
does not present the problem.
Is there a way to solve this problem? I'll try to create a native provider
and call it from the service but I prefer to use .Net and not to mix managed
and not managed code.
Best Regards,
Oscar Tag: Clipboard Tag: 69589
Asynchronous event firing
Hi:
I was curious whether events fired as a multi-cast delegate were fired
asynchronously or not. If the invoked delegate is OneWay, do I need
to call GetInvocationList() (I think that's the name) and fire each
one asynchronously to take advantage of the OneWay delegate, or will
firing the event with one call do that for me?
Thanks in advance for any help in this question.
Steve Tag: Clipboard Tag: 69581
Help: Placing Internet Shortcut for Windows Forms application (hosted on web server) on Desktop
Hi there,
I have a Windows forms app that resides on a web server. I (and my
intended user base) access the application via an Internet shortcut,
i.e. "http://servername/appshare/app.exe". That's all fine and dandy,
as well as the setup and deployment project I had to write to
install/uninstall a Site code group to give FullTrust to any
applications from "servername", but that's another story (code's
available if anyone's interested).
So, one last thing I wish to do: During the install, create an
Internet Shortcut on the desktop which points at
"http://servername/appshare/app.exe". As far as I can see, there's no
way to create an *internet* shortcut during the install process or via
code - does anyone have any suggestions?
Kind regards,
Mike Kingscott Tag: Clipboard Tag: 69576
Managed extension is turned off automatically !!
Hello Programmers,
I have C++ unmanaged projects with managed extension turned on. They
are compiling fine in developer computer.
In the build computer, a single solution contains C#, .Net C++, C++
unmanaged and C++ unmanaged with managed extension turned on. But we
are getting build errors for the "C++ unmanaged projects with managed
extensions On". These errors are the same as what would be when the
managed extension is turned off by accident in these projects.
I have get local copy to TRUE, in the add references in all these
projects. The managed project these unmanaged projects are trying to
access is written in C++.Net.
Any idea on how this could be?? .. Is this a bug .. any workaround ??
Help will be really appreciated.
~Saurabh Tag: Clipboard Tag: 69574
DTD to xml
I'd like to use 'xsd.exe' to generate a set of classes so that I can serialize XML for a
given DTD
However, I don't believe 'xsd.exe' reads DTD's. So is there an easy way to conver
a DTD to an XML schema, or go directly from a DTD to a .NET code base that ca
be serialized
Thanks Tag: Clipboard Tag: 69568
new namespaces in whidbey
Hi there,
I'm looking for a short list (with description!) of the new namespaces in
the .NET framework 2.0.
Thanks,
Urs Tag: Clipboard Tag: 69566
Parameter Description in Code Completion
I have a couple of helper class libraries that I use in several projects.
Does anyone know how to create the parameter description that appears below
the parameter autocomplete popup when a method in the helper class is being
used in Visual Studio?
Is there a meta tag for this?
At the moment the parameter list appears the yellow popup window but no
parameter description is displayed below.
Any tips greatly apprecated.
Tony Tag: Clipboard Tag: 69563
Dynamic menus - Collapsing and Expanding
Hello All,
I need to create a menu list on a page that will expand when clicked and stay expanded until clicked again. Actually, I want it to look just like the menus on the Microsoft Newsgroup homepage - with a plus sign to expand and a minus sign to collapse the menu. Also, I want to be able to add new sub-menu items in a single place (some kind of admin interface) and have them instantly be available when the parent menu is expanded. Does anyone have any ideas on how to make this a reality? Help greatly appreciated.
Thank you,
Benno Tag: Clipboard Tag: 69560
Passing parameters to new AppDomain
Hello,
Is there a way to pass some data to domain created by AppDomain.CreateDomain
so they will be available for custom configuration section handlers?
As I can understand the custom handlers are invoked on first access to
configuration section (i.e. not inside CreateDomain) so I can call
newDomain.SetData() to pass parameters and then creates objects. Can I rely
on such behavior of handlers in nearest future version of .NET framework?
--
Best regards, Vladimir Tag: Clipboard Tag: 69555
IPAddress.Address is negative
Hello,
I perform a ping using the IcmpSendEcho Function from iphlpapi:
<DllImport("iphlpapi")> _
Private Shared Function IcmpSendEcho(ByVal IcmpHandle As IntPtr, ByVal
DestinationAddress As System.UInt32, ByVal RequestData() As Byte, ByVal
RequestSize As Integer, ByVal RequestOptions As IntPtr, ByVal ReplyBuffer()
As Byte, ByVal ReplySize As Int32, ByVal Timeout As Int32) As System.UInt32
This Function requires a Destination Adress as an unsigned Int32. I get it
from the IPAddress.Address Object.
Public Structure PingOptions
Dim IPAdress As IPAddress
Dim TimeOUT As Integer
End Structure
dim opt as PingOptions
opt.IPAdress = IPAddress.Parse("192.168.1.128") ' Adresses bigger then
A.B.C.127, have a negative adress value !!!
ipaddr = System.UInt32.Parse(opt.IPAdress.Address) ' and couse exception
here
Dim ret As System.UInt32
'but i need an unsigned int here in the second parameter
ret = IcmpSendEcho(h, opt.ipaddr, RequestData, CInt(RequestData.Length),
IntPtr.Zero, reply._Data, reply._Data.Length, opt.TimeOUT)
The Problem is that for IPAdresses, where the last Byte is bigger then 127.
the generated Long Value for Adress is negative and the Parse Method to the
uint32 couses an exception.
Or should i declare the DestinationAdress as Long in the IcmpSendEcho and
put in IPAdress.Address value directly.
My assumption is that the Address value is created in the correct bitformat
but becouse the CF is declaring it as a long it is interpreted negative.
Or how else to get the correct Long Value from IPAdress.Address ?
THX in advance
--
-> Milosz Weckowski
www.playseven.com
mailto:mw@playseven.com
ICQ Number: 84867613
Get the enhanced Progressbar and a fine Colorpicker for the Compact Framwork
for free:
http://www.playseven.com/11620/p7_Controls.html Tag: Clipboard Tag: 69553
IMAP
Hi
We are currently using an IMAP server setup on Unix
Does anyone know if there is a Windows vesion pf IMAP? Links
Is the version of IMAP for Widnows a different API. I just want to be sure that my code will still work and that the API is not different
Thanks
C. Tag: Clipboard Tag: 69552
CreateWindowStation
Does anyone have the vb code to use this function I have found the API
import for this but not the layout of the structures that need to be passed
to the routine. I'm also looking for vb versions of
- CreateWindowStation
- SetProcessWindowStation
- CreateDesktop
- SetThreadDesktop
- GetGUIThreadInfo
Any help would be great. VB.NET please.
Thanks
P :-) Tag: Clipboard Tag: 69549
Activating an instance of a class in a referenced assembly
I'm trying to use Type.GetType() so I can create an instance of a class I
have defined in a different, yet referenced, assembly but it doesn't seem to
be able to find the type. How can I get a type object of a class in
another assembly?
For example, if you reference the System.Xml namespace, try this
Type importType = Type.GetType("System.Xml.XmlException", true);
It will throw an exception. I see that there is also the
GetTypeFromProgID() and GetTypeFromCLSID() methods in the Type class but
these seem to only apply to registered COM objects. Tag: Clipboard Tag: 69548
RESPONSE ISSUE
WE HAVE FACED A RESPONSE PROBLEM WITH .NET APPLICATION WITH WINDOWS 2000 SP 2 AND SP4. WITH SP2 SYSTEM LOADS FASTER AND WORK FASTER. WITH SP4 RESPONSE IS SLOW. IS THERE ANY PATCH AVAILABLE OR ANY OTHER SOLUTION FOR THE SAME Tag: Clipboard Tag: 69543
Smart Client
Hi
I want create and test a sample Smart client application. I created form with one button control and posted the executable to a Virtual directory. When I tried to access the exec from Internet explorer, I didn't see the form opening up. The browser is blank. Is there any settings I have to make to run the executable from Web server. My OS is XP-Professional and I am using VS.net 2003 version .
Regards,
Butchi Tag: Clipboard Tag: 69541
HKEY_LOCAL_MACHINE - Setting Read Only Permissions
I have a .NET winforms application that requires read access to a
custom key stored in HLM. Installation of application will create a
key in HLM programmatically. This is no problem since only admins will
be performing install. However, the application will be run by
non-admins. The key created will require read only access for these
non-admin users. Is there a way to programmatically set permissions to
the key? I'd like to prevent having to go into regedt32 to set the
permissions for every desktop running the application. I've tried
several of the coding examples in the RegistryPermissions class with
no luck. I'm certain it is because I am not correctly using the class
or I am using the incorrect class. Any tips would be greatly
appreciated. Tag: Clipboard Tag: 69538
Process.Start & MailTo
In my Windows Form application I'm using the attached code, to launch the default email client. When the value of the FileName property exceeds 2001 characters, a Win32Exception is thrown with the message "The System cannot find the file specified". We're likely to have cases where the message will exceed 2001 characters. We've also tried SMTP (SmtpMail.Send(mmMailMsg)) and it works fine with the same message. Any suggestions
Public Sub SendEMail(
Tr
Dim strMsg As String = "A very long msg.
Dim psi As New System.Diagnostics.ProcessStartInf
psi.FileName = "mailto:myEmail@myAddress.com?subject=Hello&Body=" & strMs
psi.UseShellExecute = Tru
System.Diagnostics.Process.Start(psi
Catch excGeneric As Exceptio
MessageBox.Show("Exception in Sub SendEMail: " & excGeneric.ToString
End Tr
End Su
Thanks
Norm Dott
normd@knorrassociates.com Tag: Clipboard Tag: 69534
COM Class Vs. Sn.exe, Gacutil.exe and Regasm.exe
There seems to be two ways of creating a COM in .NET
1) Select the COM Class template
2) Create a class and then use Sn.exe, Gacutil.exe, and Regasm.exe to assign the assembly to GAC and COM to registry
I know that COM Class option is a lot easier to use. However, is there any drawbacks from using this instead of option two? Is it suggested that you rather use option 2) even it's a lot more tedious
Thanks for info. Tag: Clipboard Tag: 69532
Problem with Trust for User
I built an assembly and generated a test strong name key pair with
sn.exe. The assembly runs fine and is installed in the GAC and also
as a COM+ Server Application.
I ran the 1.1 Framework Config Tool to trust the assembly. I selected
"Make Changes for this User Only", navigated to the .DLL, said to
trust this assembly only, and got this error:
"Due to your existing security policy, the wizard is unabel to
increase the level of trust for this assembly. No changes were made
to your policy."
How can I make my user account trust my assembly?
Thanks. Tag: Clipboard Tag: 69531
Should I drop Library activated Serviced Component from COM+ when the interface changes?
I would like to understand better what happens when a public interface of a serviced component changes
Suppose that I have a library activated serviced component. Suppose that I lock its version number ([assembly: AssemblyVersion("1.0.0")]) and installed the component into COM+ catalog (via regsvcs or just by running a client that uses it)
Now, suppose that I change the existing method or add a new method in the component
It appears that everything continues to run fine afer the change
I am not sure, though, if this is the way to do it. I always drop the component from COM+ catalog when the interface changes
Question is, do I need to? Is it really necessary
What exactly is going on with component when the interface changes
Thanks
-Sta Tag: Clipboard Tag: 69528
TOP SECRET MY MOM NEVER TOLD ME!!
Discovers the "Secret of making huge money" in just few weeks....
You shall be amazed that how easy 1 can make money on internet just for doing 1 time work..[I GUREENTED U CAN TOO MAKE BIG$$ WITH THIS PROGRAM]........
[Use IE if can't view the site]
http://mysiteinc.com/gohar/index.html Tag: Clipboard Tag: 69527
What is "Unable to write data to transport connection"?
All,
What does it mean "Unable to write data to transport connection"? I got
this error when I called HttpWebRequest.GetResponse().
Thanks,
Rudy Tag: Clipboard Tag: 69526
Curious: Why use XPathNavigator Class over XMLDocument Class?
Any opinions on the best way to load, select nodes (anywhere in the
tree), manipulate those nodes, and save the changes? Any reason I
should change from just straight up manipulating the XMLDocument and
use the XPathNavigator class? Is the performance is better then using
the XMLDocument class to perform XPath queries? What is the most
efficient method of manipulating and saving data changes?
Cheers,
-- Curious. Tag: Clipboard Tag: 69524
Deleting Mulitple Rows
Hi,
I want to delete multiple records/rows from a dataset for eg:
DataSet.tables(0).rows("Some Counter").delete() will delete one row.
what if I have to delete more than one row...
Thanks,
Stephen Tag: Clipboard Tag: 69522
"Assert failed" under Windows 98
Hi,
I've developped a Window Form application with .NET that runs perfectly well
under Windows 2000, XP and 2003. However, when i run it under Windows 98SE,
i get the following error *after* the application has been closed (MyApp is
the name of my executable):
"Assert failed - copied to MyApp.err"
File Refcount.cpp, line 652
Build: v7.10 (07/08/02 11:27:29)
Expression: ! (i == idata->tdmap.end())
The strange thing is that it doesn't happens when my code is executing but
sometime after the execution is finished, probably somewhere in the
framework itself when it's cleaning up after a program has been closed.
If somebody has a clue of what's happening here, please help! i have no idea
where to look as the error comes from outside my code:-( And this just
prevents me from distributing my application to Windows 98 users which was
one of my targeted platform.
Thanks Tag: Clipboard Tag: 69517
copy file to SQL sever db HELP
how do you copy a file from a folder into a part of SQL server database
any sample code for VB .NE
ti
PT Tag: Clipboard Tag: 69516
Have a different pagesize for the first page in a datagrid
Hi All,
I have a datagrid in which there are say 300 records to be
displayed. I want to display only 10 records in the first page
and from the second page on I want to display a fixed number say
40 records per page.
Can anyone tell what is the best method to do this.
Thanks
Raj Tag: Clipboard Tag: 69515
Cannot access properties on Custom classes
After upgrading to the 1.1 framework, we can no longer access properties or methods on custom classes. The same classes in the 1.0 framework could be viewed just fine using the Quick Watch or Immediate window. The only thing that can be seen on the classes are the Public Constants (strings)
In the immediate window, when trying to view the value of properties the following exceptions occu
?object.PropertyGUID.ToStrin
Run-time exception thrown : System.ArgumentException - Cannot find the method on the object instance
?object.PropertyStrin
<error: an exception of type: {System.ArgumentException} occurred
Using QuickWatch, the Value column of the view shows the properties as <error: an exception of type: {System.ArgumentException} occurred>.
There are no problems using the properties within code, only when attempting to view them for debugging purposes
Many thanks in advance! Tag: Clipboard Tag: 69512
=?Utf-8?Q?Can=E2=80=99t_copy_to_clipboard?=
I get the following exception when I try to put a string in the clipboard
Unhandled Exception: System.Runtime.InteropServices.ExternalException: The requested clipboard operation failed
at System.Windows.Forms.Clipboard.SetDataObject(Object data, Boolean copy
Could anyone tell me whatâ??s wrong with this program? Thank
using System.Windows.Forms
public class Tes
public static void Main(
Clipboard.SetDataObject("test", true) Tag: Clipboard Tag: 69510
CCW overheads
To whom it may concern:
We are in the process of deciding on a technology to go with - .NET or VB6. The project entails interfacing with Classic COM objects written in C++ on another system. I've suggested that we write our custom code using the .NET framework and expose it to the classic COM objects using COM Callable Wrapper. Others suggest that we should go with VB6 (Classic COM to COM communications)so as to circumvent any form of overhead that could be incurred during the CCWs "wrapping" process.
Any form of feedback is much appreciated.
Best,
Jack Sparrow Tag: Clipboard Tag: 69508
XmlSerializer / Temp directory / System shutdown
My application has a settings class that is serialized to save and
deserialized to load. I'm having a problem where i catch the
WM_QUERYENDSESSION event via WinProc to save my application's settings when
a user logs out, reboots or shuts down the system.
The behavior of XmlSerializer is that it creates temporary dll's to do the
(de)serialization in the system's temp directory.
The behavior of windows on a system shutdown is to purge these temporary
files from the system's temp directory.
The problem i'm having is that i am unable to serialize my settings class
when the system is shutting down, because windows is purging these temporary
files.
Is there a way to control the directory where the XmlSerializer creates the
temporary files (other than changing the TEMP environmental variable, which
isn't an option for me), or is there another means of serialization i can
use which bypasses the temporary file creation step?
My settings class has hundreds (potentially thousands) of things getting
saved to a file. Manually serializing/deserializing would be a real pain
that i am hoping i can avoid. This seems to be a big flaw in the .net
xmlserialization implementation. :( Tag: Clipboard Tag: 69507
AssemblyVersion - what if I want to enter DLL Hell?
The title is a joke, clearly I don't want DLL Hell. However, I am
curious if there is a way to follow the shared DLL model of the past
using the GAC.
Specificially -
I have ten seperate console applications, lets call them
'ConsoleApp1.exe' through 'ConsoleApp10.exe' which each depend on a
single class library named 'Utility.dll' which is strongly named and
installed in the GAC, v1.0.0.1
I regularly develop performance improvments to 'Utility.dll' which I
want all the console apps to benefit from. Over time, i develop
v1.0.0.2 , v1.0.0.3 all the way to v1.0.0.9 - each time I wish to
deploy the updated library and have all of the console apps use it.
Is there any way for me to install the new class library in the GAC
and have it used by all console apps WITHOUT using a Publisher Policy
File (i.e., is there any way to mark the new library as "compatible"
and therefor the console apps will use the newer version).
Thanks,
Maurice Flanagan Tag: Clipboard Tag: 69505
Components added to a Components Surface not in Components Collection?
I've created a Component called MyComponent. To the design surface of
MyComponent I've dragged an SqlConnection object, an SqlCommand object, and
an SqlDataAdapter object and linked these items together appropriately.
My question is this: Why are these Sql components not added to the list of
components contained by MyComponent? (These objects are not added to the
private "components" member of MyComponent.) Is there a technical reason
for this or is it just a bug in the designer? Is there any way I can get
the Designer to add these items to the collection automatically, without
having to hand-code it myself?
Thanks,
-Dave Tag: Clipboard Tag: 69503
Libraries in the GAC
Hi gurus,
I have a solution with two projects. One of them is a Windows application an
the other is an instaler of it. The windows application uses a class libray
who is registered in the Global Assembly Cache. The problem raises when i
try unistall the class library from the Assembly Cache, the error says that
the library has a reference with an instaler program. I've removed it from
the solution and the problem persist... Is there any other thing that I'am
not doing..?
I would really appreciate your helping me....!
Thanx
Boris Tag: Clipboard Tag: 69501
creating instances
My requirement is to dynamically specify a class at runtime. I wrote the following code. it's nor functioning
can anyonme help em out
namespace ConsoleApplication
/// <summary
/// Summary description for Class1
/// </summary
///
class
public int a=90
string s="l;k;"
class Class
static void Main(string[] args
ObjectHandle obj = Activator.CreateInstanceFrom("ConsoleApplication1","A"); .// error: Filenotfound ecxeption assembly name is not the apt on
Console.WriteLine("jdksjf")
Console.WriteLine()
A a =(A)obj.Unwrap()
Console.Write(a.a)
} Tag: Clipboard Tag: 69499
Add controls at client side.
Hi
In my web app, I want to allow the users to create command buttons or text
boxes as and when they like.
This means that if any user has logged in, and wants an extra button
somewhere on the form. Now these
buttons are provided on the page, as we get in .NET IDE or studio toolbox.
The user just drags the control and
places it on the frame. Now I want him to see this updated page whenever he
logs in next time also.
How do I manage this?
Thanks in Advance. Tag: Clipboard Tag: 69493
My app..
Hi all
I want tomake an application that behaves both as a web application,and a
desktop app.
This means that whenever the net is running, this should behave as a web
app. But whenever the
net is down, it workd offline, as any other desktop app.
Is there any way to achieve this?
Regards. Tag: Clipboard Tag: 69492
Postback issue!
Hi
I have a form on client end where I have certain controls. Now whenever the
app is run, the postback is done from the server. But for few controls I do
not want them to go to the server for postback. I want the controls to
remain only on the client end.
Any suggestions are highly appreciated. I'm using ASP.
Thnx. Tag: Clipboard Tag: 69491
serial communication in C#
Hi all,
I need to communicate with a GSM modem in my application which is connected
to a serial port of my PC in a Windows Form application (written in C#).
Please can you give any idea how to do it. I don't want to use MSCOMM
control.
Thanks,
Arsalan Ahmad Tag: Clipboard Tag: 69489
BUG in .NET Configuration 1.1 -- property and wizard pages are empty
Hi all,
in my installation of the .NET Framework (v1.1.4322),
the contents of the property and wizard pages do not show up.
The pages themselfs come up, for example the
"Trust an Assembly" wizard can be opened.
But its contents are invisible:
The area between the white information header
and the "Back Next Cancel" buttons is empty.
The same applies to all property pages and wizards
in the whole .NET Configuration.
Removing the .NET security configuration in the
path ...\Microsoft.NET\Framework\v1.1.4322\config
did not help.
Reinstalling the .NET framework did not help either.
Setting the PATH like in .NET/Tools/Prompt was in vain.
The operating system version is "Windows Server 2003,
Enterprise Edition, Build 3790". SPs are up-to-date.
The machine is a dual processor Pentium with 640MB RAM.
Any ideas?
Paul Tag: Clipboard Tag: 69475
Help with a Memory Stream issue
I have a funtion that returns a MemroyStream, but the MemroyStream may
or may not be return a stream with data if there is an error in the
function. What is the proper way to return a MemroyStream to the
caller so that they will have no issues? I could return a NULL, but
this raises other issues.
Thanks Tag: Clipboard Tag: 69469
.net framework installation problem
While installing .net framework, I get following message "Microsoft .NET Framework Setup has failed. If this continues, please contact Product Support.
the dotnetfx.log has following entr
Calling MsiInstallProduct() with commandline
ADDLOCAL=All ARPSYSTEMCOMPONENT=1 ARPNOREMOVE=1 REBOOT=ReallySuppres
IIS_NOT_PRESENT=
ReturnCode=160
Do I need to install the IIS as appears from the log? Pl. help
TIA Tag: Clipboard Tag: 69468
I need to copy the contents of a ListBox control to the clipboard. How do I do that in .NET
"Jon" <anonymous@discussions.microsoft.com> wrote in message
news:BDF3D6D0-14E2-4C5E-92CF-E5BC1AE101B2@microsoft.com...
> I need to copy the contents of a ListBox control to the clipboard. How do
I do that in .NET?
>
> Thanks.