|
You're welcome. Good luck with progressing with coding - it does get easier, honestly.
|
|
|
|
|
Perhaps, if you tried looking at them yourself, and working out what they are doing it would be more obvious what they should be doing.
Then you wouldn't have wasted 18 hours on your homework, you would have spent thirty minutes or less and finished it...
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
Hi,
I have a C#/.Net User Control that is a viewer for particular file type.
Now i want to convert it to an ActiveX control for the internet explorer which gets loaded when we open that file type with internet explorer and the file gets opened within the control.
It is the similar feature like Adobe PDF Viewer ActiveX control. When we drag n drop a pdf file over the internet explorer, the pdf reader control is loaded and file is opened in that control.
Please help me with this.
-- modified 4-Mar-13 0:11am.
|
|
|
|
|
NevilPrajapati wrote: Please help me with this
Help with what? You did not say anything about any kind of a problem.
|
|
|
|
|
Hi,
I have described my full problem in the question. But if you are not able to see it in any way then here it is:
I have a C#/.Net User Control that is a viewer for particular file type.
Now i want to convert it to an ActiveX control for the internet explorer which gets loaded when we open that file type with internet explorer and the file gets opened within the control.
It is the similar feature like Adobe PDF Reader ActiveX control. When we drag n drop a pdf file over the internet explorer, the pdf reader control is loaded and file is opened in that control.
|
|
|
|
|
|
NevilPrajapati wrote: I have described my full problem in the question
No you did not. You just described what it is that you want to do. What you did not do is describe a problem. "i want" is not a question nor is it a description of a problem.
|
|
|
|
|
Option 1: Rewrite your .NET User Control as an ActiveX Control (requires VC++ or VB6)
Option 2 (recommended): Create a COM Callable Wrapper for your .NET Control. Read this[^] for more information. (Still needs .NET Framework to be installed in the target machine)
|
|
|
|
|
sir, I'm doing my college project in windows8 i.e speech2text.
so I want to add a calculator ,notepad or wordpad in my application.
I want detail idea how I use calculator,notepad or wordpad with my voice.
Thank's in advance.
|
|
|
|
|
Did you read "How to get an answer to your question" just above?
Take particular note of #2 and #11.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
|
Hi,
Have a look at my article about Speech Recognition, Speech to Text and Text to Speech:
Speech recognition in C#[^]
The quick red ProgramFOX jumps right over the Lazy<Dog> .
|
|
|
|
|
1. Create a new VS windows form application.
2. Add a button to it.
3. Double click the button to add the click event.
4. Add a new class to the project. Change its declaration and make it a partial class using the same name as the main form.
5. Move the button click event into the partial class.
6. Go back to the main form and double click the button so that it opens the click event in the code window.
If, like my VS (2012) you'll find it doesn't actually open the event code. In fact, like mine, you'll probably find it places the cursor where the code used to be in the main form. In other words, it doesn't jump to the code in the other source file where you created the partial class and copied the code to. It also does the same in VS2008.
If it's a bug, is there a workaround?
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
Confirmed this is the same on my machine.
I searched and found this[^] which seems to say it's not considered a bug but by design as a limitation of the Forms designer.
|
|
|
|
|
No, it's not a bug, , there is no workaround for it, and if you think about it, it does make a bit of sense.
If you double-click on a control to generate an event, the code will go into the file of the same name as the myFormName.Designer.vb file. It's the only file that it knows with 100% certainty belongs to that form.
|
|
|
|
|
Upto a point, Dave, I agree with what you write. I also look it at it the other way where it could also search through all the same partial classes to see where it might reside. But, yes, if it's a limitation by intent I can live with it.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
The workaround.
In VS solution explorer the form.designer.cs file is shown as nested within form.cs and I suspect that the partial class that you have added is not. Fixing the project file to nest the new file will also fix the problem with the event handler methods.
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Form1.Extras.cs">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.MoreStuff.cs">
<SubType>Form</SubType>
</Compile>
In this project file fragment the entries for Form1.cs , Form1.designer.cs and Form1.MoreStuff.cs are exactly as created by VS but the entry for Form1.Extras.cs has been modified to establish the correct DependentUpon relationship to Form1.cs . Event handlers within Form1.Extras.cs will now be found by VS whereas any that were moved into Form1.MoreStuff.cs will not.
Alan.
|
|
|
|
|
Thanks for that Alan. I've not tried it yet but I'll schedule some playtime to test it tomorrow sometime.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
Alan,
Many thanks. I just had the time to try it out and it worked 100% fine. Double-clicking the button does indeed jump to the partial form.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
I'm trying to create a program that displays a table of all the even numbers within a range given by the user but im having some trouble making it work. the range has to be between 1 and 120. I would also like to incorporate the tryparse method. here is what I have so far:
using System;
public class Range
{
public static void Main(string[] args)
{
int[] range;
string firstNumber;
Console.Write("What is the initial number of the range: ");
firstNumber = Console.ReadLine();
Console.Write("What is the last number of the range: ");
string lastNumber;
lastNumber = Console.ReadLine();
int totalNumber;
int firstNum = Convert.ToInt32(firstNumber);
int lastNum = Convert.ToInt32(lastNumber);
if (firstNum < 1)
{
Console.WriteLine("Error: the firstNumber can't be less than 1.");
}
else if (lastNum > 120)
{
Console.WriteLine("Error: the lastNumber can't be higher than 120.");
}
else if (firstNum >= lastNum)
{
Console.WriteLine("Error: the first number can't be higher than the last number.");
}
totalNumber = lastNum - firstNum;
range = new int[totalNumber + 1];
int tally = 0;
for (int i = 0; i < totalNumber; i++)
{
range[i] = i + 1;
if (range[i] % 2 == 0)
{
Console.Write(range[i] + " ");
}
tally++;
if (tally > 10)
{
Console.WriteLine();
tally = 0;
}
}
Console.Write("\nPress any key to exit program: ");
Console.ReadKey();
}
}
|
|
|
|
|
You made an array "range" but didn't initialize its contents. It will only contain zero.
That array isn't necessary in the first place, you could just iterate over the range directly:
for (int number = firstNum; number <= lastNum; number++)
{
if (number % 2 == 0)
; print it or whatever
}
And you don't actually need that test to see if it's even, either, because you can make sure to only ever generate the even numbers:
for (int number = firstNum + (firstNum & 1); number <= lastNum; number += 2)
{
}
Of course this part: firstNum + (firstNum & 1) is something slightly special, it's rounding up to the next multiple of 2.
firstNum & 1 takes the lowest bit, which will be 1 if odd and 0 if even. Adding that back to the original number will not change it when it's even, but make it one higher if it's odd.
|
|
|
|
|
I have the following statement in a C# 2008 windows application that was converted to a console application:
finally
{
Console.ReadLine();
Environment.Exit(1);
}
<pre>
The error message that is displayed says there is not enough io memory.
Can tell show me in code and/or point me to a reference that will show me how to solve this problem?
|
|
|
|
|
Quote: The error message that is displayed says there is not enough io memory
The code you pasted here has no relation to the error message. It might be other part of your code creating this error. debug your application and run line by line and see on executing which method this error popsup.
also copy the complete exception stack here so that we can able to tell something from that.
|
|
|
|
|
Change the exit code: 0 indicates success, any other number is an error code. Exactly how the error code is interpreted depends on the environment the application is run under - I suspect that your app returning "1" is being interpreted as an I/O error.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
The program that is executed is called by a C# 2010 windows application (called app1) that was converted from a console application.
The following is an example of some of the calls made from app1 to the C# 2008 application that is having the memory problem called app2.
string[] SubPkgIDs = rData.details.Where(c => c.Package_ID.StartsWith("SUB").Select(c => c.PackID).Distinct().ToArray();
foreach (string SubPkgID in SubPkgIDs)
{
{
Process eProcess = new Process();
String Process_Arguments = null;
eProcess.StartInfo.UseShellExecute = false;
e_Process.StartInfo.FileName = "app2.exe";
Process_Arguments = " 3 " + SubPkgID;
eProcess.StartInfo.Arguments = Process_Arguments;
eProcess.Start();
eProcess.WaitForExit(1800);
eProcess.Dispose();
Process_Arguments = null;
}
}
I think the line of code that is causing the memory problem possibly is the following:
eProcess.WaitForExit(1800);
App1 is not waiting for a response basically from app2.exe program that is being called. It waits the 1800 *.secs and makes
the next calls. There is no reason for app1 to wait or app2 to finish executing since it does not need a response from app2.
However if this is causing the memory problem I can wait for the app2 program to finish executing.
App1 and app2 were setup to be single threaded.
In the app1 program that calls the second program called app2, I am thinking of putting the following code at the end of the program:
foreach (Process proc in Process.GetProcessesByName("app2"))
{
proc.Kill();
}
This way the app2 processes that are still in memory can be released.
Thus based upon what I mentioned previously and what I just mentioned above, can you show me code and/or tell me what you would do to solve the memory problem I am having?
|
|
|
|