Results 1 to 5 of 5

Thread: How to use OM's threading and paths

  1. #1
    Maximum Bitrate
    Auto Apps:loading...
    lambosprit's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    809

    How to use OM's threading and paths

    I've read in the plugin guide lines that we should use the safethread or task manager classes instead of using threads but theres no mention of how to do this. So my question is should I and how?

    my code normally is
    Code:
            Dim workerThread As Threading.Thread
            workerThread = New Threading.Thread(AddressOf startup)
            workerThread.Priority = Threading.ThreadPriority.Normal
            workerThread.Start()
    The same question for paths. I want to follow the guidlines for paths but dont know how they work. For example I want to write out a debug log for my plugins and was after creating a OMSkype folder under plugins and create a log file , possibly a directory under that.

    lastly, is it possible to have a plugin directory? I have a number of dll's needed for Skype and it would be good to keep them all in the same place. I tried just creating it but that doesn't seem to work it only works if all the dll's are in the root plugin folder.

  2. #2
    Confusion Master
    Auto Apps:loading...
    Enforcer's Avatar
    Join Date
    Sep 2003
    Location
    If you go down to the woods today, You're sure of
    Posts
    14,616
    Quote Originally Posted by lambosprit View Post

    lastly, is it possible to have a plugin directory? I have a number of dll's needed for Skype and it would be good to keep them all in the same place. I tried just creating it but that doesn't seem to work it only works if all the dll's are in the root plugin folder.

    One of the things I suggested right at the begininng.

  3. #3
    Raw Wave
    Auto Apps:loading...
    justchat_1's Avatar
    Join Date
    Jul 2008
    Location
    Boston, Ma or NY,NY
    Posts
    2,359
    Quote Originally Posted by lambosprit View Post
    I've read in the plugin guide lines that we should use the safethread or task manager classes instead of using threads but theres no mention of how to do this. So my question is should I and how?
    Even Easier:
    Code:
            OpenMobile.Threading.SafeThread.Asynchronous(AddressOf startup, theHost)
    Quote Originally Posted by lambosprit View Post
    The same question for paths. I want to follow the guidlines for paths but dont know how they work. For example I want to write out a debug log for my plugins and was after creating a OMSkype folder under plugins and create a log file , possibly a directory under that.
    Paths actually follow the official .Net specification, so its not even an OM thing, just something most programmers tend to not follow too well. The main rule is don't hardcode any paths or combine them yourself. Instead use Path.Combine to add the necessary path separators, but other then that its pretty straightforward.

    Quote Originally Posted by lambosprit View Post
    lastly, is it possible to have a plugin directory? I have a number of dll's needed for Skype and it would be good to keep them all in the same place. I tried just creating it but that doesn't seem to work it only works if all the dll's are in the root plugin folder.
    It should work as long as the folder name matches your dll name but i'll double check (ex Skype.dll in the plugins folder and SkypeSupport.dll in /plugins/Skype/).

    Quote Originally Posted by Enforcer View Post
    One of the things I suggested right at the begininng.
    And we had added it before even suggested...it just wasn't released when you requested it. Anything constructive you want to add feel free

  4. #4
    Maximum Bitrate
    Auto Apps:loading...
    lambosprit's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    809
    Quote Originally Posted by justchat_1 View Post
    Even Easier:
    Code:
            OpenMobile.Threading.SafeThread.Asynchronous(AddressOf startup, theHost)
    Thanks
    The main rule is don't hardcode any paths or combine them yourself. Instead use Path.Combine to add the necessary path separators, but other then that its pretty straightforward.
    I thought thats what I was to use but what values to give. For example in combine what do I put for the openmobile path which I want to append to.

    It should work as long as the folder name matches your dll name but i'll double check (ex Skype.dll in the plugins folder and SkypeSupport.dll in /plugins/Skype/).
    My dll has the same name as the folder under the plugins path but it didn't work for me I'm afraid.

  5. #5
    Raw Wave
    Auto Apps:loading...
    justchat_1's Avatar
    Join Date
    Jul 2008
    Location
    Boston, Ma or NY,NY
    Posts
    2,359
    Quote Originally Posted by lambosprit View Post
    I thought thats what I was to use but what values to give. For example in combine what do I put for the openmobile path which I want to append to.
    Ah ok... The plugin host contains properties for the most common base paths. Theres SkinPath for the current skins folder, PluginPath for the plugins directory and DataPath for OMs data storage directory. The latter directory is a writable directory on every platform even win7 w/UAC.


    Quote Originally Posted by lambosprit View Post
    My dll has the same name as the folder under the plugins path but it didn't work for me I'm afraid.
    Alright then i'll add that to the TO DO list and make sure its fully working by the time your ready to release everything.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •