|
Just a thought:
Windows Explorer is able do create thumbnail display for most file types these days. If you can programmatically invoke the process, you will get the ‘thumbs.db’ file. Using some API you would be able to able to read it and show the thumbnails without wasting much resources. Search in this direction.
Second way: You can have a service which creates thumbnails for all files in a predefined folder, like google’s picasa. You can use a third party library to generate the thumbnails. I believe there are free libraries for this purpose. (ImageGear is a library I worked on, but its not free)
Hope this gives a direction.
|
|
|
|
|
Thanks both of you for the quick responses. Right now I'm going with the simpler answer from Christian . I'd rather do things full-out but who knows if the managers would agree...
vir·tu·al re·al·i·ty
n. Abbr. VR
A computer simulation of a real or imaginary universe in which Microsoft APIs are thoroughly documented and behave in an entirely logical manner.
|
|
|
|
|
I'm putting together something like the Snippet Compiler, and I am having fits trying to figure out how to add a .licenses file to the EXE.
It's sort of a "which came first, the chicken or the egg" problem.
Given a .licx file, I can use the lc.exe utility to generate a .licenses file. Then, I can use the /res: compiler switch to embed the generated resource.
BUT, you have to provide the .EXE file to the lc utility, which DOESN'T EXIST YET!!! Argh!
So, I'm thinking the approach is:
1. compile and generate the EXE
2. use lc to generate the .licx file
3. use al to embed the .licenses resource into the EXE
But I'm stumped on how to do step 3, or even if it's right!
Any ideas?
Marc
MyXaml
Advanced Unit Testing
|
|
|
|
|
|
Nick Parker wrote:
Marc, I came across this article that might be helpful.
I already found that link yesterday, but thanks! It was quite helpful, but the problem is that the EXE already exists, so you have something to use for the /target: switch.
I'm hoping that I don't have to resort to compiling the entire assembly, then recompiling it with the /res switch after building the .licenses file.
And then, there's dealing with older style licensing that used a .LIC file--here VS does something yet again different, as the instructions for the component says that the .LIC file has to be in the same folder as the assembly you're linking against.
Oh, and to make matters even more interesting, if I use the /res: option to add my .licenses file, then another component (from DevExpress) all of a sudden says that IT is missing licensing information.
Good grief. What a nightmare. I wonder if MonoSharpDevelop has solved these problems.
Marc
MyXaml
Advanced Unit Testing
|
|
|
|
|
You don't need the compiled executable, only to specify the executable name. This helps name the .licenses file appropriately, nothing more.
Now, you would run into a problem if the control you wanted to license was in the .EXE in which you wanted to embed the .licenses file, but nothing that can't be overcome with a three-stage compilation like you outlined above.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath Stewart wrote:
You don't need the compiled executable, only to specify the executable name.
Hehe. I just figured that out about an hour ago! Dang, I wish the documentation would have made this clear. I assumed from the description that the target had to exist!
Thanks!
Marc
MyXaml
Advanced Unit Testing
|
|
|
|
|
I agree. targetPE makes it seem like the PE/COFF is required. Be sure to send feedback about that link. It actually does get read.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I've been working today on a metronome application in C#.
I'm using a System.Windows.Forms.Timer variable named "Clock" as my timer.
I've implemented basic tempo change functionality by means of a trackbar as follows.
private void tbTempo_Scroll(object sender, System.EventArgs e)
{
Clock.Interval = 60000/(tbTempo.Value);
}
I would now like to implement "accented beats". If a bar has 4 beats, I want the 4th beat to sound different from the preceding 3.
Put another way, the first three ticks result in, say, DrumNormal.wav being played and the next tick results in DrumAccent.wav being played.
This is repeated till the user presses the "Stop" button.
Could I get some tips on how I can implement this?
Thanks!
|
|
|
|
|
I think the modulus operator would work well for you in this situation. Without going into the details, if you have:
int result = someValue % 4;
Then result will be zero if and only if someValue is divisible by 4. I think you can use this information to build a solution to your problem.
|
|
|
|
|
Brian, thanks for your suggestion. It did, indeed, work very well!
private void Clock_Tick(object sender, EventArgs e)
{
count++;
if ((count % 4) == 0)
AccentBeatBuffer.Play(0,0);
else
NormalBeatBuffer.Play(0,0);
}
|
|
|
|
|
Hi All,
This is my first post in the C# section. Hope I get a reply.
In my windows form application I have a TreeView on the left side of a splitter control. Tree nodes can have 2 labels say, A and B.
If the user selects a node with A label on it, I want to show a form with some controls on the right side of the splitter.
If the user selects a node with B label on it, I want to show a different form with different controls on the right side of the splitter.
Can anyone suggest a method for form switching the way I want?
Please dont ask me to use only one form and show and hide controls depending on the tree node selection.
Your help will be much appreciated.
TIA
Binayak
|
|
|
|
|
|
You could have also used User Controls. They would have been easier to work with since they would have each been their own class.
|
|
|
|
|
How can I kill a running process with the Win32 api ? I know that I have to use a Process ID, but how can I resolve this one ? Thanks for each response.
|
|
|
|
|
You can do this through the .NET Framework, there is a Kill method defined in the Process class. Check into here: Process.Kill[^].
- Nick Parker My Blog | My Articles
|
|
|
|
|
Morning All -
I have a unix file / and Stream output that uses ^M [CTRL-M CR (Carriage return) ] to end a line. I see the line break's in MS Wordpad, but not in Notepad or when trying String.Split(char [], ...) I do not know what char to define.
Can anybody help, or point me in the right direction.
thx,
CJ
|
|
|
|
|
Are you writing the file or reading it? By default, TextWriter.NewLine is the same as Environment.NewLine . If you need to change this, you can set the NewLine property to any string necessary on classes that extend TextWriter (like StreamWriter ).
If you're reading files using classes extending the TextReader , many take an optional parameter (via overloads) to the control to automatically detect the file encoding, which most often checks the line-endings as well (IIRC). Take a look at the overloaded constructor documentation for the StreamReader class in the .NET Framework SDK for more information.
If you're wondering why wordpad.exe displays ^M it's most likely because it hasn't been updated to handle different line endings while notepad.exe has.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
|
Hi All!
I come from a VB background and have been doing .NET for a year or so, and am looking for a way to yield / update my GUI every now and then when doing long operations (the occational check for ESC-keys, mouseclicks, etc).
I guess I could do it with API's, but since many of the API's I used with VS6 is now integrated in the framework, I thought it was a solution to this too?!? I use Net2003 Framework 1.1.
Any gurus out there?;)
TIA
-Per
|
|
|
|
|
Bibl2Frogn wrote:
and am looking for a way to yield / update my GUI every now and then when doing long operations
You should look into threading. The Thread[^] class has more information, I would start there. There is also Application.DoEvents[^] which will process all messages in the message queue. This should get you started.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks Nick. I'll look into it.
-Per
|
|
|
|
|
To All:
This is a very simple and stripped down example of what I am thinking about. The question is as follows:
If given an array of items, such as string [] arrMeth = new string [] { "A", "B", "C" } , can one take anyone of these items (A, B, C) and use it in the invocation of a Foo method acting as the method name?
If it is not possible, then please state so; however, if this is a possibility, please provide an example of how to do so.
Thanks in advance to all the respond. Example code is provided below.
Sincerely,
DeadPoet
<br />
using System;<br />
namespace dp.test<br />
{<br />
class Test<br />
{<br />
[STAThread]<br />
static void Main( string[] args )<br />
{<br />
string [] arrMeth = new string [] { "A", "B", "C" };<br />
<br />
Foo foo_obj = new Foo();<br />
foreach ( string xMeth in arrMeth )<br />
{<br />
foo_obj.xMeth( xMeth );
}<br />
<br />
}
}
}
<br />
<br />
using System;<br />
namespace dp.test<br />
{<br />
class Foo<br />
{<br />
public Foo() {}<br />
public void A ( string x )<br />
{<br />
Console.WriteLine( "Method " + x );<br />
}<br />
public void B ( string x )<br />
{<br />
Console.WriteLine( "Method " + x );<br />
}<br />
public void C ( string x )<br />
{<br />
Console.WriteLine( "Method " + x );<br />
}<br />
}<br />
}
|
|
|
|
|
Yes, this is possible but not as you state it. You need to look into the Reflection[^] namespace. In particular, you can do something like the following (I didn't test this but it should get you started):
MethodInfo mi = typeof(WindowsIdentity).GetMethod("GetRoles");
if(mi != null)
{
string[] roles = (string[])mi.Invoke(new WindowsIdentity(), null);
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
I have created a client in C# and a server in C. The Server is run on a linux computer and client on Windows. When the client tries to connect it fails. I have tried modifiyng the server to run on windows, and I am able to establish the connection between two windows computers. It also seems to work connecting a linux version of the client to the server on linux. But it doesn´t work connecting a c# version on windows to the c server on linux.
|
|
|
|