|
Just to clarify: I do mean detecting Microsofts Remote Assistance feature.
Your suggestion does work for XP as the process rdsaddin.exe appears when RA is active. It doesn't work on Vista (and I suppose Windows 7) though as no extra processes are created on Vista when an RA connection is set up...
|
|
|
|
|
Hi, I have got a strange problem when using a AxHost wrapped activex control.
We normally access this control from multiple c# threads, and have never had a problem with this until now. But after adding a manifest file to the .exe in order to enable reg-free COM (so we don't have to register the activeX control on customer machines), the control will now crash when accessed from any background thread as long as it is not registered on the current machine. If it is registered then it can be used from multiple threads just fine.
Any help would be appreciated as this is a very strange problem, perhaps I am missing something from the manifest file?
The manifest file contains a "file" entry which points to the relevent .ocx file, with a "comClass" subitem, with "clsid" set as required and "threadingModel" set to "Apartment" (changing the threading model doesn't seem to have any affect on this behaviour).
For example:
public Form1()
{
InitializeComponent();
control = new AxLib.AxControl();
control.Dock = DockStyle.Fill;
this.Controls.Add(control);
control.CreateControl();
}
private void Form1_Load(object sender, EventArgs e)
{
control.DoSomething();
myThread = new Thread(myThread_ThreadStart);
myThread.Start();
}
void myThread_ThreadStart(object arg)
{
control.DoSomething();
}
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:21am.
|
|
|
|
|
This doesn't seem to apply to methods called from the actual activeX (COM) object - we make calls on the activeX object all over the place on background threads.
Its only if the control is unregistered (so loading locally through the manifest) that we encounter problems.
|
|
|
|
|
Hi all
I am trying to create a form with some simple text animation (like scrolling, fade-in etc.).
One of the requirements is to make the code time independent. meaning, no matter if the machine the application will run on is slow or quick, the animation should take exactly the same time. if needed - it should "jump" over frames.
If i understand correctly, using Timer is not the answer, right?
I am a real begginer in C# and .NET so please be easy with me
|
|
|
|
|
How many frames per second does your animation have?
edit: that is relevant, because if you have say 15 frames be second, just using a timer (without correcting for the actual time) is fine.
|
|
|
|
|
Usually, you'd draw the first frame, get the current time in milliseconds, then when your drawing code is called again, get the new time and get the difference between the previous run and this one. That's the time increment you use to calculate your new drawing points of your animation. The current time is now going to be your previous time for the next drawing iteration.
|
|
|
|
|
Wouldn't that make the animation time dependent
|
|
|
|
|
animation = motion = time-dependent by definition, whatever your approach. Dave's one is fine.
The OP's wording was a bit weird, I know you've got used to that by now.
|
|
|
|
|
Should be time-dependent by definition but it was not always the case. 80's and early 90's computer games are good examples of this, they were clock-cycle dependent because the processors of the time were never fast enough. I was not criticism any of the suggestions merely pointing out what should have been obvious.
|
|
|
|
|
He's using the terms incorrectly. What he wants is CPU performance independance. Since the animation must be able to render properly, and on schedule (at a certain pace in his description), there is always going to be a time dependancy.
|
|
|
|
|
Hi everyone,
I'm making an application that will be translated to a ton of languages, and the thing is that it has a main project and 5 more that provide funcionality. Until here everything is fine, but a lot of texts are repeated on the different projects.
To solve this I thought of creating a project only for storing .resx files and expose them to the rest of the solution, this way I don't need to repeat the text for every solution. My problem is that by default visual studio creates a class that has an 'internal' modifier and wouldn't let me see it from different projects. Is there any way I can switch the modifier to public for the class that gives me access to the localization files or any simple work around??
Thanks a lot in advance.
|
|
|
|
|
In Visual Studio, when you open resx file, on top you have buttons "Strings", "Add Resource"... and on the right there should be a drop down with label "Access modifier". Do I have to explain more?
|
|
|
|
|
Thanks for the quick reply! But this seems to be a VS2008 feature (that or then I really need to get my glasses fixed), my bad for not specifying my Visual Studio version
Anyhow I got myself a way to do this: http://blogs.msdn.com/b/lifenglu/archive/2006/03/16/553348.aspx,
I post it just in case someone happens to find the same issue.
Thank you very much anyhow.
|
|
|
|
|
How can the exception details in Visual studio be copied as a string?
Can smebody help me with the code?
Thanks in advance.
|
|
|
|
|
you can copy details of the exception in the catch block to a string.
string expMessage = string.Empty;
try
{
uint[] a = new uint[] { 1, 2, 3 };
uint b = a[4];
}
catch (System.IndexOutOfRangeException exp)
{
expMessage = exp.Message
}
Kindly elaborate if I have misunderstood the question.
--Rags
|
|
|
|
|
how can I retrieve the copyright information which I entered in the Assembly Information in the project properties?
|
|
|
|
|
See here.
Life is a stage and we are all actors!
|
|
|
|
|
public string AssemblyCopyright {
get {
object[] attributes = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0) return "";
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
|
|
|
|
|
I am using the EventLog in my C# application and I want to know how can I increase the size and at the same time if the it reaches the max size then overwrite the older entries?
one more question? does the user has to be windows administrator in order to do the above? because it will be a problem if it's a standard user!
|
|
|
|
|
As to the second question: it depends. But in Windows Vista and 7 only applications with elevated permission can access event log. Windows XP and below don't have this restriction.
|
|
|
|
|
And for the first part of your question - you can use the MaximumKilobytes[^] property in order to increase the size of the eventlog. Read the documentation carefully and see which values will be valid.
If the log reaches the maximum size than the behavior depends on the value of OverflowAction[^] property. By default the value of this property is OverwriteOlder. If you want to change the overflow action you can use ModifyOverflowPolicy[^].
And finally for clearing the eventlog see the documentation[^] again.
|
|
|
|
|
First of all: You have to be an administrator to change the eventlog settings. So that wil be a problem.
Second: I think it is bad practice if your program changes the settings of the applicationlog. These are sytem settings. They should only be changed by admininistrators. And they should already know how to do that.
Wout Louwers
|
|
|
|
|
no but what if the eventlog was full when the standard user us logged on? so it will throw an error because he's not allowed to change? right? that's my problem and question? where and when should I set the size? can I do that at the time of installation in the eventcreate command?
|
|
|
|
|
If the eventlog is full, you should catch that exception and display a messagebox telling the user why writing to the eventlog has failed. The user could login as an admin to look at the eventlog setting, or he could call the helpdesk.
Wout Louwers
|
|
|
|