|
You need to include a reference to the System.Management.dll before you can include it within your project. Select Project --> Add Reference... and scroll down to the System.Management entry and hit the Select button. Now you should be able to include that namespace within your code.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi
I want my .DLLs to be in a subdir of the .exe, but so far have been unable to figure out how to configure things in order to make it work.
thanks
|
|
|
|
|
Why? Anyway, there really isn't any configuration you can do that will accomplish this, that is reliable. Keeping them in the same dir as the .EXE is the best practice.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Have you tried to add the sub directory to the system search path? I would have to assume you have a good reason to do that though. It is more reliable to keep them in the same directory.
|
|
|
|
|
|
|
Hi
I want to have a easy way to control my mdi documents. (like it's done on mirc, for example) but all i've been able to get is a list in the menu items.
|
|
|
|
|
Read[^] about the Form.MdiParent property in the .NET Framework SDK, which includes an example.
On a particular MenuItem (for example, "&Windows"), you can set MenuItem.MdiList to true in order to display all MDI Form s in the container application.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have a simple text file on the network. My application will read and write to this file, can someone tell me how to lock this file while in exclusive mode so that another app or a user won't access this file while I'm reading/writing to the file? Also, can someone tell me how to check if this file is locked before I try to lock it?
Thanks
Sharon
|
|
|
|
|
Here is what I know
The IO namespace has a FileInfo class and some enumerations that control the Info, Access and Shareing of the file.
it looks kind of like this.
FileInfo fl = new FileInfo(@"C:\whatever.fil");
FileStream s = fl.Open(FileMode.OpenOrCreate,FileAccess.ReadWrite,FileShare.None);
This should get you an open file with RW and be exclusive to you.
|
|
|
|
|
Use the managed DirectX 9 SDK.
using Microsoft.DirectX.AudioVideoPlayback;
Audio theAudioFile = Audio.FromFile("name of the file.mp3");
theAudioFile.Play();
It works with .wav, .mp3, and .wma files. Also note that in the .NET framework 2.0 beta, there's a built-in .wav player control called SoundPlayer, found in System.Windows.Forms.SoundPlayer.
#include "witty_sig.h"
|
|
|
|
|
Ive tryed using AudioVideoPlayback before and it cant find the reference i have directx sdk 9 and have updated to the new 9.0b runtime, but is the managed direct x somthing extra? ive been looking and have seen it mentioned in my search but not understood its meaning
|
|
|
|
|
The Managed DirectX 9 SDK is seperate from the DirectX 9 SDK. See here[^]. If installed correctly, the MDX9 assemblies will be added to the GAC.
#include "witty_sig.h"
|
|
|
|
|
For tutorials see an article called Managed DirectX Tutorial Part 2
This part talks about AudioPlayback and may be able to help you get started.
Kev Pearman MCP
|
|
|
|
|
id seen the tutorial but couldnt get it to run as i didnt have managed directx it would seem, but i cant find the download for managed direct x, anyone able to point me in the right place?
|
|
|
|
|
I just downloaded the latest version of directX from microsoft. In your project's you then have to add a reference to each DirectX Dll you are going to use.
Do a search on your machine for DirectX.dll and then add a reference to it (any other directx dll's should be in the same folder), this worked for me.
Kev Pearman MCP
|
|
|
|
|
i do this but i dont have any reference to audiovideo.
ive got latest directx runtime but oviously not managed?
|
|
|
|
|
Do you hve this folder
C:\WINNT\Microsoft.NET\Managed DirectX\v9.00.1126\
The version number at the end might be different.
If you don't then make sure you get the latest version of directX (230+mb i think) from Microsoft, thats the version i used.
In the folder v9.xx.xxxx\ you should find all the managed directx dll's that you need, including directx.dll and the audivideo dll that your after.
Kev Pearman MCP
|
|
|
|
|
no i dont have that, i looked for the latest dirext x all i could find was the new runtime, but looking at the latest SDK with teh runtime in its 230mb+ so i started to download that, is that what u meant?
its gona take me couple hrs on my partents con so ill post when its done
thx dudes
|
|
|
|
|
Thats the version i have installed. When you have installed it you should have the driectory i specified in the previous post with all your dll's in it.
Let me know how it goes.;)
Kev Pearman MCP
|
|
|
|
|
Thx dude yer its got what i need
|
|
|
|
|
Ok,
I am going to write a Wizard for a new project that I am doing at work. Depending on where you are in the Wizard the screen will have different controls. My problem is that if I re-use the same form I will have to change the size and mess around with the posision of controls..
My question is when creating a Wizard is it better to use more then one form or re-use the same Form and just re-size it as needed..
Thanks
Will
|
|
|
|
|
|
thank you very much for the quick reply. The link that you provided is great and I will be sure to take some notes from that. As always I try to do a little research before I do anything. I guess I will try to use the same form and just adjust it as I need to, not sure how that will look yet..
thanks again
Will
|
|
|
|
|
I would also study how current property sheets / wizards work in the Platform SDK. Both the Shell APIs and MFC contain implementations (MFC is most often a wrapper around the common APIs) of the property sheets and pages and offer good idea to implementing your own. For example, by simply setting a single variable your property sheet is not a wizard. Perhaps this isn't important to you, but what should be is the implementation.
Through interface support, the property sheet (hosts the tab control and buttons, or simply controls the paging of wizard pages) can determine whether a page should allow the user to go back or forward, or cancel, etc. In a property sheet, this wizard-like behavior often corresponds to the Apply button being enabled (i.e., data has changed to either Apply is enabled (for property sheets) or the Next button is enabled (data has been provided).
Even if you completely ignore the property sheet implementation, the power is still in the interface. Your wizard could accept an list or collection of Control , UserControl , or whatever basic class that implements a particular interface (for example, IWizardPage ), or simply an abstract class (for example, WizardPage ). The pages determine what buttons are enabled and how pages are cycled (depending on their own internal state). You don't really need to worry about resizing the dialog: always maintain a particular order of buttons. If a button is needed, squeeze the buttons down (like if no Next button is needed, a Back button may shift over to where the Next button is, and a Done button should replace a Next button on the final step. The recommended and consistent order of buttons is Back, Next/Finish, Cancel. Sometimes a Help button may be shoved way over to the left corner or be found in the far right after (in a LTR reading order) the Cancel button.
A good wizard control would also make it easy for pages to communicate by implementing a property bucket (a place where pages can store information used by other pages).
Again, many of these concepts are supported by the Shell API for property pages (the very ones you see in the file Properties dialog, etc.).
For a starting point, look-up IPropertyPage in the Platform SDK in the MSDN Library[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|