|
Look in the Application event log and check for any errors in there.
|
|
|
|
|
|
You mean that I can't create applications with VS Community 2015 that work on Windows XP?
|
|
|
|
|
No, just that Microsoft might not be actively trying to stay compatible.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
But I created an installation with InstallShield Limited Edition for the same project, and it worked perfectly..
|
|
|
|
|
Some VB6-applications also still work perfectly
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hi. I have created an WindowsFormsApplication with multiple forms, and in a form I added an ShockwaveFlashObject and i set it a .swf file. The problem is that when I access two or three forms and come back to this form, it shows me this error message:
An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module.
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
I don't really know how to fix this, I just managed to find out that this is the problem.
The ShockwaveFlashObjects was added to toolbox from COM Components.
|
|
|
|
|
DPaul1994 wrote: I don't really know how to fix this Unfortunately it is not easy. You will have to do some, or even a lot of, debugging in order to discover where in the application the access violation occurs. The most likely cause is passing a bad reference to some library method, but you would need a detailed stack trace to start investigating.
|
|
|
|
|
I don't really know how to make such a deep debugging, because it doesn't show me the line where the error occurs, it just shows me that message when I close the application and that's it..If I remove ShockwaveFlashObjects and AxShockwaveFlashObjects from reference and the item from form, it works perfectly, so that is the issue
modified 22-Aug-15 6:15am.
|
|
|
|
|
Like I said: it's not easy. There is no way that anyone can guess the answer for you. You will have to add some code to your application to get more information about what is going on, until you can narrow it down to the general area where the problem occurs. That is when you can start tracing through with your debugger.
|
|
|
|
|
I see. Well, thank you for your time and all the informations. I'll try to fix it
|
|
|
|
|
I managed to fix the issue. The problem was that that flash object remains active when you open another form and it must be stopped or disposed. This is the solution, if anybody will get this error in this situation.
modified 22-Aug-15 18:24pm.
|
|
|
|
|
By sticking a static CollectionChanged EventHandler in an ObservableCollection<T> ... well, it works. Every new Node created gets its internal Nodes collection hooked-up to the Event.
But, I have, as is so often said in CP Q&A: "a doubt." Is this okay, or am I violating something or other ?
using System.Collections.Generic;
using System.Collections.ObjectModel;
public class Nodes<T> : ObservableCollection<Node<T>>
{
public Nodes()
{
this.CollectionChanged += Nodes_CollectionChanged;
}
public static void Nodes_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
string txt = (e.NewItems[0] as Node<T>).Text;
Console.WriteLine("{0} {1} {2} {3}", e.Action.ToString(), txt, e.OldStartingIndex.ToString(), e.NewStartingIndex.ToString());
}
public void Add(string text)
{
Node<T> newNode = new Node<T>(text);
base.Add(newNode);
}
public void Add(T value, string text)
{
Node<T> newNode = new Node<T>(text) {Value = value};
base.Add(newNode);
}
}
public class Node<T>
{
public T Value { set; get; }
public string Text { set; get; }
public Nodes<T> Nodes { set; get; }
public Node(string text = "")
{
Text = text;
Nodes = new Nodes<T>();
}
public Node(T value, string text = "")
{
Value = value;
Text = text;
Nodes = new Nodes<T>();
}
}
private void TestNotification_Click(object sender, EventArgs e)
{
Nodes<string> TestNodes = new Nodes<string>();
TestNodes.Add("root");
TestNodes[0].Nodes.Add("child 1");
TestNodes[0].Nodes[0].Add("child1 of child1");
}
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.
|
|
|
|
|
BillWoodruff wrote: Is this okay, or am I violating something or other ? If it compiles, ship it.
If you want me to pick nits..
public void Add(string text)
{
Add(null, text);
}
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Your code will have an error stating that T cannot be null as it doesn't have a class constraint.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
|
Hi Brisingr,
Correct you are. But, Eddy's pointing to the fact the code could be "cleaner" if re-factored is spot-on, and, the remedy is simple:
public void Add(string text)
{
Add(default(T), text);
}
if (default(T) != null)
{
throw new InvalidOperationException("requires T to be a nullable type.");
}
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.
|
|
|
|
|
Thanks, Eddy, the nits you pick are always tasty, and, once the flesh is eaten, the pit is swallowed whole
cheers, Bill
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.
|
|
|
|
|
Thanks
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
int checker;
private void btnHideTextBox_Click((object sender, EventArgs e)
{
if (checker%2 == 0)
myTextBox.Enabled = false;
else
myTextBox.Enabled = true;
checker++;
}
===================
Why is it I could only use 2 input? Please reply asap sir. Can you make me a sample that could allow many inputs like 9 inputs? Thanks! 
|
|
|
|
|
Andrei Ang wrote: Why is it I could only use 2 input
Because you specify 2 in the test:
if (checker%2 == 0) If you change the value there, you will change the number of presses.
But I'd do it like this:
private void btnHideTextBox_Click((object sender, EventArgs e)
{
myTextBox.Enabled = !(checker++ % 2 == 0);
}
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
What if I have 2 textboxes sir? And I want them to be disabled if I have a 9 input not only 2.
|
|
|
|
|
Well you know how to do the nine now, don't you?
So just extend it to two textboxes:
private void btnHideTextBox_Click((object sender, EventArgs e)
{
bool enable = !(checker++ % 9 == 0);
myTextBox1.Enabled = enable;
myTextBox2.Enabled = enable;
}
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
What if for example I have 3 textbox,
txtbox1, I input 3 then click "okay"
then I want the 2 textbox should input only 3 products nor it depends on the number I've input in my txtbox1.
|
|
|
|