• 0

My 12 Weeks for C# & .NET Project! Guide me please


Question

My 12 Weeks for C# & .NET Project! Guide me please?

Im a 3rd year student at Nanyang Polytechnic in Singapore.

Now i was given 12 weeks to finished a project, using C# and Visual Studio 2005 (And Later DirectX - DirectShow, for audio and video processing)

My project now is to:

1st Objective - develop/build a software that can capture video live from webcam and playback audio from an audio file

after im able to do this

i need to

To be frank, i never learn C# and dont know what the heck is .NET, so i need you guys help.

I will be available from 8.30am to 6pm from Mon to Friday.

i really need ya help... in guiding me, please.

today i will go library to lend a book about C# and Visual Studio.

i know about this websites http://www.codeproject.com, is there anywhere relevant that i can read on.

omgd, this project is sooooo hard! i never do programmign before except knowing some basic languages of Java, C++ and C Programming. And whats more, im no good at all at programming.

Help. Thank alot!

if you interested in my ym or msn, please PM me.

13 answers to this question

Recommended Posts

  • 0

I suggest you go to lectures, learn what you were taught to learn and code it off your own back. I had to learn C# for a work project, and had considerably less than 12 weeks!

Part of your course is learning this yourself - NOT asking others to do your homework.

Edited by njlouch
  • 0

hey there. don't worry. i am sure you will be fine. i had to learn c# in about 2 days, its not too bad. here are some useful links that a colleague sent to me:

> Introduction to the .NET framework

> http://msdn.microsoft.com/netframework/get...ed/default.aspx

>

> Overview of .NET Framework Classes

> http://www.informit.com/articles/article.a...edir=1&rl=1

>

> C# Tutorial

> http://www.softsteel.co.uk/tutorials/cSharp/cIndex.html

>

> Windows forms samples and demos

> http://blogs.msdn.com/jfoscoding/archive/2.../11/491701.aspx

  • 0
  konstantinos said:

hey there. don't worry. i am sure you will be fine. i had to learn c# in about 2 days, its not too bad. here are some useful links that a colleague sent to me:

> Introduction to the .NET framework

> http://msdn.microsoft.com/netframework/get...ed/default.aspx

>

> Overview of .NET Framework Classes

> http://www.informit.com/articles/article.a...edir=1&rl=1

>

> C# Tutorial

> http://www.softsteel.co.uk/tutorials/cSharp/cIndex.html

>

> Windows forms samples and demos

> http://blogs.msdn.com/jfoscoding/archive/2.../11/491701.aspx

oh, thanks thanks thanks alot.

i really appreciate that, the link are very usefull! thank you!

anything problems i will ask here again...

  • 0
  sLapshock said:

hi can anyone teach me the steps to open a source code from codeproject using visual studio?

The source you find on codeproject should be zipped up (.zip). Windows already can open zip files or you can use 7zip,winrar, etc... unzip the files anywhere and you should see a folder, .sln file, or a csproj file, double click the .sln or csproj to open it up in VS2005.

  • 0

I got this problem, hope someone can point me...

New Form1.cs

  Quote

using System;

using System.Windows.Forms;

using QuartzTypeLib;

namespace MovieShow

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

// Define constants used for specifying the window style.

private const int WS_CHILD = 0x40000000;

private const int WS_CLIPCHILDREN = 0x2000000;

// Hold a form-level reference to the media control interface,

// so the code can control playback of the currently loaded

// movie.

private IMediaControl mc = null;

// Hold a form-level reference to the video window in case it

// needs to be resized.

private IVideoWindow videoWindow = null;

private void button1_Click(object sender, EventArgs e)

