|
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
|
|
|
|
|
Hi all!
I need to do sound compression in C#.
I record sound from microphone in wav format then I have to compress it (to Mp3, WMA of other format) to send over network and play on client computer. I found some things working with files but I can only work with streams.
I explored a lot of variants for several days but:
1. .Net Class Library doesn't include anything working with sound.
2. DirectSound doesn't do sound compression.
3. DirectShow is not included in Managed DirectX 9.0 so I can't use it from .Net
4. Windows Media Encoder doesn't work with streams
5. Audio Compression Manager maybe the only one tool to compress sound. Has anyone reference how to use it from .Net? (now I import functions from it's dll and try to use it)
Am I right in my conclusions?
Please help me!
Taras
|
|
|
|
|
No, the .NET BCL does not have anything to deal with sound. While it should've at least had some basic classes to play WAVs, sound compression is not really common in a base class library - it's often something found in extensions.
Such is the case with Managed DirectX. DirectSound doesn't need to do sound compression because it deals with filter chains. You chain a series of readers, decoders, mixers, encoders, and writers together. You can even play with this process visually using the GraphEdit application that is installed with the DirectX SDK.
And Windows Media Encoder does deal with streams, both reading from and outputing to. I've done is many times in the past.
On a more personal note, please do not email me directly with the same question that you post in the forum. I or somebody else will get to your question when we see it and feel comfortable answering it. Everyone's time is precious, and using this forum soley helps preserve the knowledge in a searchable archive (though no one ever seems to search first anymore) that is available to help everyone.
-----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!
You answer clears solution in general but can you write an exact links to classes, methods in DirectX or Windows Media Encoder SDK that deal with my problem because I still can't find them!
P.S. Is there any way to use DirectShow from C#?
Taras
|
|
|
|
|
Then you'll have to read the DirectX SDK - it's the only way to learn. You can also google for examples or look at the code in the samples that are installed with the SDK.
There are plenty of examples of using DirectShow in C# here on CodeProject - just search! Perhaps the 'DirectShow' keyword would return you several.
-----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 trying to save a Button object to a file, with the following code:
[Serializable]
public class SaveSettings
{
public System.Windows.Forms.Button btn = new
System.Windows.Forms.Button();
}
System.Windows.Forms.Button testBtn = new System.Windows.Forms.Button();
SaveSettings.btn = testBtn;
Serializer.Serialize(settings.btn,"C:\\aButton.btn");
public static void Serialize(object Object, string FileName)
{
BinaryFormatter bformatter = new BinaryFormatter();
Stream stream = File.Open(FileName, FileMode.Create);
bformatter.Serialize(stream, Object);
stream.Close();
}
But I get the following exception:
An unhandled exception of
type 'System.Runtime.Serialization.SerializationException' occurred in
mscorlib.dll
Additional information: The type System.Windows.Forms.Button in Assembly
System.Windows.Forms, Version=1.0.3300.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 is not marked as serializable.
What is wrong? How can I make it serializable?
I'm also trying with a Panel(containg butttons) and a TreeView(containing nodes), it all results in the same exception.(Simpel things as an ArrayList,string, int or double works fine)
Thanks in advance for your help ,
Thomas
|
|
|
|
|
Do you really want to serialize the button?
You could instead save button's Checked state and/or the button's Text label.
-rick
|
|
|
|
|
Yes, because my applicaton creats buttons in realtime.
Actualy I'm trying to save a ArrayList of Panel objects(allso made in runtime) that contains diffrent sized buttons. I've created a button class that extends the windows button class, with addisional information. Same thing for the panel.
Sorry about my bad English.
|
|
|
|