|
It's possible that you are hitting a port conflict with another application, or that the firewall is not allowing the application to pass through this port. To see if you're getting a conflict, try running netstat -a from the command prompt.
|
|
|
|
|
you may be binding to the wrong adapter... to see if this is the problem, change the order of the adapters:
To view order of adapters: on cmd prompt type: ipconfig (the result will be the default bind order)
To change order of adapters: last adapter enabled will become last in the list (so change the order by disabling/enabling in the network connections menu accordingly)
if you determine that this is the problem, then you have to manage your adapter binding a bit smarter in the code.
|
|
|
|
|
Hi,
I'm trying to create a memory mapped file file using
var mmf = MemoryMappedFile.CreateFromFile(@"C:\Temp\XMLFile.xml", FileMode.Open, "memMapFile");
in the OnStart() of the service class. The mmf gets created, but trying to access it from an application using
var mmf = MemoryMappedFile.OpenExisting("memMapFile");
leads to a FileNotFoundException.
When the file is created in an application instead in a service, this works.
What am I missing?
Thanks for your help!
|
|
|
|
|
You need to create an inter-process memory map file with MemoryMappedFile.CreateNew method. In this way you'll be able to access it from different processes.
|
|
|
|
|
Not if he's only accessing it from the Service, not from other processes.
|
|
|
|
|
Thanks for your reply Ciumac!
I went trough the description of the MemoryMappedFile class, but couldn't figure why MemoryMappedFile.CreateFromFile should deliver a result different than MemoryMappedFile.CreateNew. Nevertheless I tried it out - no success!
|
|
|
|
|
Is it a local variable in the method? Or a member of the class?
|
|
|
|
|
Thanks PIEBALDconsult!
It was a local variable.
Best regards!
|
|
|
|
|
Hello guys...
I have addin for visual studio 2005 with its '.dll' files, in 2005 you just put it in the "\Documents and Settings\user name\My Documents\Visual Studio 2005\Addins" then it will work directly, but i want to use it "same addin" in visual studio 2008 or 2010 so i need to do to make it work
thank you .
|
|
|
|
|
Take a look at this[^]. It should help.
|
|
|
|
|
Hi guys, I have the following problem.
I have 3 buttons (ProcessA, ProcessB and ProcessC) and this are the scenarios:
- By the time I push ProcessA, then disable ProcessB and ProcessC buttons
- By the time I push ProcessB, then disable ProcessC and ProcessA buttons
What I am doing now to set one button properties from an external thead are the following sentences:
if ProcessA is started, then
changeBtnStatus(btnProcessB, false);
changeBtnStatus(btnProcessC, false);
if ProcessA is stopped, then
changeBtnStatus(btnProcessB, true);
changeBtnStatus(btnProcessC, true);
and the same for processB
if ProcessB is started, then
changeBtnStatus(btnProcessC, false);
changeBtnStatus(btnProcessA, false);
if ProcessB is stopped, then
changeBtnStatus(btnProcessC, true);
changeBtnStatus(btnProcessA, true);
this is the generic method
public void changeBtnStatus(Button button, bool status)
{
button.Invoke((MethodInvoker)delegate { button.Enabled = status; });
}
ProcessB is working fine, but ProcessA button is not working well. The ProcessC button is not getting disabled by pression btnProcessA, why this happens? I have made some tests and I realized that I uncomment ProcessB block of code, ProcessA will work correctly. The problem resides in chaging btnProcessC propierties because both blocks set this property.
Hope this is enough information.
Thank you in advance!
|
|
|
|
|
Member 7812318 wrote: if ProcessA is started, then changeBtnStatus(btnProcessB, false); changeBtnStatus(btnProcessC, false); if ProcessA is stopped, then changeBtnStatus(btnProcessB, true); changeBtnStatus(btnProcessC, true);
your message isn't very clear and this isn't C# code; you probably have a minor mistake somewhere, with what you have shown and told us, I can't tell you in any detail.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hello,
This is the situation I have an assembly A (plugin) loaded into separate app domain, that assembly fires a couple of events.
And i have a class B created using the default App domain.
Now Class A raises and event and event handler in class B catches that event, but since it is called from another App domain (A) it cannot see variables of app domain B (all variables are null) in this case a public static object that is 100% not null on app domain B.
I think i understand why the variable is null, but how do i execute event handler code in app domain B so that code executed in app domain B will see the variables initialized?
I have tried CrossAppDomainDelegate but it can only call mehods that don't have any parameters, and since this is an event handler it has parameters and not standard event signature but with a custom EventArgs.
How can i solve this problem.
Thank you!
|
|
|
|
|
Make sure the objects passed in the delegate arguments, and the result type, are either simple objects or inherit from MarshalByRefObject. You will probably need to create proxy classes for complex types in your plugin to achieve that. For example from my lobby server:
public class LobbyProxy: MarshalByRefObject {
public BaseLobby lobby;
public LobbyProxy(BaseLobby l){ this.lobby = l; }
public void Log(object sender, String msg){ lobby.Log(sender, msg); }
public MemberInfo Member(int id){ return lobby.Member(id); }
public MemberInfo GetMember(string name){ return lobby.GetMember(name); }
public bool MemberInGame(int member, int game){ return lobby.MemberInGame(member, game); }
public int MemberIndexInGame(int member, int game){ return lobby.MemberIndexInGame(member, game); }
}
public class ServerLobbyProxy: LobbyProxy {
public ServerLobby serverLobby;
public ServerLobbyProxy(ServerLobby l) : base(l) { this.serverLobby = l; }
public void SendMessage(int id, uint command, byte[] msg){ serverLobby.Server[id].SendMessage(command, msg); }
public void SendMessage(int id, uint command, byte[] msg, byte pt){ serverLobby.Server[id].SendMessage(command, msg, pt); }
}
public class ClientLobbyProxy : LobbyProxy {
public ClientLobby clientLobby;
public ClientLobbyProxy(ClientLobby l) : base(l) { this.clientLobby = l; }
public void SendMessage( uint command, byte[] msg){ clientLobby.Connection.SendMessage(command, msg); }
public void SendMessage( uint command, byte[] msg, byte pt){ clientLobby.Connection.SendMessage(command, msg, pt); }
public int MyID { get { return clientLobby.MyID; } }
public MemberInfo Me { get { return clientLobby.Me; } }
public void DoChat(int DefaultScope, String msg, int GameID){ clientLobby.DoChat(DefaultScope, msg, GameID); }
}
This is actually the other way around (so plugins can call methods in the main app domain) as I find that design cleaner. (Plugins are responsible for making sure that they respond to events and call whatever they need to in the main app domain, via these well defined interfaces.) But the same thing should work from the other side too.
|
|
|
|
|
Hi guys,
i have a project in which I'm supposed to retrieve data from the database and put d data into an XML file (with a defined schema), and send that file encrypted and all.
My problem, however, is getting the data into XML.
Please anyone knows how to achieve this?
He who goes for revenge must first dig two graves.
|
|
|
|
|
You're getting answers in Q/A for this question. Why did you post it here as well?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
I've had no answers. I wouldn't be posting here if I had an answer to this. Pls can u help me out?
He who goes for revenge must first dig two graves.
|
|
|
|
|
That's not the way the site works. This is a volunteer site where people help out as and when they can. If you post a question in multiple locations, then answers to the question become fragmented making it harder for us to identify what's been said to you already, and making it next to impossible for somebody following a link in from a search engine to follow answers to a problem that they may be having just because you're impatient.
|
|
|
|
|
But i have posted this nowhere else. Of course i know how the site works!
He who goes for revenge must first dig two graves.
|
|
|
|
|
You've posted it in two places. Q and A, and here. The two aren't linked together.
|
|
|
|
|
Pete,
i went over to Q&A, and that wasn't me. Besides, the questions are quite different. He's trying to export to an XML file, while i'm trying to export data to a Typed XML Schema file. I can do the former, but have problems with the latter. I've seen the responses to that, and they aren't helpful to mine.
I humbly ask, pls is there any1 with a solution to my problem?
He who goes for revenge must first dig two graves.
|
|
|
|
|
|
No problem, Pete, just a misconception.
He who goes for revenge must first dig two graves.
|
|
|
|
|
Do you wish to create the schema as part of the xml production or is that defined already?
Without going near code, SQL Server has got various things in it to retrieve data in XML, using the FOR XML AUTO thing for instance. That is of course, presuming you're using SQL Server.
Regards,
Rob Philpott.
|
|
|
|
|
Rob,
Yes, i'm using SQL Server. The problem is that i'm supposed to pull several data from various tables, and the schema has been defined by my clients in one cumbersome XML schema file. The data includes names, addresses, sales agents (which could be multiple), contacts (phones and emails, which could also be multiple), and so on. So i'm supposed to bring all data relating to one person into an XML file.
That's my problem.
He who goes for revenge must first dig two graves.
|
|
|
|
|