|
You msut perform performance benchmarks and determine if the results are adequate for your needs. Most often managed code requires more memory but requires about the same number of CPU cycles as unmanaged code - though not always (this depends on a number of factors, especially demanding CAS permissions that cause a stack walk).
If you look at the bottom of all the class documentation, the system requirements are specified.
Since the .NET BCL defines the MSMQ client code, it does not require MSMQ to be installed (which is supported on Win2K and newer). The "Platforms" section under "Requirements" states that Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family is supported.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
I was reading the MCE SDK 2005, there is an example of MediaState, I’ve compiled it to test it on my MCE. I had to add the needed register component that i found on the SDK help file.
When i run the app, it does not get any information from the MediaCenter. What could be wrong? I think the COM object is not working properly because i cant read any information of MCE. Does anyone have a clue?
Greetings.
|
|
|
|
|
In order to diagnose and recommend solutions to your problem, you need to be more specific. What exception did you get? What was the stack trace of the exception? What was the detailed message?
If you're doing this from managed code, you need to include the interop assembly for the COM object that was generated automatically by VS.NET (or tlbimp.exe). This is usually named "Interop.Something.dll". This must be resolvable.
If you're not doing this with managed code - specifically C# - then you're in the wrong forum and need to choose the appropriate forum for your problem.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I didnt get any exception, the code gives no errors. I wrote i managed code. I read in the SDK help file that i need to register the MSASState.dll with
[regasm.exe MSASState.dll /codebase] and placed the following registry
[HKEY_CLASSES_ROOT\CLSID\{380AA9F1-5047-40D0-8BE9-18AB489CA469}
\Implemented Categories\{FCB0C2A3-9747-4c95-9d02-820AFEDEF13F}]
@="Media Status Sink"
This was needed to read mediastate information about the Media Center.
I wrote a simple code that checks if the MCE is active or not active. I have loaded the MediaState.dll in to my app.
<br />
....<br />
MediaState mediaState = new MediaState();<br />
mediaState.MediaCenter.Started += new EventHandler(OnMediaCenterStarted);<br />
mediaState.MediaCenter.VolumeChanged += new EventHandler(MediaCenter_VolumeChanged);<br />
mediaState.Connect();<br />
if (mediaState.MediaCenter.Active)<br />
{<br />
label8.Text = "Media Center is Active";<br />
}<br />
else<br />
{<br />
label8.Text = "Media Center is NOT Active";<br />
}<br />
....<br />
I'm getting that the status is NOT active. I have tried the mediastatedisplay example that came with the MCE SDk 2005 on my MCE and that also cant read any information about MCE while it is running. I have no idea what could be wrong.
|
|
|
|
|
When you use /codebase with regasm.exe the path to the assembly is registered. This means your assembly must be in the same place. If you don't use /codebase, you must add the assembly to the GAC (requires it to be strong-named, which is always a good idea anyway).
So the code above is in the assembly exposed to COM (a COM-Callable Wrapper, or CCW)? I've not seen this example but I do know a lot about COM and know that COM won't load an EXE. Since this is obviously code for a Windows Forms components (well, judging by label8 ), I know that the Media Center won't load it.
The component category that you implenented is used by the Media Center to figure out which components to load. Somewhere, then, you need to get the running instance of your component that you registered.
Have you followed the SDK sample exactly?
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
My friend
The sample code I wrote and the sample came with the SDK is not executed by MCE. It's an windowsform based app that can read status information about the MCE. My example is not integrated in to MCE, it's running beside MCE on the background. To read status information about MCE i had to register the MSASstate COM sink. This component delivers the mediastatus about the MCE. I have checked the registery after the (regasm.exe MSASState.dll /codebase) and found the following registry items.
[HKEY_CLASSES_ROOT\CLSID\{380AA9F1-5047-40D0-8BE9-18AB489CA469}]
@="MSASState.MediaStatusSink"
[HKEY_CLASSES_ROOT\CLSID\{380AA9F1-5047-40D0-8BE9-18AB489CA469}\Implemented Categories]
[HKEY_CLASSES_ROOT\CLSID\{380AA9F1-5047-40D0-8BE9-18AB489CA469}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}]
[HKEY_CLASSES_ROOT\CLSID\{380AA9F1-5047-40D0-8BE9-18AB489CA469}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="MSASState.MediaStatusSink"
"Assembly"="MSASState, Version=1.0.1740.26563, Culture=neutral, PublicKeyToken=a097a53b6b26c493"
"RuntimeVersion"="v1.0.3705"
"CodeBase"="file:///C:/WINDOWS/system32/MSASState.DLL"
[HKEY_CLASSES_ROOT\CLSID\{380AA9F1-5047-40D0-8BE9-18AB489CA469}\InprocServer32\1.0.1740.26563]
"Class"="MSASState.MediaStatusSink"
"Assembly"="MSASState, Version=1.0.1740.26563, Culture=neutral, PublicKeyToken=a097a53b6b26c493"
"RuntimeVersion"="v1.0.3705"
"CodeBase"="file:///C:/WINDOWS/system32/MSASState.DLL"
[HKEY_CLASSES_ROOT\CLSID\{380AA9F1-5047-40D0-8BE9-18AB489CA469}\ProgId]
@="MSASState.MediaStatusSink"
If i'm correct the settings are correct according the SDK.
I have three framework versions on my MCE. v1.0/v1.1/v2.0Beta i have registered with all versions the MSASState.dll and its still not working.
The problem is that the MSASState.dll does not deliver any information about the MCE. Where can i see that the MSASState.dll is running? I can't find it in the Component Services.
|
|
|
|
|
The fact that you have to register a component category (which you can do programmatically when regasm.exe is called on your assembly; read about the ComRegisterFunctionAttribute and ComUnregisterFunctionAttribute classes in the .NET Framework - which run in addition to the normal registration) means that some COM client is going to use ICatInformation::EnumClassesOfCategories (or equivalent) to get COM servers implementing supported interfaces. Your DLL is one such COM server. The MSAS is a COM server that is actually querying for this information about implementations such as your state service. BTW - you should not be installing your files into the system directory. Since your using regasm.exe you can install them anyway (but keep them there), or - better yet (recommended) sign the assembly (more secure anyway) and install it into the GAC using gacutil.exe and then use regasm.exe MSASState.dll (no /codebase, which tells the mscoree.dll shim to look in the GAC).
It's your job as the developer of this sink to communicate your data to whatever client you want. With .NET, your best approach is to use .NET Remoting.
If you haven't already, read Retrieving Media Status[^] in the SDK that explains how the MSAS loads the sinks (your assembly, acting as a COM server indirectly through the mscoree.dll shim).
And creating a Windows Forms application that references this assembly won't do any good - you need to reference the object that MSAS has loaded. This is where .NET Remoting comes in. You need to communicate this data between the AppDomain that was created for your sink and the AppDomain for your Windows Forms application (using statis will not work - each AppDomain is a separate context).
Read the .NET Remoting Overview[^]. There's also several good articles on this site about .NET Remoting, as well as a couple good books like "Microsoft .NET Remoting" from Microsoft Press[^] and "Advanced .NET Remoting" by Ingo Rammer[^].
Another way - though pretty difficult and more intensive (requires lots of marshaling) - is to register your MSAS sink with the ROT (Running Object Table) then using a moniker in your Windows Forms application to get it back out. The problems with this approach are many:- You must marshal data from unmanaged to managed to unmanaged to unmanaged to managed (that seems right) in one direction, and vice versa for the other (to call methods on the running object).
- You must P/Invoke many native functions and re-declare several COM interfaces in managed code (see
ComImportAttribute for starters) manually since several of these won't interop correctly using VS.NET or tlbimp.exe (like methods that can return S_FALSE , which is still a success code) - Your adding complexity to a design that will most likely introduce bugs
- You really end up writing a COM client and server in managed code, not taking advantage of the managed features of the CLR.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I've just read through the 1st 13 chapters of Tom Millers MDX9 book.
The examples given basicly leave you with a single looping animation from a .x file.
Are there tutorials or guides out there on how to get a better level of interaciton with the .x animation?
For example a way to play different animations on a key press or only play a certain amount of frames from the .x file?
Thanks
|
|
|
|
|
IIRC, keep reading.
There's also a couple of examples in the DX9 SDK that describe what you are looking for. You can download it (if you haven't already) from http://msdn.microsoft.com/directx[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
IIRC, keep reading.
Nope scanned ahead and 13 is the last chapter covering 3D... after that its sound, 2d graphics, user input and networking then the back cover.
I cant find an example in the SDK either that shows how to pull various animations out of a .x file any clue as to which one i should be looking at?
|
|
|
|
|
I don't have the book with me at work, but I'm fairly sure (hence, "IIRC") it described pulling animations out of meshes. I'll have to look tonight.
As far as the SDK samples go I was mistaken. Upon further investigation a mesh was not used to animate the helicopter (in the August refresh). The rest are just applying transforms to the world for a loaded mesh.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Yes the example shows you how to make an animation loop from a.x file with only 1 animation in it.
It doesnt really stop and say: "if you only want to play frames x to y do this" or "If you want to play animations X or y do this"
Ihave yet to re-read it and impliment the code (i read it once and browse the source code then re-read and do it my self) but from what i've read it basicaly just plays the animation in a loop...
What would have been handy is if the book used a model with more animations as an example and showed you how to activate each one indervidualy .eg press W to start walk animation. C to srart crouching J to start jumping..... would be a much more apt example of how to use mesh animaiton in games.or maybe im asking to much
|
|
|
|
|
Having looked through the C++ samples on the DX9 SDK it seems what im after is a C# version of the MultiAnimation demo. (the one where you add models to a scene then they move around firing off different animations like walk, run, loiter, wave etc)
Any one know of a link to any thing like this?
Thanks
|
|
|
|
|
Hi !
I'm looking for Voice Recognition SDK's... if you have some ideas or testing someone ...
Thanks in advance
|
|
|
|
|
try microsofts speach sdk
|
|
|
|
|
Is there a "Tapi" code in C#
|
|
|
|
|
There is no TAPI support in the .NET BCL. You'll have to go through the pain of P/Invoke'ing all the calls and rewriting all the structures they need in C#. From other answers posted to the same question on CodeProject, it's royal pain in the *** to do. It's been recommended against doing it several times.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanx
|
|
|
|
|
|
I have created a multiple client chat window program in which I want to create a new chat form and show it when the client gets the chat request from another client. When the communication socket thread for the client receives the chat request and tries to create a new form and show the form, it is not displayed since the communication socket thread is a worker thread. Can anybody has solution for this?
|
|
|
|
|
You'll have to invoke this, so it's executed in the context of the UI Thread. Take a look at the documentation for the Control.Invoke[^] method.
www.troschuetz.de
|
|
|
|
|
The easiest way is to let the UI thread do the display. Here is an example of how I handle an event fired from a working thread in my code. I learned this technique from a set of excellent articles by Chris Sells on MSDN. The key is using the forms InvokeRequired property and Invoke method.
private void RaiseProgram(object sender, EventArgs args)
{
if (InvokeRequired)
{
object[] objs = new object[]{sender,args};
this.Invoke(new EventHandler(RaiseProgram),objs);
return;
}
textBox1.Text = RunOnce.OtherAttemptCount.ToString();
if (this.WindowState == FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Normal;
}
RunOnce.BringFormToFront(this);
}
|
|
|
|
|
I have created an application. Here I am giving the code for the form file in the application in which I am trying to show a new form when the timer expires after 2 seconds. But the form is not displayed properly. When the button on the form is clicked it properly shows a new form. So please let me know what is going wrong here?And how to correct that.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Timers;
using System.Threading;
using System.Windows.Forms.Design;
namespace WindowsApplication1
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(120, 152);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
// Create a new Timer with Interval set to 2 seconds.
System.Timers.Timer aTimer = new System.Timers.Timer(2000);
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
// Only raise the event the first time Interval elapses.
aTimer.AutoReset = false;
aTimer.Enabled = true;
Form1 oForm1 = new Form1();
Application.Run(oForm1);
}
// Specify what you want to happen when the event is raised.
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
Form1 oForm1 = new Form1();
oForm1.Show();
}
private void button1_Click(object sender, System.EventArgs e)
{
//fnCreate();
Form1 oForm1 = new Form1();
oForm1.Show();
}
}
}
|
|
|
|
|
You are having a UI Threading problem. This will fix your current issue but I don't like the whole solution.
You are very dependent upon the line Application.Run(). That is where the UI thread enters the message loop. I would make the timer dependent upon the creation of Form1. It would still have to be static so that you do not create another each time the form loads. I am not quite sure what you are trying to accomplish so I didn't change your current pattern too much here.
static Form1 mainWindow = null;
[STAThread]
static void Main()
{
System.Timers.Timer aTimer = new System.Timers.Timer(2000);
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
aTimer.AutoReset = false;
aTimer.Enabled = true;
mainWindow = new Form1();
Application.Run(mainWindow);
}
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
if (mainWindow != null)
{
mainWindow.button1_Click(mainWindow,EventArgs.Empty);
}
}
private void button1_Click(object sender, System.EventArgs e)
{
if (InvokeRequired)
{
object[] objs = new object[]{sender,e};
this.Invoke(new EventHandler(button1_Click),objs);
return;
}
Form1 oForm1 = new Form1();
oForm1.Show();
}
|
|
|
|
|
Thank you for the help. That worked perfectly. I know that the application I have created was very crude one but it was the one to help me in the real problem.
Actually as I had written in the first mail that I was having problem to create form when I get the chat request in a chat application where I was unable to diplay the form properly. It worked when I made some changes getting the information from your help. Thanks again.
|
|
|
|