|
I have solved the problem.
Just disable UAC and run the "Visual Studio 2008 Command Prompt" as administrator, then type
installutil servicename.exe
and press enter.
The service is instaled!!!!
|
|
|
|
|
What does this mean?
Disconnected Context was detected<br />
Message: Context 0x1b9351e0' is disconnected. Releasing the interfaces from the current context (context 0x1b934f90). This may cause corruption or data loss. To avoid this problem, please ensure that all contexts/apartments stay alive until the application is completely done with the RuntimeCallableWrappers that represent COM components that live inside them.<br />
.45 ACP - because shooting twice is just silly ----- "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 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Normally it means this[^]. Have you got any threading code in there? If so, it's possible that you've got a thread closing before cleanup has taken place.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Yeah - it was taking too long or something.
.45 ACP - because shooting twice is just silly ----- "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 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thanks a lot for your helpful link.
I just happened to run into the same problem: I instantiated a COM object, and did that in a background thread during the startup of our application because the call to its "Initialize" method (which is required before other methods can be called) often took some 30 seconds. In order to keep things easy, I made the class containing that COM object a singleton (could do so because I do not need more than one object of it at a time). And when I then called a method of that COM object, it failed with exactly the error described by the OP: because the background thread in which it was created had already ended.
The bad thing here is that the supplier of the COM component is not capable of changing that low performance behavior...
|
|
|
|
|
Hi,
Any idea how to display animated image in datagridview columns?
|
|
|
|
|
http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/4f3465b0-7126-4f86-b2e3-e5ecc336b1c8
|
|
|
|
|
Hi all
How to prevent user check on checkbox of a listview control. The listview control contains many of row items which can be selected by clicking on the checkbox. But now I want to prevent user click on the checkbox. I will check them by code in program.
And the listview control will be still active. That means user still selects one row item but just cannot click on the checkbox.
Anybody help me
thanks in advanced!
[N][Q][H]
|
|
|
|
|
Assuming this is Forms...
Maybe you could handle the ListView.ItemCheck event, and in
your handler check if the ItemCheckEventArgs.NewValue is
different from the ItemCheckEventArgs.CurrentValue, and if so,
set the ItemCheckEventArgs.NewValue to ItemCheckEventArgs.CurrentValue.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
[N][Q][H] wrote: But now I want to prevent user click on the checkbox.
Why would you offer the user a checkbox if you don't want them to be able to use it?
|
|
|
|
|
Actually, I am trying to send message to a listview which does not allow me click to the checkbox. This is a trainning for a online game. Since character'level less than 10 I can click on the checkbox and this trainning will train my character. but if character'level greater than 10. The trainner will not allow me click to the checkbox.
In the first case(level < 10). I have tried send message to click the first row items. It works properly.
ListView_SetCheckState(hwnd,0,true);
But when my character'level reachs to 11. The list view seems be blocked(Notice that listview still be actived). In this case, the code does not work. I cannot only click to the checkbox but also using ListView_SetCheckState.
I guest that I need to send a message to update the property of listview before I can use ListView_SetCheckState. But what needs to be updated?
Plz help me!
thanks
[N][Q][H]
|
|
|
|
|
[N][Q][H] wrote: But when my character'level reachs to 11. The list view seems be blocked(Notice that listview still be actived).
I'm not sure what you are saying here; can you explain how this affects the ListView? Can you also show us the code that is affected?
|
|
|
|
|
how about e.Handled = true in eventHandler, or disabling the check box.
HTH,
|
|
|
|
|
I always have trouble debugging methods (doing a watch, for example) over methods that pass some information to another thread and wait for the result, as the other thread is keept suspended while evaluating is done.
Is there any way to mark a thread to be "invisible/unstopable" by the debugger?
|
|
|
|
|
AFAICT, there's no way to do this. Once the app breaks in the debugger, all threads stop along with it.
|
|
|
|
|
I made a big mistake. The code bellow tells everything:
private void SearchFolders(FileSystemInfo[] fsInfos)
{
foreach (FileSystemInfo fsi in fsInfos)
if (fsi is FileInfo)
try
{
ReplaceInFile((FileInfo)fsi, "textToSearch", String.Empty);
}
catch {}
else if (fsi is DirectoryInfo)
SearchFolders(((DirectoryInfo)fsi).GetFileSystemInfos());
}
private void ReplaceInFile(FileInfo fi, string searchText, string replaceText)
{
StreamReader reader = new StreamReader(fi.FullName);
string content = reader.ReadToEnd();
reader.Close();
content = Regex.Replace(content, searchText, replaceText);
StreamWriter writer = new StreamWriter(fi.FullName);
writer.Write(content);
writer.Close();
}
So i have a recursive function SearchFolders witch searches an expression in all files from a folder. The problem: well i forgot to put the condition that the search should be done only on text file. So the function just executed on every kind of file (jpeg, gif, pdf, doc, etc.). The result: the files are unreadable. Tryng to reverse the proces with someting like this had no result
private void Reverse()
{
FileInfo fi = new FileInfo(@"D:\test\test.jpg");
FileStream fs = fi.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None);
StreamReader sr = new StreamReader(fs);
string content = sr.ReadToEnd();
System.Text.UTF8Encoding utf8 = new UTF8Encoding();
byte[] bytes = utf8.GetBytes(content);
FileStream fstarget = File.Create(@"D:\test\reverse.jpg");
fstarget.Write(bytes, 0, bytes.Count);
fstarget.Close();
}
I think the files are lost but i just want to hear and another opinion.
|
|
|
|
|
cristi82gt wrote: ReplaceInFile((FileInfo)fsi, "textToSearch", String.Empty);
No, it's not reversible. What you did was replace every occurance of a certain text with nothing. Now you have no idea where to put the text back into the files. If you replaced it with a known string, that would be different, but since you used String.Empty, you've lost any hope of knowing where to put back the bytes you took out.
The bottom line is those files are hosed up beyond repair.
|
|
|
|
|
Thanks for the answer Dave. Well i don't want to bring the text files to the way they were before, only the other types of files (jpeg, pdf).
Let's neglect for a little the function ReplaceInFile , because the expression to replace was pretty long (around 60-70 characters) and i don't think that in an image read as text would find it(very improbably)
The problem is that i read an binary file(for example an image-JPEG) with a StreamReader (UTF8 encoding) as a string, than i wrote that text with a StreamWriter overwriting the original file. (the function i wrote was clearly meant for text file but i forgot to limit it only to those type of files)
The problem is that the image file is now unreadable because it has been written as a text file with UTF8 encoding. I know that in case of Base64Encoding reading a binary file as text wouldn't be a problem, because the text can be reverted back to bytes so that would again compose a valid image(jpeg) for example
In the case i did i don't think this is possible. Any ideas?
|
|
|
|
|
I'll ignore that you shouldn't have written a file that you didn't change...
Since the conversion from binary to UTF-8 is "lossy", there is no way to go backwards.
|
|
|
|
|
OK thanks again Dave. That's all i wanted to hear.
|
|
|
|
|
To which is passed like destination a project, and generates Web Service and publishes to in Internet Information Server.
in Visual Studio 2008. to Framework 3.0 or 3.5 in c#
Existe alguna función en el Framework de .net, que pasándole el destino de un proyecto creado en Visual Studio, me genere del proyecto un Web Service y me lo publique en Internet Information Server.
Gracias
|
|
|
|
|
Please don't cross post. You have asked the same question in ASP.NET Forum.
|
|
|
|
|
Hi all,
I have created a windows application,in that 1 MDI parent and 2 child forms are there....i have opend 2 child forms,now if i add anything in the first window textbox that should get updates in the second window's dropdown,bcz the value which i entered in the first window is get stored in the database,and the second window dropdown is populating form that table...
This is not happening...how to do?...
(2 windows are of child of the same parent window..)
Thanks in advance...
|
|
|
|
|
The simplest way is to create a method in form2 that refreshes the dropdown and call this method from form1 when text is entered in the text box. But and ideal solution would involve using delegates to achieve loose coupling.
Hope this helps,
Shameel
|
|
|
|
|
Ok, I first want to say that I am VERY new to visual studio 2008. So, this may be an easy question to answer for many of you. I have created 10 forms and what I noticed is that 7 of the forms have the same controls. The other 3 forms have have the controls as well but 3 addition controls have been added to the form. My question is 2 fold. One, how do I copy or clone one of these forms including the code to another new form. I have tried a few things in the past but the controls do not stay in the same location so I am sure I have yet to find the right way to do it. The second question would be what way would you handle this situation. Let's say you have your form and that form has 4 controls. You need another form that has all the same controls and properties as the previous form but with an additional 2 controls. Is the parent/child method the only way to do this and if so what limitations with classes and objects. Considering, I am a begginer any help would be appreciated.
Thanks
|
|
|
|