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
  1. Home
  2. General Programming
  3. Visual Basic
  4. Single Instances share Data space?

Single Instances share Data space?

Scheduled Pinned Locked Moved Visual Basic
csharpcomtestingtoolsperformance
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Indrora
    wrote on last edited by
    #1

    I'm writing a .NET version of Panorama (it changes your backgrounds in win98 but has Issues on XP/Vista -- i dont maintain it... i just like it) I have to handle It as a single instance application because i call the "ChangeDesktopBackground" command in user32.dll alot -- anywhere from 6 SECONDS to 4 HOURS... and i dont want a user going crazy because the desktop just changed 3935974958607367 times... it takes some doing too... I was considering DDE, but its dead. OLE automation is near imposible without killing the filesize (its 200kb right now -- and only takes up 400kb in memory.) I would like to have a command line param, say -a, that adds files to a listbox. Heres how i have it set up: FormMain FormMain.Desks(ListView) FormMain.AddSingle(Button) FormMain.AddDirectory(button) FormMain.RemoveItem(button) formMain.clearAllItems(button) FormMain.Timeout(spinCtl) FormMain.TimoutTimer(Timer) FormMain...... I want to be able to have it set up so that when the user calls something like "PanoNet.exe -a C:\Epic Files\Some File.jpg" "C:\Mpre FIles\Some Other FIle.BMP" the new instance tells the old instance to add the two files to the top of the end of FormMain.Desks.Items Can this be done? "Pinky, are you thinking what i'm thinking?" "I Dunno brain, who really came up with the idea for cheeze sticks?" "... apparently not ..."

    D 1 Reply Last reply
    0
    • I Indrora

      I'm writing a .NET version of Panorama (it changes your backgrounds in win98 but has Issues on XP/Vista -- i dont maintain it... i just like it) I have to handle It as a single instance application because i call the "ChangeDesktopBackground" command in user32.dll alot -- anywhere from 6 SECONDS to 4 HOURS... and i dont want a user going crazy because the desktop just changed 3935974958607367 times... it takes some doing too... I was considering DDE, but its dead. OLE automation is near imposible without killing the filesize (its 200kb right now -- and only takes up 400kb in memory.) I would like to have a command line param, say -a, that adds files to a listbox. Heres how i have it set up: FormMain FormMain.Desks(ListView) FormMain.AddSingle(Button) FormMain.AddDirectory(button) FormMain.RemoveItem(button) formMain.clearAllItems(button) FormMain.Timeout(spinCtl) FormMain.TimoutTimer(Timer) FormMain...... I want to be able to have it set up so that when the user calls something like "PanoNet.exe -a C:\Epic Files\Some File.jpg" "C:\Mpre FIles\Some Other FIle.BMP" the new instance tells the old instance to add the two files to the top of the end of FormMain.Desks.Items Can this be done? "Pinky, are you thinking what i'm thinking?" "I Dunno brain, who really came up with the idea for cheeze sticks?" "... apparently not ..."

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Yeah, it can be done. Just search the articles for "single instance" and you'll find a few that describe passing data back to the original instance of the app. You may want to check into .NET Remoting (older) or WCF (newer) if using the .NET Framework 3.0. Basically, your app is exposing a server that a new instance of the app connects to as a client.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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