Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Could you post the code you are using to retrieve the data?
  2. Any chance you could post the code you are using to display the form from the DLL?
  3. You could always try the FindWindow API Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, _ ByVal Msg As Integer, ByVal wParam As UIntPtr, _ ByVal lParam As IntPtr) As IntPtr Declare Auto Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr 'use like Dim hWnd as IntPtr = FindWindow("", "") and use the returned value as the first parameter to SendMessage. As to what you pass for the other 3 parameters depends on what you are trying to do. For a list of windows Messages you may want to Look on MSDN
  4. Just a quickie but is the SMTP service properly configured on the server?
  5. Any chance of posting the relevant code as well?
  6. If you do not specify a return type it assumes object - this will not always result in the correct behaviour at run-time. Option Strict is a good way to catch these things.
  7. Are you declaring return types on all your functions? If not then you will get errors at run-time. Although Option Strict may cause lots of errors it is only highlighting places where you have potential problems - if you can fix them in the compiler you will not have to keep suffering crashes at run-time.
  8. Are you getting the other error calling the same function or a different one? You can just type Option Strict at the very top of each of the .vb files (classes, code-behind etc.)
  9. If the host supports .Net then it's perfectly possible to do with .Net.
  10. In that case you probably will not be able to access the file directly, you may want to consider creating a Web Service that runs on the server and access the DB and then calling this service from other applications.
  11. Do you have any code so far? It is a lot easier for people to help if you do give them something to work with. Also giving a descriptive subject will make it easier for people to identify your problem - not everyone has time to read each and every thread posted.
  12. I don't believe you can use a data source that is a HTTP / FTP connection - you would need to access the file directly. Are you also hosting a web application of the server or just the database?
  13. The hosting site will need to support SQL server for that to work, which is unlikely for a free service. It should however be possible using an access database as that won't require any server side configuration.
  14. What problems are you having exactly?
  15. Download the DLLs to where? If this is a ASP.Net solution then all the Dlls etc remain on the server anyway.
  16. See the attached sample as one possible method, note you do not need to set a reference to the classlibrary - just make sure the DLL is in the same folder as the .exeResourceSample.zip
  17. Running the above code in ASP.Net will cause Excel to be executed on the server (where it cannot be seen) rather than the client. If you want the worksheet to be opened on the client you will need to provide a link to the sheet so the user is prompted to save / open the document.
  18. You can always use Window's Performance monitor to get at certain statistics for your application or within code you can look at things like Environment.WorkingSet or diagnostics.Process.GetCurrentProcess() to get at other properties. I would also go to http://www.sysinternals.com and download their Process Explorer tool as this can reveal a lot more about what is goin gon in terms of Memory, JIT, Garbage Collection etc. However as Wile said Memory usage can be a vague subject under .Net due to how Garbage Collection works, running the same application on differently configured machines can mean drastically different memory usage patterns.
  19. Without knowing any of the details could you not serialize the classes in question to a tempory file and pass that filename as a parameter to the other application and get it to de-serialize the classes from the file? You might want to put the classes in question into a shared classlibrary that all 3 .exes will use. Failing that you may need to look at something like remoting as a possible solution.
  20. Changes things a bit, a Mutex can have local (session only) scope or global (entire server) when running under terminal services clicky for details So try changing the above code to Dim m As Threading.Mutex Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim b As Boolean m = New Threading.Mutex(True, "Local\\AppNameHere" , b) If b = True Then 'already running Else 'guess what - not running End If End Sub and it should work, not got a TS handy and the local citrix server is being rebuilt so I haven't had chance to test the above code.
  21. If they are logging on to the same physical PC (i.e XP with user switching) then create the Mutex name based on a string concatenated with their logon ID.
  22. Checking for the process by name isn't an atomic operation and as such if two instances where launched very close together it is possible for the second to not detect the first. Joe Mamma's suggestion of using a mutex is more reliable, quick sample Dim m As Threading.Mutex Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim b As Boolean m = New Threading.Mutex(True, "Test", b) If b = True Then 'already running Else 'guess what - not running End If End Sub
  23. you mean something like Interface test Sub testing() End Interface Public Class Class1 Implements test Private Sub testing() Implements test.testing End Sub End Class
  24. Does it give any errors or just not work? What code have you got so far?
  25. You could use the System.Management namespace instead like Dim diskClass As New ManagementClass("Win32_LogicalDisk") Dim disks As ManagementObjectCollection = diskClass.GetInstances() Dim disksEnumerator As _ ManagementObjectCollection.ManagementObjectEnumerator = _ disks.GetEnumerator() While disksEnumerator.MoveNext() Dim disk As ManagementObject = _ DirectCast(disksEnumerator.Current, ManagementObject) 'Drive letter is the caption, message is the type where 'NoRoot = 1, Removable = 2, LocalDisk = 3, Network = 4,CD = 5, RAMDrive = 6 MessageBox.Show(disk("DriveType").ToString, disk("deviceid").ToString) End While or alternatively change the declaration to Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Integer
×
×
  • Create New...