|
I Want Last Version OutlockBarApp Simular Visual Studio.Net 2005
Thank you
Send (Dll File) ...
|
|
|
|
|
im actually trying to make a player that can stream audio over the network in real time using Microsoft DirectX particularly direct sound.can anyone help me out with this problem please..im a newbie when it comes to audio programming..please i really need help as soon as possible...
mei
|
|
|
|
|
//eraser is gif file from resources
Bitmap bmp = new Bitmap(global::InkRecognition.Properties.Resources.eraser);
bmp.SetResolution(128f,128);
System.Windows.Forms.Cursor cursor = new System.Windows.Forms.Cursor(bmp.GetHicon());
this.Cursor = cursor;
somehow SetResolution just don't work. anyone help please
thanks
|
|
|
|
|
What do you expect it to do ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi,
I have a WinForm that needs to run only if a registry entry exists. If not, I want the application to immediately exit.
I don't believe you can call Application.Exit until after initialization of the form is complete.
Is there a workaround or better solution to achieve my needs?
Glen Harvy
|
|
|
|
|
Why not do it in Form's Constructor.... It's run b4 Initialization. You can call dispose from there.
Or even better you can use a static constructor try to set a static boolean variable and check it's value b4 instantiating...
Any Static Construct is the first thing which is run After class loading.
|
|
|
|
|
Syed Muhammad Kamran wrote: Or even better you can use a static constructor try to set a static boolean variable and check it's value b4 instantiating...
Any Static Construct is the first thing which is run After class loading.
Thanks for your assistance ... I have a rough idea of what you suggest but would appreciate your elaborating a bit.
This is what I have now:
<br />
<br />
namespace blahblah<br />
{<br />
public partial class MainForm : Form<br />
{<br />
public MainForm()<br />
{<br />
bool startupCheckValue = true;<br />
startupCheckValue = startupCheck();<br />
if (!startupCheckValue)<br />
{<br />
Dispose();<br />
this.Close();<br />
Application.Exit();
}<br />
etc etc etc<br />
<br />
private bool startupCheck()<br />
{<br />
[code works fine]<br />
}<br />
<br />
<br />
How do I go about implementing what you suggest.
Thanks in advance.
Glen Harvy
|
|
|
|
|
namespace blahblah
{
public partial class MainForm : Form
{
static bool startUpCheckValue = false;
static MainForm (){
startupCheckValue = StartupCheck();
}
public MainForm()
{
if (!startupCheckValue)
{
Dispose();
this.Close();
Application.Exit(); // exitProgram();
}
etc etc etc
private static bool startupCheck()
{
// make sure database file exists
//
[code works fine]
}
|
|
|
|
|
Thanks for that - I have since done some research and certainly understand constructors and specifically static constructors and methods a little better Frankly, I agree your suggestion should work - at least in theory.
Unfortunately I still can't get the program to exit. I made the changes you suggested without success and then as an extreme test changed it to the following:
<br />
public partial class MainForm : Form<br />
{<br />
static MainForm()<br />
{<br />
Application.Exit();<br />
}<br />
public MainForm()<br />
{<br />
<br />
[etc etc]<br />
I'll keep delving into this and welcome any other suggestions.
Glen Harvy
|
|
|
|
|
Application.Exit will nit work inside the constructor, because Application.Run wasn't executed yet. If you look at the static Main method of your application it looks similar to this:
static void Main()
{
Applivation.Run(new MainForm());
}
So what happens, is that an instance of the MainForm class is created (calling your constructor) and afterwards passed to the Application.Run method. That's why Application.Exit does not work inside the constructor.
It would probably be the best to assign the instance of MainForm to a variable and only call Application.Run, if your MainForm could be properly initialized:
static void Main()
{
MainForm form = new MainForm();
if (something)
{
Applivation.Run(form);
}
else
{
Show some kind of error message
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks very much - I've learn't heaps tonight.
Glen Harvy
|
|
|
|
|
My pleasure
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
i want to make my event in win form
using c#.i have created it but
the problem is that the event is not firing.
so i need your help.
i created these events by taking help of
vb.net program.
ashu
|
|
|
|
|
What event? and give us some code
|
|
|
|
|
What do you mean by not Firing... It's not meant to fire auto... You are required to do it explicitly.
|
|
|
|
|
You need to explain what you mean by 'not firing', and you need to explain how your code is working between VB and C#, probably by posting some code.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi! I am new to C# programming and have run into a roadblock. I don't know how to get it to count the number of months needed to pay off the loan. Here is what I have so far:
//declare variables
double loanAmount;
double interestRate;
double monthlyPayment;
double balance;
double monthlyPrincipalPayment;
int monthCounter;
double totalInterestPaid;
//initialize variables
loanAmount = 0;
interestRate = 0;
monthlyPayment = 0;
balance = 0;
monthlyPrincipalPayment = 0;
monthCounter = 0;
totalInterestPaid = 0;
//input statements
Console.WriteLine("Enter loan amount: ", loanAmount);
loanAmount = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter monthly interest rate in decimal format: ", interestRate);
interestRate = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter monthly payment: ", monthlyPayment);
monthlyPayment = Convert.ToDouble(Console.ReadLine());
//calculate monthly principal payment
monthlyPrincipalPayment = balance - (interestRate * loanAmount);
//calculate the total interest paid
totalInterestPaid = totalInterestPaid + (loanAmount * interestRate);
//calculate the total number of months to pay off interest
//while loop
while (balance > 0)
{
//count the number of months
monthCounter++;
//calculate balance each month
balance = balance - monthlyPayment;
}
//display the total interest paid
Console.WriteLine("You paid $ " + totalInterestPaid + " in interest");
//display the total number of months it took to pay loan
Console.WriteLine("It took " + monthCounter + " months to pay off your loan.");
|
|
|
|
|
Hi,
Your logic is flawed? You cannot calculate the interest on the whole of the loan unless you know how long they want the loan for. Therefor your program, as it is written, will go into an infinite logical loop as the balance will never be paid.
You will need to decide when you are going to calculate and charge interest. It seems the following is what you are suggesting:
Initial Loan $10,000 (for example)
Interest rate is fixed.
Interest is charged on daily outstanding balance and is included in the fixed repayment offered.
Repayments will be fixed each month (be careful here as you will create another infinite loop if the payment is insufficient to cover principal and interest).
psuedocode is:
While (BalanceOutstanding > 0)
{
count++; // whatever your counter is
BalanceOutstanding = (BalanceOutstanding * Rate / 12) - Payment; // psuedocode
}
You would be better of not using a While statement to calculate the months - use maths (used to be called algebra when I went to school ). Google for the appropriate formulae.
Cheers,
Glen Harvy
|
|
|
|
|
The problem is I am supposed to use the while loop to decrease the loan amount until it gets to 0. Thanks for your help.
Fatimah
|
|
|
|
|
I'm making a program that has a simple link-checker in it, and it makes Google and ASP.net sitemaps as well. I want it to be able to crawl a site on the web. Right now it works against local copies of a web site, and does very nicely finding broken links and making sitemaps. You can find a beta here:
http://www.smoothjazzy.com/jazzy_sitemap.html[^]
Anyway, I'm having a problem when I make requests for HTTP locations. If the file is local, I just check for it on the hard drive, but if it's an absolute URL, then I do this:
<br />
WebClient browser = new WebClient();<br />
UTF8Encoding enc = new UTF8Encoding();<br />
try {<br />
string fileContents = enc.GetString(browser.DownloadData(test_url));<br />
c_url.found = true;<br />
} catch (Exception exc) {<br />
current_report_builder.Append("***** Broken Link<br />
....etc....<br />
When I do this it executes server-side codes just fine of course, but sometimes there are javascripts on pages, such as my site above, which generate links. I want to be able to scan those links as well. Right now they show up as broken links because they are generated by javascript document.write commands.
Does anyone know how I can ammend this code to run client-side javascripts so I can see the "final rendering" of the page? I thought of possibly doing it with an invisible browser control, but I'd rather not...
I have searched Google and these forums and a few dark corners I know about, but nobody seems to know anything about this... If you can find it somewhere, please tell me what search terms you used, cuz I'm getting shlock
|
|
|
|
|
Hi,
I am considering various obfuscators and protection systems and am considering .Net Reactor in view of it's performance and price.
If anyone has any recommendations/comments, I would appreciate the feedback.
Thanks.
Glen Harvy
|
|
|
|
|
Hi,
I am just trying to adapt the Extended Common Dialog Box
http://msdn2.microsoft.com/en-us/library/ms996463.aspx
to my needs. Now I have got two problems left:
1. I want this dialog ("GetOpenFileName" from ComDlg32.dll) to appear modal with my Windows-Forms application. It is dangerous that the user can open as many of these dialogs as he wants because the "Open File"-Button of the calling Form is always enabled... I am not very experiences in using Win32-dlls and I have no idea how to approach this problem.
2. If you are a bit familiar with the above msdn-example perhaps you can help me also with this: I changed the dialog to a multi-file-select dialog (adding the AllowMultiSelect-flag). As expected the dialog can only return a few files (as string like e.g.: 'C:\Programs\"test1.txt" "test2.txt"') as const int _MAX_PATH is by default set to only 270. So I changed it to 32768 bytes which is the maximum allowed value as I have learned. But when I now select more files in this dialog it returns nothing!???
Thanks in advance for any idea,
Alex
|
|
|
|
|
AlexZieg71 wrote: So I changed it to 32768 bytes which is the maximum allowed value as I have learned
That looks like the maximum allowed value for a signed short ( at a guess). MAX_PATH is set to the right value for a maximum path.
There are solutions on the web to extending an open file dialog in C#, I'd suggest finding one of those.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi Christian,
I only found the solution that I am just working with and the "OpenFileDialogEx" on the CodeProject-pages. The problem with OpenFileDialogEx is that it only works for .NET 2.0 but I work with .NET 1.1.
Do you know another solution? Your answer makes me think that my 2 described problems are barely to solve.
Best Regards
Alex
|
|
|
|
|
OK, I found out the solution for my Problem #1 myself:
In the GetOpenFileName-Struct you can also define the owner of the form as an IntPtr. Assign the Handle of the "Owner-Form" to it and it´s done:
_ofn.hwndOwner = owner.Handle;
|
|
|
|