|
so how do u use it?... for example if i want to set the url value of the windows media player from a textbox, do i just use:
protected HtmlParamControl params;
...
...
params.Url = TextBox1.Text;
is that it? or do I have to call the render method?
thanks a lot for the help
Cheers,
Rico
|
|
|
|
|
Read the documentation. First, Render is protected so just how do you plan on calling it from another class? Second, that method is called automatically to render your control. You override that to provide your own rendering but your method is called instead of the parent class's. That's how polymorphism works.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
how would i go about connecting a local drive to a network share in a console app? basically i want to simulate 'net use x: \\computer\share'
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
The easiest way is to just create a new Process with your arguments:
Process.Start("net.exe",
string.Format("use {0}: {1}", driveLetter, shareName)); The alternative requires much more work since you have to P/Invoke several native functions and create several structures in C#. If you'd rather do it this way, click "Search comments" above the message board and search for something like "net use". This has been covered a couple times in recent history.
Note, you can also modify the code above to include a username and password. Just type "net use /?" on the command prompt to learn more about the available switches.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i'm writing a console app to be used in dos mode on a boot disk. i want to clear the screen before i output a list of information. how do i clear the screen?
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
Since CLS is a command provided by the command prompt itself (and not a separate program like net.exe), you can not invoke the process (since it isn't a process) like I mentioned above.
If you're looking for a better console class, see Console Enhancements[^] here on CodeProject. It gives callers the ability to clear the screen like you want, as well as colored output and more. Much of this functionality will be on the Console class for the .NET Framework 2.0 (code name "Whidbey", currently), but that won't be available till Q4 of 2004, or Q1 of 2005 (supposedly).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm using the WMP SDK and C#(.NET 1.1). I wanted to know if there was a way to get the web page that gets loaded into the Info Center(when you put a CD in and it recognizes it you get a bunch of stuff on a web page about the artist) so that I can load it into the program I'm writing.
------------------------------------
Proud owner of a Peacekeeper barbie
|
|
|
|
|
Nothing is exposed, but you can get much of the same information after you get the Media object. Call Media.getItemInfo .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Rats, I've been using that.
Thanks anyways
------------------------------------
Proud owner of a Peacekeeper barbie
|
|
|
|
|
I have a client and a server program and each has a database on the respective machines. The goal is to have the databases synchronized across the server and all clients in real time, all while having the possibility of the clients working offline from the server.
The way I'm going about it now is I create the app-specific objects from the data in the database on the server (the server will have the actual objects). All clients connect to the server and get proxies to those objects via remoting. When the client modifies a proxy object, the actual object on the server automatically gets updated (duh), and all connected clients recieve an event saying the object was modified, updating all the client GUIs and the client-side databases.
The only catch I see is when the client/server connection goes offline, the client must replace his proxy objects with actual objects read in from his local database. If that's the only catch, I'm willing to live with it.
My question is, is the above way ok to do real-time data synchronization? Would it be better to just pass around messages back and forth? The downside I see to passing around messages is the fact that I'll have to write a lot of code for the server to let all the clients know when an object has been updated. If any of you guys have any thoughts about this or have been down this road before, I'd love to hear it.
Thanks.
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
What's wrong with just using the BinaryFormatter with a TcpChannel and using events? Works in many in-house remoting apps I've written.
As far as handling offline occurances, you could write a custom RealProxy derivative that determines if the online server is available. If so, it creates the remote proxy. If not, it returns a local proxy. There's a good example of this (only geared for load balancing, but concept is essentially the same) in the "Microsoft .NET Remoting" book from http://www.microsoft.com/mspress[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the reply.
Heath Stewart wrote:
What's wrong with just using the BinaryFormatter with a TcpChannel and using events? Works in many in-house remoting apps I've written.
Ah good I was hoping you'd say that. Yeah, nothing wrong from what I can tell, thought it'd be good to ask the experts though.
Heath Stewart wrote:
As far as handling offline occurances, you could write a custom RealProxy derivative that determines if the online server is available. If so, it creates the remote proxy. If not, it returns a local proxy. There's a good example of this (only geared for load balancing, but concept is essentially the same) in the "Microsoft .NET Remoting" book from http://www.microsoft.com/mspress[^].
Interesting! But why use a RealProxy derivative when creating the actual objects would suffice? Maybe there's a benefit I'm not seeing; here I can have transparent proxies to remote objects if online, or the actual objects (read in from local database) if I'm offline. Can you tell me why I should use a RealProxy type instead?
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
Extending RealProxy lets you do just that pretty easily. You'll still need code that detects if you're online or not, and then creates the proxies accordingly. A RealProxy derivative gives you that kind of control at the source, so to speak. Besides, you can extend the TransparentProxy - it's generated at runtime.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Yoohoo - finally got my plugin thingy to work:
* Each plugin is loaded into its own thread
* No namespace or class name dependencys (thank you .GetInterfaces )
ok, this is a personal victory, I was working with this for a week now
Credits go to:
Leppie and Heath Stewert for pointing my compass in the right direction !
I ended up using a diffrent approach then the one you guys suggested but it got me started!
Matthew Hazlett
Windows 2000/2003 MCSE
Never got an MCSD, go figure...
|
|
|
|
|
Congrats! Finishing a tough part of a project is always exciting.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Is each plugin in a different AppDomain?
|
|
|
|
|
In my PluginTest app.... yes...
Matthew Hazlett
Windows 2000/2003 MCSE
Never got an MCSD, go figure...
|
|
|
|
|
In which case i'd be very interested to see that, i started trying to implement it myself a few weeks ago and got bogged down in various bits of documentation.
|
|
|
|
|
Heh, ok....
Your the second person to ask me this maybe I'll type up an article with what I learned. There are some great examples here like:
http://www.codeproject.com/csharp/PluginsInCSharp.asp
But i'll send you what I made, the code is rough and hasn't been tweaked (Theres a lot I want to add to it) but its a proof of concept. But you can run method's ETC from an external DLL.
I will email it to you.
Matthew Hazlett
Windows 2000/2003 MCSE
Never got an MCSD, go figure...
|
|
|
|
|
Is there a way to measure single character?
Graphics.MeasureString seems to be off.
For example if I have character "i", and the particular font I'm using it's one pixel wide, I'd like to know that it's 1 pixel wide. MeasureString adds some extra space.
|
|
|
|
|
Look at the System.Drawing.Graphics.MeasureCharacterRanges method, it should be all you need. Be forewarned: that method won't measure more than 32 characters. Call it recursively if you need to measure more than 32 characters.
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
MeasureCharacterRanges makes things even worse.
What i'm doing is drawing text on a curve, so I need to draw each character seperately, because each character is at different x, y position and different rotation angle. The way measurestring (or measurecharacterranges) work is that it looks like it's done using fixed width font.
|
|
|
|
|
You should also make sure that the StringFormat you're using has the StringFormatFlags.MeasureTrailingSpaces excluded.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am converting a C++ control to a .NET control. In the C++ control in the OnDraw() method I tested for AmbientUserMode, and painted the background with a hashed brush if !AmbientUserMode, or if AmbientUserMode used the BackColor property. How can I test for AmbientUserMode in C# controls?
|
|
|
|