Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
T

TheFarsider

@TheFarsider
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Referenced class won't let go of file [modified]
    T TheFarsider

    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

    Visual Basic question csharp com help workspace

  • First Call to Remote Object Does Not Respond on Two Machines
    T TheFarsider

    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.Inf

    Visual Basic csharp sysadmin cryptography debugging json

  • Writing a Plugin With Dependencies
    T TheFarsider

    I have a simple GUI interface that loads menus dynamically from a range of dll's/plugins. The problem I face is one of the plugins has a lot of Dependencies and needs to be executed with its own application path to be able to fucntion correctly. Is there a way I can load it into my GUI but set its base paths for loading assemblies etc to another path. A brief idea of what i want to achive. C:\program files\My App\Centralize Gui\Gui.exe C:\program files\My App\App1\App1Gui.dll C:\program files\My App\App2\App2Gui.dll Currently Gui.exe uses Activator.CreateInstance to dynamically load App1Gui.dll which returns a predefined iGUI interface. Public Interface Gui Delegate Sub RebuildMenuEventHandler() Property RebuildMenu() As Boolean Function GenerateMenu() As System.Windows.Forms.ToolStripMenuItem Sub AdminLevelChanged(ByVal AdminLevel As RMS.Gui.AdminLevels) Sub LoadGui() Sub ExitGui() End Interface The Gui.exe then calls LoadGui. The LoadGui routine does a lot of stuff and has to be able to access and load objects etc from assemblies within its own folder(eg C:\program files\My App\App1). This is where I hit the issue as it is currently running within "C:\program files\My App\Centralize Gui\" and of course fails to load any of the App1Gui.dll's dependencies. My gut feeling is I need to do something with Appdomains so that I can get App1Gui.dll to run within its own path but I cant find any good examples on how to achieve this and I haven't managed to get any of my own attempts anywhere near working. The solution works fine if i put my GUI within the App1 folder but this is not the solution as I need to have a single GUI that can control multiple applications. Thanks in advance for any help/pointers. To Errrr is human, but to really foul things up requires a computer

    Visual Basic help tutorial learning

  • Building a Modular System
    T TheFarsider

    Dave Thanks for the reply. The Plugin Method is one I did look at but I have managed to find the solution and once I got to the route of it, was really quite simple although admitadly I dont fully understand the solution myself yet. Thanks to Peter Huang and Terry for hitting a similar problem and providing me the vital clues Below is my proof of concept code '#### Application Code ### Dim ModulePath As String = ".\Modules\" Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim di As New IO.DirectoryInfo(ModulePath) Dim aryFi As IO.FileInfo() = di.GetFiles("*.dll") Dim fi As IO.FileInfo For Each fi In aryFi dllName = "James" GetCopyrights(fi.FullName, dllName) Next End Sub Sub GetCopyrights(ByVal dllPath As String, ByVal dllName as String) Dim oRMS As Object = Nothing Try oRMS = Activator.CreateInstanceFrom(dllPath, dllName & ".RMS.Controller").Unwrap() Catch ex As Exception Console.WriteLine(ex.ToString()) End Try If oRMS IsNot Nothing Then Console.WriteLine (oRMS.Copyright()) End If oRMS = Nothing End Sub '### Sample DLL Code ### Namespace RMS Public Interface iController Function Copyright() As String End Interface Public Class Controller Implements iController Function Copyright() As String Implements iController.Copyright Return "James Tutton 2007" End Function End Class End Namespace The only thing id still like to do is make sure the interfaces are common for both the dll and oRMS . The Overall purpose is building a service that uses a common interface for performing common activities. Sorry for the vagueness of my explanations but I am working under some strict NDA's on the specifics of the project. --How do you quote on this site??? anyhow Are these .DLL's being written so that each one is programmed to interact with a specific application?? Yes, the idea is that we build a dll to interact with each third party application we need to intereact with but all the calls and return values are normalised across them by the dlls.

    Visual Basic tutorial

  • Building a Modular System
    T TheFarsider

    Hi I am writing a service which needs to monitor multiple programs/files etc on a system. The Service is being designed so that it will call standard methods against a range of Standardised dll's. Application1.GetLastEvent 'Where Application1 is an dll written purely to talk to Application1 Application2.GetlastEvent 'Where Application2 is another dll written purely to talk to Application2 Each dll is being written to get the relevent details from a particular application. Now I could compile the application with all the dll's and just have a setting to only make the request if the application is installed but this would mean rebuilding and and redeploying the service if we wanted to add and check application 3. Im sure this must be possible at runtime. What I want to achieve is have a runtime list of dll's for the installed applications and make the standard calls against each in turn. The Application should not need to know anything about these apart from the methods which are standard across all of the them. Thanks in advance, I dont really need a full code listing on this one just a nudge in the right direction as cant seem to find the correct terms to find anything on the WWW. :confused: James First learn how to speak ~ Then you figure out what Language to speak

    Visual Basic tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups