none
A Windows service to make data available RRS feed

  • Question

  • We would like to separate a piece of our application, a part that loads arrays to make file content available to other parts of the app, so that they are available always, rather than loaded on startup of the app, to avoid latency issues seen now.

    If a Windows service is started and loads these arrays of data, and they were available to our app to call that would make it dynamic.

    If a com dll could be loaded by the service that itself loads these arrays, that would seem to e a path to making the data available.

    1) Does this sound like a reasonable means of making the data available? 
    2) Is it likely that a loaded dll with arrays in its memory space could be made available to a calling app? 

       Two methods look like possibilities, essentially the two lines below. Is either of these a path to exposing the com dll?

        If a client makes a vb "GetObject" call, the second method, though it appears to create an object, ie no errors on service startup, the vb client errors out with activex component cannot create object. Would much appreciate any guidance here.

          Assembly.Load("CCAClassify.MyClass");

           classifyObject = Activator.CreateInstance(classifyType); 


    Thursday, July 21, 2011 2:46 AM

All replies

  • You're creating a separate service.

    They you want that service to use a com component?

    So that's 2 levels of indirection.

    Why not just one level of indirection and do your stuff in the service?

     

    If you already have this com component then why not just a lazy load via a thread?

    Thursday, July 21, 2011 3:28 PM
  • Can a Windows service load arrays and make them available to callers? A dll may be unnecessary otherwise.
    Thursday, July 21, 2011 3:49 PM
  • Personally, I would look at doing this in a thread, or many threads.

    Failing that a windows service.

    But I'd want a good reason for writing a separate service just to fill some arrays in a windows app.

    I assume your app is windows since you mention windows service rather than web service.

    Loading a bunch of arrays seems an unlikely html web app requirement.

    Friday, July 22, 2011 9:21 AM
  • Thanks. If threads allow having this data dynamically available that might work.

    We have had this app in place, but it's had latency issues. An Add-in runs in Outlook, and on startup the add-in loads arrays from files and checks if the user is among a list of users whose emails are worth checking on for who they are sending to.

    It's an app that queries users on whether they are discussing matters that should be made public in compliance with laws which enforce that any legal interpretations considered advice be made subject to review by peers. If eDiscovery is familiar to you this is an example. 

    The arrays of data on senders and recipients involve distribution lists potentially, and we may want to load alot more live data objects from Active Directory to make the accessing of all senders and recipients to check for than currently, so we are thinking if all this is accessible in memory before Outlook starts up it would be much better.

    We already have problems with remote users over cable or DSL, starting Outlook and having delays, the current text files are on a network share.

    So the thought was have a Windows Service and expose the content of the lists somehow before OL starts.

    But though I have loaded a com dll in a Service, seeing it running in Sysinternal's Process Explorer, the souped up task manager thing from MS's Mark Russinovich, if I try to call the object via GetObject(), I get an error 429, the ActiveX component cannot be created.

    So maybe my path to this is wrong architecturally, either a Windows Service is not the way, or there is a missing piece to include on top of it, named pipes or something, to get this functionality. Or WCF services might be the path instead.

     

     

    Friday, July 22, 2011 2:19 PM
  • You can access active directory from a thread.

    You can read files off shares from a thread.

    Just use a thread.

     

    And

    Avoid using com unless you really have to.

     

    The only reason not to use threads is if the client will be in a situation where it can't get at the data it's reading.

    In which case, you need http and a wcf web service so your data can cross that firewall.

     

    Friday, July 22, 2011 3:01 PM