|
Øyvind Bratland wrote:
If you are familiar with the code in the SDK samples, then you are an advanced DirectSound user?
Hardly, but it's a good place to start.
Øyvind Bratland wrote:
...then please advice me where to learn to walk.
I learned many different languages and many different APIs/frameworks by reading the documentation and exploring even the most basic samples to see how everything comes together. The documentation might not be great, but it's important to read it and see what all is available. If you actually take the time to read it - and the articles within (which I remember very many good ones on at least other DirectX technologies) - everything should come together.
If not, I remember giving either you or someone else recently this link: http://www.microsoft.com/windows/directx[^]. When dealing with anything that has to do with development, you should always check MSDN as well: http://msdn.microsoft.com/directx[^].
There's many articles in there plus links, an NNTP (newsgroups) web interface, and more.
I also said that CodeProject[^] has many articles on DirectX technologies like DirectShow that you also asked about (which is necessary for decoding / encoding, while DirectSound is typically used to actually play the audio file). Googling for both DirectShow and DirectSound found many, many results - including those here on CP.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
I learned many different languages and many different APIs/frameworks by reading the documentation and exploring even the most basic samples to see how everything comes together
Of course, me too, I just didn't know which documentation to read.
Heath Stewart wrote:
CodeProject[^] has many articles on DirectX technologies like DirectShow that you also asked about (which is necessary for decoding / encoding, while DirectSound is typically used to actually play the audio file).
Ah! Thanks for clarifying this. I thought all this was DirectSound, but DirectShow... that makes a difference! Actually, I was looking for this in managed DirectX 9, but it looks like I have to do it the way NETmaster does it in his article here at CP.
Thanks for your help,
Øyvind
|
|
|
|
|
I looking to have a sortedlist that I can bind to form controls. I can write a class that extends SortedList and implements the IList interface. My first question is the syntax for extending a class and implementing an interface are the same. How does the compiler know to differeniate between the two. My other question is since the SortedList class already implments many of the methods required for the IList interface (e.g. Add, Clear, Contains, etc...) do I have to overwrite these methods?
|
|
|
|
|
The compiler knows because the names match up to a single definition. If there are multiple methods with the same signature (based on name and param types) in various interfaces (for which a class can implement many) or in the base class (for which a class can extend only one), then you must use explicit interface methods (which answers another question):
public class MyClass : BaseClass, IMyInterface
{
public override void Foo()
{
DoSomething();
}
void IMyInterface.Foo()
{
DoSomethingElse();
}
} This is really only necessary when the returns types differ or when you want a method based on one class or interface to do something different when from another interface. Many times, just let both BaseClass.Foo and IMyInterface.Foo refer to the same code (which the compiler handles just fine). Properties are probably benefited from this the most.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
So if I'm understanding you correctly. If I write a class and extend SortedList I get all the functionality of a SortedList and implement IList for databinding by doing the following:
public abstract class IndexSortedList: SortedList, IList //Does order matter here?
{
//This is the only IList method not implemented by SortedList
public void Insert()
{
DoSomething();
}
//Do I have to include this method as well and just simply
//tell it to call the Add method from the SortedList?
//This method is already implented in SortedList, but required by IList.
public override void Add()
{
//call SortedList's Add method
base.Add();
}
}
Can you confirm the questions in my comments? Thanks!
|
|
|
|
|
If the SortedList alredy implements an Add method with the right signature, you don't need to do anything! It's already done for you. An interface is just a contract that ensures that an implementing class has members defined in the interface. Your class already inherits an Add method (as well as many others) so you don't need to do anything. Just implement Insert and call it good.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks! Much appreciated. I'm gonna give it a try later this afternoon.
|
|
|
|
|
I've looked through the documentation on MSDN, and have found the SHGetFileInfo method, and the structure SHFileInfo, which have helped my understanding a great deal.
The one problem I have is locating the SHGFI Flag list. While heath appears to have posted the whole lot, they are not included in the enumeration and variables section of the MSDN library (or anywhere else for that matter), and there are 2 results from google which aren't waht I am looking for.
How did you find out which variables to use and in which order the flags are declared?
Thanks
Cata
|
|
|
|
|
The_Catalyst wrote:
How did you find out which variables to use and in which order the flags are declared?
Order doesn't matter - the value does, and you can find these in the header files from the Platform SDK. There are many ways to find these, but the most obvious is to search the Platform SDK's includes directory for one of the constant expressions, like SHGFI_ATTRIBUTES .
Beside, why do you need these when I've already given them to you. Seems like a complete waste of time.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Platform SDK? Is that like a development kit for whatever version of windows I am using?
I don't want the specific information, I just want to know where to look to find the flag enumerations for windows dll methods. As I can't find one particular enumeration set on MSDN, then It stands to reason that it does not list them all, and I'd like to be able to look up those that aren't listed if I need them.
Cata
|
|
|
|
|
The Catalyst wrote:
Platform SDK? Is that like a development kit for whatever version of windows I am using?
No, it's the software development kit for all versions of Windows up until the one it's labeled with (like the recent Windows 2003 Platform SDK is good for everything up till - and including - Windows 2003.
The Catalyst wrote:
I just want to know where to look to find the flag enumerations for windows dll methods.
Like I said - in the headers. Welcome to software development! Research awaits. Not all the preproc defs (not enums, actually) are not documented, nor is every function or macro. Even if you don't know C/C++, reading preproc defs shouldn't be hard. Searching for information - especially that which is undocumented - is just part of development. In real, unmanaged languages like C/C++ (as opposed to VB which just wraps everything) there's often a lot of this that's necessary. To make it easier for me, I use CTAGS which you can use to index various file types, including C/C++, in a way that is specific to a language (CTAGS properly tokenizes things, as opposed to how IIS does it). Along with GViM, it's an extremely powerful tool for finding preproc defs and more.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I'm new to C# and here is my problem!
In C++ my class would look like this!
public class Timetable //it's the timetable for a room
{
Timetable *next;
//every timetable has a pointer to the next least costly timetable
int booking [max_rooms][days_in_week][hours_in_day];
....
}
public class Colony
{
Timetable *first;//points to the least costly timetable in the colony
Timetable *last;//points to the most costly timetable in the colony
....
}
To use pointers in C# I know I have to mark these classes as "unsafe" .
How can I fix the objects??? If I don't use "fixed", at runtime I'll have an invalid pointer because the object will be relocated!
I read that I can use "ref" but I don't really now how
Please help me!
If anyone has sugestion ....
Sorry for my bad english!
Thank you for your time!
|
|
|
|
|
Dont bother with pointers, all but a few classes are all managed pointers anyways. SO just remove the stars (and you dont need unsafe then either)
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
To be more precise (based on what leppie said), all reference types (pretty much everything) are like pointers - they are references to a class object. Value types - the intrinsics like int (Int32), long (Ing64), etc., DateTime, enums, and other classes deriving from ValueType - are just that - values. When using these in parameters, ref types are automatically pass-by-ref and value types are automatically pass-by-value. If you need to pass a reference to a value type, you can use the ref or out keyword. Rarely do you / should you use these for reference types (typically only necessary when P/Invoking native methods that take a pointer to a pointer to a type).
You should probably read the C# language documentation in VS.NET / MSDN and get familiar with it before running into problems like these. Walk before you run.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi. I'm trying to open a new webform inside another active webform, sort of like a pop-up. THe idea of the smaller form is that the user can select a street for an address to go with the city that was selected on the main form. Once the street is selected, the pop-up closes and the data is moved to the main form. Now, I've been able to do all of this with datagrids on the main form (we use SQL SERVER here), but it is not very nice to the eye. Anyway, my question is thus: Is there a way to have C# open a new, smaller form, without haveing to resort to Javascript in the HTML of the main ASPX page.
Krisman
|
|
|
|
|
First, this is better suited for the ASP.NET forum.
Second, C# compiles to IL which is contained in assemblies which execute code ON THE SERVER. In laymen's terms, C# is only server-side when dealing with Web Forms. So, no, you can't open a popup window using C# without resorting to writing some Javascript/JScript or an HTML link with an appropriate onclick handler or target attribute value.
A quick search on CodeProject would reveal (and at the time this was written, it was right on the homepage under "Latest Best Picks") an ASP.NET WebControl that makes popups easy to deal with (at least for n00bs) at http://www.codeproject.com/aspnet/asppopup.asp[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thank you very much!
Krisman
|
|
|
|
|
Hello every one:
I have a question that confuse me always ,I think most C#
fans have the same one.The question is if we can do API-Hooks
with C# onely or with other help,if we can please give us some advice ,I think there are many programers know what to do.If you can give ,please help.
thank you very much.
Best wishs
sorry for my poor English
sdfasd
|
|
|
|
|
If you need to handle message in your application, implement IMessageFilter and add it to your application's queue filter using Application.AddMessageFilter .
Otherwise, please try searching CodeProject articles or the forums first. This has been covered far too many times and is pointless to keep posting. For one article on CP, try this: http://www.codeproject.com/csharp/NetWin32Hooks.asp?target=hooks[^]
To search the comments, click "Search Comments" directly above this threaded-forum view and try searching for "hooks".
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thank you Heath Stewart:
I know what is your means.In the example of MSDN,
it is a local hook,and it is also a local hook in all
hook-example that I saw.I think we really need to know
what should we do in a journal-hook.for example ,the
API-hook is so.
sdfasd
|
|
|
|
|
I'm afraid I don't follow you. Are you asking what journal hooks are good for, such as example usage of a journal hook?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Sorry for my late:
Heath Stewart I think you can help me .
I want to say if we can use journal-hook in C# onely.
If we can do it.Please give me a sample,thank you.
The second question is if we can use API-hook in C#.
Bestwishes
sdfasd
|
|
|
|
|
|
Thank you Heath Stewart:
I saw all of the source-code.But they are local-hooks
I really want to know journal-hooks .
thamk you.
sdfasd
|
|
|
|
|
here is the problem; i am looking for a solution.
On a button click; i want to open a rich text editor or WordPad; and want to copy the text typed there to my own text field, once user clicks exit/cut Button.
can i do this?
is there any control available to use worpad in our application? like msword.olb for MSWord programming.
i am using vb.net with asp.net; had to do this on a aspx web page.
Looking for Help
ASIM
Asim
|
|
|
|