|
are you using suspendlayout/resumelayout when placing controls on the form? stops the paint even until you resumelayout.
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
i have application that works well as window app. i took some of the code to winservice it work. i now make the parameter to come from database. the service is running but does not send mail again
any solution pls
|
|
|
|
|
Please don't double post.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
sorry for double post. should i upload all the code. it doesnot trow any error. except that it does not send mail based on infornation from the database
|
|
|
|
|
I guess you are gong to debug it based on your latest post, so you should be able to locate the problem.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I have encountered a very strange issue with .Net 2 Framework and my remoted object.
I have the code below that runs on a service. It first publishes the remote object and then if it was succesfull trys to connect to it.
Other clients connect afterwards but that beyond scope of issue
Private Sub LoadRemotingClient()
RMS.Debugger.AddMethodDebug()
' We Load The remoting Client within the server as this is faster overall
Dim objRemotingKaveManager As AVManager.IAvManager
Dim clientProvider As BinaryClientFormatterSinkProvider = New BinaryClientFormatterSinkProvider()
Dim serverProvider As BinaryServerFormatterSinkProvider = New BinaryServerFormatterSinkProvider()
Dim props As IDictionary = New Hashtable()
Try
serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
props("port") = 0
props("typeFilterLevel") = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
props("name") = System.Guid.NewGuid().ToString()
props("timeout") = 30
ClientChannel = New TcpChannel(props, clientProvider, serverProvider)
clientProvider = Nothing
serverProvider = Nothing
props = Nothing
RMS.Debugger.AddMessageDebug("Register Channel", RMS.Enumerators.Debugtype.Information)
ChannelServices.RegisterChannel(ClientChannel, True)
RMS.Debugger.AddMessageDebug("Start Call Activator", RMS.Enumerators.Debugtype.Information)
Dim RemotingServer As String = "tcp://" & RemotingServerName & ":" & RemotingPort.ToString & "/" & RemotingURL
objRemotingKaveManager = CType(Activator.GetObject(GetType(AVManager.AVManager), RemotingServer), IAvManager)
RMS.Debugger.AddMessageDebug("Done Call Activator", RMS.Enumerators.Debugtype.Information)
RMS.Debugger.AddMessageDebug("Start Call InterfaceRef", RMS.Enumerators.Debugtype.Information)
Try
Dim InterfaceRef As String = objRemotingKaveManager.WhatistheObjectHash
RMS.Debugger.AddMessageDebug("Remote Object Hash = " & InterfaceRef, RMS.Enumerators.Debugtype.ExtraInfo)
Catch ex As Exception
RMS.Debugger.AddMethodDebug(ex.Message, RMS.Enumerators.Debugtype.Critical)
End Try
RMS.Debugger.AddMessageDebug("Done Call InterfaceRef", RMS.Enumerators.Debugtype.Information)
Catch ex As Exception
' Connection failure
RMS.Debugger.AddMethodDebug(ex.Message)
End Try
objRemotingKaveManager = Nothing
End Sub
Private Sub LoadRemotingServer()
RMS.Debugger.AddMethodDebug()
Dim ServerLoaded As Boolean = False
Try
Dim clientProvider As BinaryClientFormatterSinkProvider = Nothing
Dim serverProvider As BinaryServerFormatterSinkProvider = New BinaryServerFormatterSinkProvider()
serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
Dim props As IDictionary = New Hashtable()
props("port") = AVSettings.RemotingPort
ServerChannel = New TcpChannel(props, clientProvider, serverProvider)
ChannelServices.RegisterChannel(ServerChannel, True)
RemotingServices.Marshal(objLocalKaveManager, AVSettings.RemotingURL)
ServerLoaded = True
RMS.Debugger.AddMessageDebug("Remoting Server Loaded")
Catch ex As Exception
RMS.Debugger.AddMethodDebug(ex.Message)
ServerLoaded = False
End Try
If ServerLoaded = True Then
LoadRemotingClient()
End If
End Sub
The code worked completly fine and executed in under 1 sec in all testing. Now the code is live and out there it is still functioning correctly apart from two laptops. Both are Dell D531's and belong to the same customer.
On both machines the code writes the line "Start Call InterfaceRef" to my debug routine and then stops. On one occation after just over 2 hours it reached "Done Call InterfaceRef" and continued without the remoted object. This was before the exception handling routine was added so assume it eventually timeout(dont have an exception at this time).
I have tried everything I can think of:
Remoting is all done across 127.0.0.1 the connection establishes fine (checked with sysinternals tcpview.exe if anyone interested).
The server responds via telnet on the port.
Tried different Ports 18437, 28437
Have booted the system in diagnostic mode to eliminate conflicts with other software/services
Changed the order of network adaptors
Added props("timeout") = 30 as part of testing to try to force a timeout. Seen reference to a timeout on tcp channel but not sure my usage is correct.
I am confident in the code itself but am out of ideas with regard to resolving the issue on these two machines and also without knowing the source of the issue that it may crop up else where as the product expands.
All help, ideas and even stupid suggestions greatfully recieved at this point as I am out of idea good or otherwise LOL.
Thanks
The Farsider
|
|
|
|
|
Are you able to download / install / operate the AVManager software on these two PC's that are acting up?
|
|
|
|
|
I have a class setup that sends an e-mail using SMTP. This class is setup to be used by other programs using it as a reference.
I have a program that creates a file and then calls this class to send the e-mail with the attachment. After the class sends the file and returns a boolean of True to tell the calling program it succeeded, the original program is supposed to delete the original file.
Unfortunately the calling program seems to still be holding onto the file. Below is snippits of the code from the e-mail class. How can I get this class to let go of any attachments that it works with? Everything is working fine, it sends the e-mail, etc, but won't let go.
...
Dim myAttachment As System.Net.Mail.Attachment = New System.Net.Mail.Attachment("c:\test.txt")
Message.Attachments.Add(myAttachment)
...
Dim SmtpMail As New SmtpClient
SmtpMail.Host = "SMTP.Mydomain.com"
SmtpMail.Credentials = New System.Net.NetworkCredential("myUsername", "myPassword")
SmtpMail.Send(Message)
Return True
I have a try catch that will send false if the e-mail fails.
I tried this code but it didn't seem to help:
SmtpMail = Nothing
Message = Nothing
Any help / suggestions are appreciated.
Lost in the vast sea of .NET
modified on Thursday, June 19, 2008 9:44 AM
|
|
|
|
|
Does it implement the IDisposable interface? If yes, then you have to call Disposr on it.
|
|
|
|
|
No I'm not. I had a similar class doing the same type work in VS 2003 and had no problems with the class hanging onto the attachment, but it seems like the same type of class written in VS 2005 2.0 is not letting go.
Is the IDisposable interface a 2005 feature and since I don't have it implemented in this project do you feel I should? If so, any advise. On a google search it seems like there is a wrong way people implement in and a right way. Any suggestions on a good place to research this interface?
Thanks
Lost in the vast sea of .NET
|
|
|
|
|
KreativeKai wrote: Is the IDisposable interface a 2005 feature
No, it has been around since .NET 1.0
KreativeKai wrote: since I don't have it implemented in this project do you feel I should?
I don't know, I am merely suggesting paths of investigation. I am saying that if the class that is holding on to the file (a class in the .NET framework I would presume) AND it implements IDisposable then you should call the Dispose() method it implements.
KreativeKai wrote: On a google search it seems like there is a wrong way people implement in and a right way. Any suggestions on a good place to research this interface?
I never asked you to implement the interface. I said if it was already implemented by the framework classes that you are using then you should call Dispose() .
|
|
|
|
|
Disposing didn't help? I used an article from MSDN that showed how to use it. I'm not sure if this was the best way to handle the idisposable interface or not?
http://msdn.microsoft.com/en-us/library/s9bwddyx(VS.80).aspx[^]
If you have any other suggestions I would be interested in hearing?
Lost in the vast sea of .NET
|
|
|
|
|
Its seesm to me that you are waiting on the Garbage collector to dispose of myAttachment
If you need to release it sooner then you should explicity release the resourse either with
myAttachment = nothing
or if it is disposable myAttachment.dispose
Remember that "return True" will cease all execution in the code block so anycode after "return" is not called so dispose of resources before you return.
The other option is use the
Try
'Code to Try
Catch
' Error code
Finally
' Clean up code
' You cant call return in here
' Also be carefull with dispose object that may not have been created as can end up will null reference errors
End try
|
|
|
|
|
I tried both ways to release the hold on the attachment with no luck. What is wierd is I have a class doing the exact same process in the 1.1 framework using System.Web.Mail and when it returns true to the calling program there is no problem with the attachment not being released.
When I use my framework 2.0 class using System.Net.Mail it doesn't let go of the file once it returns true to the calling program.
Any suggestions are appreciated
Lost in the vast sea of .NET
|
|
|
|
|
Hi there. I am trying to add users to ADSI via a VB web form. Now i have tried many ways but no luck. I have a good felling that the code im using now will work. But i keep getting a "COMException was unhandled by user code."
ADspath = "LDAP://xxx.xxx/ou=people,dc=xxx.xxx,dc=com"
con = CreateObject("ADODB.Connection")
con.Provider = "ADsDSOObject"
con.Properties("User ID") = "uid=00-0F-FE-AB-A8-5A,ou=users,dc=devlab.local,dc=com"
con.Properties("User ID") = "uid=administrator,ou=users,dc=devlab.local,dc=com"
con.Properties("Password") = "UID=Password"
con.Properties("ADSI Flag") = 34
con.Properties("ADSI Flag") = 546
con.Open("ADSI")
com = CreateObject("ADODB.Command")
com.ActiveConnection = con
com.CommandText = "<" & ADspath & ">;(uid=" & Password & ");Adspath,CN,givenname,xxxyyyIID;subtree"
rs = com.Execute 'This is where I get the COM error.
Please if any one has dealt with this beast or has a solution, please let me know.
Regards
Kev
|
|
|
|
|
You are using adodb for it ? Hmm.. never really did that before like that..
take a look at: http://www.computerperformance.co.uk/vbscript/vbscript_user_create.htm[^]
for the vbs way...
as for .NET there are *ALOT* of good articles right here on codeproject. I actually used one of the projects classes with some minor modificiations to implement a complete user control system for handeling all user account activities (create, del, enable, disable, password reset) etc.. for a helpdesk system and inventory management of IT assets together with the user...
Do or don't.. there is no "try catch ex as exception end try"
|
|
|
|
|
|
I am looking for example that shows me how to write a file joiner or splitter.
Can you show me some examples about that and about md5 checksum as well.
Thanks a lot!
|
|
|
|
|
|
How can i do for this think:
* send a file via serial rs232 interface
* get the data after transfer via rs232 interface
* and how can i save a file after that
And who knows what's:
* the form of file/data that i will receive after
Lets assume i am using two PC for this jobs.
thanks!
|
|
|
|
|
First, sending files over serial port is very ineffecient. If it's mission-critical be sure to use an error-correcting protocol such as XModem or ZModem, otherwise one transmit error and you're messed up.
Use the System.Io.Ports.SerialPort class[^] for basic sending/receiving.
|
|
|
|
|
Hi,
I've been messing with this for a while and am obviously missing something but i just don't see it :s...
I'm trying to do a drag drop between 2 listviews and want to drop on a specific location.. Although i think my code is right (which it obviously isn't :p) .. it always returns index -1 on the droplocation..
my code:
Private Sub LVPlaylist_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LVPlaylist.DragOver
' Retrieve the client coordinates of the mouse pointer.
Dim targetPoint As Point = LVPlaylist.PointToClient(New Point(e.X, e.Y))
' Retrieve the index of the item closest to the mouse pointer.
Dim targetIndex As Integer = _
LVPlaylist.InsertionMark.NearestIndex(targetPoint)
'just some visual feedback to see where I am dragging.. -1 always anyways..
LblTargetIndex.Text = LVPlaylist.GetItemAt(targetPoint.X, targetPoint.Y).ToString
' Confirm that the mouse pointer is not over the dragged item.
If targetIndex > -1 Then
' Determine whether the mouse pointer is to the left or
' the right of the midpoint of the closest item and set
' the InsertionMark.AppearsAfterItem property accordingly.
Dim itemBounds As Rectangle = LVPlaylist.GetItemRect(targetIndex)
If targetPoint.X > itemBounds.Left + (itemBounds.Width / 2) Then
LVPlaylist.InsertionMark.AppearsAfterItem = True
Else
LVPlaylist.InsertionMark.AppearsAfterItem = False
End If
End If
' Set the location of the insertion mark. If the mouse is
' over the dragged item, the targetIndex value is -1 and
' the insertion mark disappears.
LVPlaylist.InsertionMark.Index = targetIndex
End Sub
Private Sub LVPlaylist_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles LVPlaylist.DragDrop
Dim MyItem As ListViewItem
Dim MyItems() As ListViewItem = e.Data.GetData("System.Windows.Forms.ListviewItem()")
Dim i As Integer = 0
Dim targetIndex As Integer = LVPlaylist.InsertionMark.Index
For Each MyItem In LVfiles.SelectedItems
'is -1 ALWAYS so put it at the top...
If targetindex = -1 Then targetindex = 0
'TODO: make sure the targetindex get's ++ for every item dropped
Dim newitem As ListViewItem = MyItem.Clone
LVPlaylist.Items.Insert(targetindex, newitem)
Next
End Sub
So what am i Missing
|
|
|
|
|
hi,
i'm using VS2008 and work on vb.net wondows application, i have problem here, i'm now using rs232 to display a picture on a board that have LED that have three color in a pixel, the problem now is i need to code a picture in bitmap and take all it's color in pixel and display it to the display board... i'm new in using vb.net graphic..
so, how can i read a bitmap and write it into a picturebox(for example)..
i'm confusing in searching where they all talk about setpixel and getpixel..
or there any reference that same with my problem..
please, in urgent project..
|
|
|
|
|
Does any one know how I would get some data from a MsSQL database and upload it to MySQL hosted server
Situation
I’m running Symantec backup exec on a few severs and they email me notifications of what’s happened in the back up but there are too many to start filling away!!! The program uses MsSql to store the information I want to upload it to mysql hosted sever. I can tell backup exec to run a command after backup
any ideas guys
|
|
|
|
|
You want this automatically or want to do it manually ? You want incremental or just replace all the data on the hosted server ?
If you want to go automatic.. One of the best tools i've seen (opensource) in a long while is Jitterbit (http://www.jitterbit.com/[^]).
This is a piece of software that let's you do database integration on a drag-drop basis. You can go pretty advanced with it, and it connects to just about any database and "transforms" your data, based on a query to just about any other. It can handle webservices, txt or other files, etc .. etc.. and can be schedules to do inserts/updates ever x times ...
Might be worth taking a look at.
|
|
|
|