{

// Allow the user to choose a file.

OpenFileDialog openFileDialog = new OpenFileDialog();

openFileDialog.Filter =

"Media Files|*.mpg;*.avi;*.wma;*.mov;*.wav;*.mp2;*.mp3|" +

"All Files|*.*";

if (openFileDialog.ShowDialog() == DialogResult.OK)

{

// Stop the playback for the current movie, if it exists.

//if (mc != null) mc.Stop();

// Load the movie file.

FilgraphManager graphManager = new FilgraphManager();

graphManager.RenderFile(openFileDialog.FileName);

// Attach the view to a picture box on the form.

try

{

videoWindow = (IVideoWindow)graphManager;

videoWindow.Owner = (int)pictureBox1.Handle;

videoWindow.WindowStyle = WS_CHILD | WS_CLIPCHILDREN;

videoWindow.SetWindowPosition(

pictureBox1.ClientRectangle.Left,

pictureBox1.ClientRectangle.Top,

pictureBox1.ClientRectangle.Width,

pictureBox1.ClientRectangle.Height);

}

catch

{

// An error can occur if the file does not have a video

// source (for example, an MP3 file.)

// You can ignore this error and still allow playback to

// continue (without any visualization).

}

// Start the playback (asynchronously).

mc = (IMediaControl)graphManager;

mc.Run();

}

}

private void pictureBox1_Click(object sender, EventArgs e)

{

if (videoWindow != null)

{

try

{

videoWindow.SetWindowPosition(

pictureBox1.ClientRectangle.Left,

pictureBox1.ClientRectangle.Top,

pictureBox1.ClientRectangle.Width,

pictureBox1.ClientRectangle.Height);

}

catch

{

// Ignore the exception thrown when resizing the form

// when the file does not have a video source.

}

}

}

//Button to exit an application

private void button2_Click(object sender, EventArgs e)

{

Application.Exit();

}

//Button to play a video file

private void button4_Click(object sender, EventArgs e)

{

if (mc != null) mc.Run();

}

//Button to pause a video file

private void button15_Click(object sender, EventArgs e)

{

}

//Button to stop a video file

private void button3_Click(object sender, EventArgs e)

{

if (mc != null) mc.Stop();

}

//Button for user to choose an audio file

private void button5_Click(object sender, EventArgs e)

{

// Allow the user to choose a file.

OpenFileDialog openFileDialog = new OpenFileDialog();

openFileDialog.Filter = "Media Files|*.wav;*.mp3;*.mp2;*.wma|All Files|*.*";

if (openFileDialog.ShowDialog() == DialogResult.OK)

{

// Access the IMediaControl interface.

QuartzTypeLib.FilgraphManager graphManager =

new QuartzTypeLib.FilgraphManager();

QuartzTypeLib.IMediaControl mc =

(QuartzTypeLib.IMediaControl)graphManager;

// Specify the file.

mc.RenderFile(openFileDialog.FileName);

// Start playing the audio asynchronously.

mc.Run();

}

}

//Label at the top most of the program

private void label1_Click(object sender, EventArgs e)

{

MessageBox.Show("Audiograted Therapy (AIT) Device for Authistic");

}

//To start capturing from webcam

private void button6_Click(object sender, EventArgs e)

{

}

//Button to pause capturing from webcam

private void button12_Click(object sender, EventArgs e)

{

}

//Button to stop capturing from webcam

private void button13_Click(object sender, EventArgs e)

{

}

//Button to save capturing from webcam

private void button14_Click(object sender, EventArgs e)

{

}

//Button to webcam setting

private void button7_Click(object sender, EventArgs e)

{

}

}

}

When i tried to play an audio file, it coems out this error while pointing to

  Quote

mc.RenderFile(openFileDialog.FileName);

  Quote

System.Runtime.InteropServices.COMException was unhandled

Message="Exception from HRESULT: 0x80040256"

Source="Interop.QuartzTypeLib"

ErrorCode=-2147220906

StackTrace:

at QuartzTypeLib.FilgraphManagerClass.RenderFile(String strFilename)

at MovieShow.Form1.button5_Click(Object sender, EventArgs e) in C:\Documents and Settings\Student\My Documents\Mohammed Rizal\Projects\MovieShow\MovieShow\Form1.cs:line 131

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.Run(Form mainForm)

at MovieShow.Program.Main() in C:\Documents and Settings\Student\My Documents\Mohammed Rizal\Projects\MovieShow\MovieShow\Program.cs:line 17

at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

  • 0
  sLapshock said:

I got this problem, hope someone can point me...

New Form1.cs

When i tried to play an audio file, it coems out this error while pointing to

I got the same error but then i notice that i didnt have the mp3 coded installed. After i install it the program worked. Were you trying to play an mp3 file?

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.