|
Hello,
i am on a little player project in C# i like to give it away for some friends but without this wmp.dll i would just like to give the *.exe and refer to the already existing dll in system32 folder any idea maybe how to can do that?
it works all fine if i import it over the visual studio references (right mouseclick, add..) but than it have to be next to the *.exe file when i wanna start the prog
please give advise
Regards,
Sep
|
|
|
|
|
|
hm bit confusing its not my dll its COM i just saw its located in system32 folder but when i move my exe out of the project folder it wont start with out this dll, i was just trying to DllImport()... but i cant read the classes then so it wont let me compil..
btw how and where can i put it as GAC?
regards
|
|
|
|
|
I don't know the entire answer, however this much I can tell you:
1.
wmp.dll contains native code, hence it can't go into the GAC. Either it holds COM components (which I don't know much about), or it requires P/Invoke to call individual functions (which I have descibed to some length here[^]). And I do expect it to be COM.
2.
If you use P/Invoke (which also means you don't "Add Reference"), the DLL is located in the good old way, in the exe's folder first, then through the system environment variable "PATH", which typically contains C:\Windows\system32\ and many others. The app will start even when the DLL isn't present, however every reference to it will obviously fail during app execution.
3.
OTOH, if you have a hard reference to a DLL (as with "Add Reference"), then the DLL file (and its dependencies) must be present for the app to load successfully.
4.
I'm pretty sure there are several CP articles that refer to wmp.dll, so you could go and have a look how they handle things.
|
|
|
|
|
This[^] SO post may help.
/ravi
|
|
|
|
|
Hi All,
I have a tab which contains multiple controls. I would like to share the tab real estate with two sets of controls. It's easy enough to programmatically hide and view controls however, as the controls share the same real estate it's difficult to manage them visually.
What I would like to do is create two sets of control containers and have the ability to visually work with both containers independent.
When executing the program the user will have an option to swap in and out a set of controls depending on the task type they are working on.
Regards
Patrick
modified on Friday, September 9, 2011 8:01 PM
|
|
|
|
|
Some possible ways:
1) Create user controls for each set of controls. Then you have a few options to display the appropriate set of controls.
a)You can do it at run-time but then you have to manage event hooking.
b) You can put them at there final place and it is somehow less an issue the overlappig since most of the design is done in the user control.
c) Put them elsewhere in your form and move them when the form is loaded. You might put them near the dialog edge so that you can click on each set in the designer.
d)Uses a container like a flow layout container and put each user control in it. At design time, you will see them all. Hide all but one at run-time.
2) Uses third party library that have more complete tab controls that support a wizard mode (as a tab control but without any tab displayed and a way to switch between tab at design time)
Philippe Mori
|
|
|
|
|
Hi, a few queries:
1. "I have a tab" : do you mean you are using a TabControl, and you have one TabPage on which you want to switch between certain sets of Controls, rather than using two TabPages, one for each set of Controls ?
2. or, do you have one TabPage in a TabControl where you want both sets of Controls to show up sometimes, and, at other times, to hide one of them ?
A little more information about the context of what you are working with here would be helpful.
best, Bill
"Is it a fact - or have I dreamt it - that, by means of electricity, the world of matter has become a great nerve, vibrating thousands of miles in a breathless point of time? Rather, the round globe is a vast head, a brain, instinct with intelligence!" - Nathanial Hawthorne, House of the Seven Gables
|
|
|
|
|
Electric Eddy wrote: What I would like to do is create two sets of control containers and have the ability to visually work with both containers independent.
You've received some good suggestions. I often go for a form, group things on there. From there it's quite easy to "paste" the form into a panel, or some other container. Need to show another set of components? Simply clear the controls -collection of the container, and put your new form in there.
void Button42_Click(object sender, EventArgs e)
{
MyForm f = new MyForm();
f.TopLevel = false;
f.BorderStyle = FormBorderStyle.None;
f.Dock = DockStyle.Fill;
f.Visible = true;
panel1.Controls.Add(f);
}
Hope this helps a bit
Bastard Programmer from Hell
|
|
|
|
|
Until the OP clarifies what his issue is, and its context, I think we are "reading tea leaves" here, but I must disagree with you, respectfully, regarding using a Form in the way you show here.
It's a waste of resources, imho, even if you go to the trouble of hiding all the form-adornments, control-box, maximize and minimize buttons, etc.
By the way in the code you show here, if the Form is the last control added to the Panel, the setting of its Dock property to 'Fill means it will fill the Panel and completely obscure any other controls added previously.
The idea that would one would want to "Clear" all the Controls in a Panel, is, to me, also a dubious one: typically you have built-up a set of Controls in a Container for a good reason, and you would want to re-use them, not discard them.
UserControls and Panels, and other "lighter weight" containers, make sense here, given the little we know of the OP's actual scenario.
best, Bill
"Is it a fact - or have I dreamt it - that, by means of electricity, the world of matter has become a great nerve, vibrating thousands of miles in a breathless point of time? Rather, the round globe is a vast head, a brain, instinct with intelligence!" - Nathanial Hawthorne, House of the Seven Gables
|
|
|
|
|
BillWoodruff wrote: The idea that would one would want to "Clear" all the Controls in a Panel, is, to me, also a dubious one: typically you have built-up a set of Controls in a Container for a good reason, and you would want to re-use them, not discard them.
Clearing the controls-collection doesn't discard the controls, it merely clears the controls-collection of the container, and yes, I'm reusing that container to show something else that's already in memory.
BillWoodruff wrote: UserControls and Panels, and other "lighter weight" containers, make sense here, given the little we know of the OP's actual scenario.
The "cost" of a Form isn't that excessive.
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: Clearing the controls-collection doesn't discard the controls, it merely clears the controls-collection of the container, and yes, I'm reusing that container to show something else that's already in memory. You interpret my use of the word 'discard' as if I had said 'Dispose' which is an incorrect interpretation. Of course the Controls, and even their internal "state" is not "lost," when they are removed from a ControlCollection, by 'Clear().'
What is "discarded" is the entire "design and intelligence" that (hopefully) went into creating a collection of Controls on a Panel (or Form, or UserControl). Which includes placement, z-order, tab-order, docking, anchoring, etc.
To "flush" the ControlCollection, just to present something else is just a ridiculously bad programming practice when there are such simpler alternatives.
Yes, you could write code to copy all the Controls in a Panel into an Array (using CopyTo(Control[], index)), and you could loop through that array, and, hopefully, restore the Panel's controls to a previous configuration: but what a waste of time and code ... when all you have to do is hide the whole Panel, or fill it, temporarily, with some other container that hides the 'original controls.'
And to design a ControlCollection to be used once and discarded: I can't imagine what kind of real-world scenario would call for such an implementation.
Forms are 'expensive,' and I think the way you have advocated using them here is an example of how to mis-use Forms.
Good programming practice uses "lighter-weight" objects for "lighter weight" tasks. The days of "MDI" are gone (praise be, except for the undoubted 'legacy' applications that will use that architecture until doomsday), and the use of Forms within Forms is just bad practice.
yrs, Bill
"Is it a fact - or have I dreamt it - that, by means of electricity, the world of matter has become a great nerve, vibrating thousands of miles in a breathless point of time? Rather, the round globe is a vast head, a brain, instinct with intelligence!" - Nathanial Hawthorne, House of the Seven Gables
|
|
|
|
|
BillWoodruff wrote: What is "discarded" is the entire "design and intelligence" that (hopefully) went into creating a collection of Controls on a Panel (or Form, or UserControl). Which includes placement, z-order, tab-order, docking, anchoring, etc.
Not notably different from a UserControl , and somewhat easier to manage at times.
BillWoodruff wrote: Yes, you could write code to copy all the Controls in a Panel into an Array (using CopyTo(Control[], index)), and you could loop through that array, and, hopefully, restore the Panel's controls to a previous configuration: but what a waste of time and code ... when all you have to do is hide the whole Panel, or fill it, temporarily, with some other container that hides the 'original controls.'
I didn't mention copying controls. Merely instantiate the Form/UserControl and assign it to a container that's serving as a a placeholder.
BillWoodruff wrote: Forms are 'expensive,' and I think the way you have advocated using them here is an example of how to mis-use Forms.
They're more expensive than a Panel, but in turn they offer a bit more design-time flexibility. Yes, a BackGroundWorker is more expensive than a Thread , but the tradeoff can be worth it. That's why we don't code in C at this moment
BillWoodruff wrote: and the use of Forms within Forms is just bad practice
Since when? Have you taken a look at the VS-IDE?
Bastard Programmer from Hell
|
|
|
|
|
I have put together an appication that uses the WMP Cpmponent.
This works perfectly on my machine and other machines, and I can run it and play whatever files I wish under my account, guest account or any other account I care to create on my machine, I have also tested it on other machines without an issue.
The problem is, that the people who whish to use it are on a VERY secure network with privileges really locked dowm, and the player although working fine for the admin who installed it, is unable to find the codec needed when used by another user. It gets even wierder in that the standard Windows WMP will play the file without a problem, it CAN find the codec.
I am totally baffled and was wondering if anyone may have an idea of what the hell is going on.
|
|
|
|
|
Look in the Event Viewer to see if anything is being logged there that may give you a clue.
Also, maybe your application needs to be added to the windows firewall exceptions.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Hi, I was just wondering...
To write a good, interactive online game (as an example) would normally require flash, and this has its own language...right?
Now, if I learnt C#, is it possible to have some kind of "flash" like interface so that I could place interactive programs online.
I was looking at Silverlight, would you be able to use this to write 100% C# games and then run them in the browser, or is there another method?
I am interested as I want to create my own little, fun, gaming website. But instead of presenting my games for download, I would like to allow the user to run them in the browser, online.
I really don't want to start learning flash and other tools and technology’s just yet, and would prefer to do this as close to 100% C# as possible, but would still like to include basic graphics, animations, sound etc.
Thank you for any ideas.
Steve
|
|
|
|
|
Yep, Silverlight can do pretty much anything Flash can do (as far as multimedia and interaction go), and you can use C# for Silverlight. As long as the user has the Silverlight plugin installed, they will be able to run your games in their browser (just like a user would need the Flash plugin to run Flash games). Flash runs on more browsers than Silverlight, but most users at least have the option of downloading Silverlight and the number of computers Silverlight is installed on is huge.
Flash uses ActionScript, if you feel like learning that.
Mashoo offers Silverlight games, if you want to see what is possible.
Martin Fowler wrote: Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
AspDotNetDev wrote: Yep, Silverlight can do pretty much anything Flash can do
Excellent!
AspDotNetDev wrote: Flash uses ActionScript, if you feel like learning that.
Not really. I am still learning C#, and I have heard that the learning curve for proper use of ActionScript can be a bit high.
I am glad I can use C# with Silverlight, and I will look into this when I become a little better with C#
Thank you,
Steve
|
|
|
|
|
One more thing. Keep in mind that you will probably also be heavily involed with XAML if you use Silverlight. XAML is basically what you use to build UI's in Silverlight. Everything you can do in XAML you can also do in pure C#, but most documentation and such shows the XAML.
Martin Fowler wrote: Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
AspDotNetDev wrote: One more thing. Keep in mind that you will probably also be heavily involed with XAML if you use Silverlight. XAML is basically what you use to build UI's in Silverlight. Everything you can do in XAML you can also do in pure C#, but most documentation and such shows the XAML.
OK, Thank you for the "heads up", I will take a look into it. Proberbly just end up getting myself a book on WPF and Silverlight.
Kind Regards,
Stephen
|
|
|
|
|
There are also lots of great articles here on CodeProject which will help you to learn XAML/C#. Most are WPF oriented, but since Silverlight is a subset of WPF they are still very useful, especially any by Josh Smith[^] and Sacha Barber[^], amongst others.
|
|
|
|
|
OK thank you again,
I have pleanty to get going with.
Thank you,
Steve
|
|
|
|
|
You may wish to evaluate MS's XNA[^] platform for gaming. Uses C# (and now VB, as well).
And, check out ASPDotNetDev's comments here:[^], as well as[^].
I have no experience with XNA, have no idea what it's current and future status is, but other folks here on CP do !
best, Bill
"Is it a fact - or have I dreamt it - that, by means of electricity, the world of matter has become a great nerve, vibrating thousands of miles in a breathless point of time? Rather, the round globe is a vast head, a brain, instinct with intelligence!" - Nathanial Hawthorne, House of the Seven Gables
|
|
|
|
|
Thank you,
I will have a look at XNA aswell,
Steve
|
|
|
|
|
You need more details in your idea.
Angry Birds is not in any way comparable to World of Warcraft. And neither is comparable to Portal.
Not conceptually and not in implementation.
And your question is, vaguely, about display options only.
stephen.darling wrote: would prefer to do this as close to 100% C# as possible
So in terms of this and your mention of "online game".
Then your strategy would be.
1. Design the game.
2. Create a C# game that runs on your computer. GUI and internals are all in C#. (Nothing online about it and ONLY one person.)
3. Create an installer for the game (2).
4. For the online part create your own down load server and allow the installer (3) to be downloaded from it.
Now if you want to create a game where several people play against or with each other then the strategy is different.
A. Design the game.
B. Create the game server. This handles communication between players.
C. Create the client app. This must include a way to find or designate the game server. There are different ways to implement this.
D. Create a down load server (not the same as 2) which allows a user to get the client app.
There are details that can modify the above strategies in different ways. For example you don't need to actually create a down load server. There are hosting companies and sites that will provide that for you.
Another variation is in C above where it could be entirely browser based. That eliminates step D but has its own limitations. (Although making it browser based is probably a good learning exercise and for a single person sufficient.)
1. Create
|
|
|
|
|