Ok this is killing me. First off this is part of a plugin system I am working on for an app i am re-writting from vb6. What is happening is that I have a dll that contains a hashtable collection that stores class instances of my socket class for each connected user to my main app. Problem is, is I need the data my main app adds to that collection in that dll, accessable from external dll plug-ins. I just cannot get this .Ive tried making the hashtable public shared, but when the plug-in tries to get the hashtable, it always comes out blank.. Basically i need something like GetObject in VB which i used to get a running instance of a dll class. What am I missing?
Originally posted by Edneeis Here is the non remoting way I was speaking of. Its a bit of a quick version but I'm sure you'll understand.
Still doesnt do it. you should be able to run a second copy of the same exe(with changes to the button names as to not cause a key conflict in the hashtable), and when youy hit test, the messagebox should show 4. It still only shows 2.
So you don't want to share the applications hashtable instance you want one that is completely independant of the application and shared across multiple exes. I think you have to use remoting for that one sorry. Thats the only way I've found to share across multiple applications or application instances, because it sort of works like an activeX exe used.
yuck. I think I better find another way(hopefully). Using remoting is pretty slow(ok 1-2 seconds may not seem that long, but for what it needs to do, it is), and that is with client and server on same machine..Ill just keep looking. There has got to be a better way.. If anyone see's any other possible ways, let me know.
Please post back here if you find another way. Also there is a BIG difference in the different channels you use in Remoting and the speed. TCP being MUCH faster than HTTP and both are faster if they use the Binary sink or whatever they call it.
This may still be too slow for you, I used TCP but not Binary formatting. I don't know how to set Binary Formatting in code only in a config file and since the same exe doubles as client or server I didn't set up a config file. I also forgot how to set the timeout for the remoting attempts, because that is part of the delay here. It has to check for a server first which then if none is found it acts as the server, but that causes a little delay for the first instance startup.
Try changing the button caption from a 2nd instance of the app.