|
Thanks Mike,
I have made some practices using regasm and following your comments. C# COM development is really defferent from C++ development from entry point.
I am using MSDN sample COM server,
http://msdn2.microsoft.com/en-us/library/t9yw5271(VS.80).aspx[^]
Then regasm will generate the following statements,
REGEDIT4<br />
<br />
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation]<br />
@="CSharpServer.InterfaceImplementation"<br />
<br />
[HKEY_CLASSES_ROOT\CSharpServer.InterfaceImplementation\CLSID]<br />
@="{C6659361-1625-4746-931C-36014B146679}"<br />
<br />
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}]<br />
@="CSharpServer.InterfaceImplementation"<br />
<br />
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32]<br />
@="mscoree.dll"<br />
"ThreadingModel"="Both"<br />
"Class"="CSharpServer.InterfaceImplementation"<br />
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"<br />
"RuntimeVersion"="v2.0.50727"<br />
<br />
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\InprocServer32\0.0.0.0]<br />
"Class"="CSharpServer.InterfaceImplementation"<br />
"Assembly"="CSharpServer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"<br />
"RuntimeVersion"="v2.0.50727"<br />
<br />
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\ProgId]<br />
@="CSharpServer.InterfaceImplementation"<br />
<br />
[HKEY_CLASSES_ROOT\CLSID\{C6659361-1625-4746-931C-36014B146679}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]<br />
I find only public class InterfaceImplementation is in the reg file, but public interface IManagedInterface is not in reg file. I think the reason is -- just as you mentioned -- only public public classes with no constructors, or a constructor that takes no arguments are in reg file. Is it correct?
I do not know why regasm only cares about public classes with no constructors, or a constructor that takes no arguments -- why interface is not in reg file?
regards,
George
|
|
|
|
|
Are there any Free Libraries available with C# binding for Playing Audio Video Content? As of now my options are Windows MCI and Direct X which I dont really want to use. Besides being able to play the multimedia content I'd like to have some control on the Audio Stream so that I can modify it (Equalizer Settings).
Thanks...
|
|
|
|
|
.NET 3.0 has capabilities for Audio/Video/3D
.NET 2.0 has capabilities for Audio/Less Video Capability than .NET 3.0
DirectX a video/audio standard for Windows
Windows Media Player ActiveX control has capabilities of both video/audio
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi
I have a problem working with MS Word interop.I create an instance of Word Application and I want to use it as a singleton object ( so I don't have to create another word application as long as a user is working with my application)
But if user opens a word document it will be opened using the word app instance that I've created and when he/she quits the word the word instance is gone thus I have a reference to a rpc server that is not available anymore and if i try to do somthing with it a RPC server is unavalilable exception will be thrown.
How can I check to see if a particular RPC server is still available?
Thanks alot
-- modified at 4:01 Saturday 14th July, 2007
|
|
|
|
|
The only way to check whether a cross-process object still works is to make a call to that object.
I'm not sure if Word offers a way for you to request that it should keep running even if the user closes the last frame window. I actually thought applications were supposed to keep running while there were still outstanding references - ensure you're not calling Marshal.ReleaseComObject anywhere.
|
|
|
|
|
Thank you.
I don't use Marshal.ReleaseComObject and I don't release the app reference that I've got either but It happens.
|
|
|
|
|
hi,
i have to play sound when user enter the mouse on toolstrip button,i have written followin code but it is not working.plzz help me out where is the problem
private void button5_Click(object sender, EventArgs e)
{
System.Media.SoundPlayer player = new SoundPlayer();
b=1
if (a == 1)
{
player.SoundLocation = "C:\\WINDOWS\\Media\\tada.wav";
player.Play();
}
}
private void tsbutton_MouseEnter(object sender,EventArgs e)
{
System.Media.SoundPlayer player = new SoundPlayer();
a = 1;
if (b == 1)
{
player.SoundLocation = "C:\\WINDOWS\\Media\\tada.wav";
player.Play();
}
}
thanks
-- modified at 4:33 Saturday 14th July, 2007
|
|
|
|
|
<br />
private void tsbutton_MouseEnter(object sender,EventArgs e)<br />
{<br />
System.Media.SoundPlayer player = new SoundPlayer();<br />
a = 1;<br />
if (b == 1)<br />
{<br />
player.SoundLocation = "C:\\WINDOWS\\Media\\tada.wav";<br />
player.Play();<br />
}<br />
}<br />
<br />
<br />
In this
<br />
a = 1;<br />
if (b == 1)<br />
{<br />
When your b will become 1 ? Is this is hiccup?
|
|
|
|
|
now plz check this out
private void button5_Click(object sender, EventArgs e)
{
System.Media.SoundPlayer player = new SoundPlayer();
b=1
if (a == 1)
{
player.SoundLocation = "C:\\WINDOWS\\Media\\tada.wav";
player.Play();
}
}
private void tsbutton_MouseEnter(object sender,EventArgs e)
{
System.Media.SoundPlayer player = new SoundPlayer();
a = 1;
if (b == 1)
{
player.SoundLocation = "C:\\WINDOWS\\Media\\tada.wav";
player.Play();
}
}
|
|
|
|
|
Hi,
some suggestions:
1. have only one SoundPlayer, make it a class member
2. dont use variable names such as a and b, no one understands them (including yourself)
3. have a bool "soundEnabled" which gets set/cleared by button5 and ...
4. have a bool "alreadyPlaying" to prevent multiple concurrent sounds
5. is MouseEnter handler first check soundEnabled, if false, dont do anything;
check alreadyPlaying, if false, set it true and start sound asynchronously
6. biggest problem will be how to clear alreadyPlaying since there is no event for end of
sound. Maybe a Forms.Timer is the way to go.
|
|
|
|
|
Hey,
I want to bring up multiple layout for my windows application. That is same application need have multiple view as same like our IDE, Center of the page we have text editor, bottom side compiler result, right side solution view etc., the same look and feel is possible in C# windows application? I have plyed around lot in VC++, now i would like to get the same in C#.
Can you please help out to me?
Thanks !
|
|
|
|
|
You want a sample which look like the Visual Studio IDE? You can try to look at SharpDevelop IDE. You can read their code to check how they wrote the multiple layout for C# windows application...
|
|
|
|
|
Is that code written in C#, since i want to build it using C#.
|
|
|
|
|
Yeah. It's in C#. Here is the URL.
But only one thing. there are too much of coding in it..
|
|
|
|
|
I do not see any URL, please send me again.
|
|
|
|
|
Did you move your mouse over the word "here"
Okay anyways.. here goes http://www.icsharpcode.net/OpenSource/SD/
|
|
|
|
|
My C# winforms app allows users to create documents. Embedded in a document is any author meta-data the author wanted to share, such as their website URL. Then, other users who open their document can click the URL entered by the author to have their browser opened to that page. My concern is that a malicious user, instead of entering his homepage into the URL field, will enter some kind of crazy URL that includes scripting code or some other internet exploit, which will do something bad to an unsuspecting user who clicks on that URL (sorry I'm not being more technical, but I don't really know how all these exploits work).
My question is this: Are there any specific characters or other junk that my C# app should filter out from a URL before sending it to the browser?
Thanks for the help!
|
|
|
|
|
You can regular expression for checking whether it's valid URL or not in your C# application.
here is the one that I google for you..
|
|
|
|
|
There's not really any point in trying to protect users from code in the url, as long as you are letting them link to a page of their own. They can put anything on the page they are linking to, and you can't check it. Of course you can check the url, but don't fool yourself (and your visitors) that it's safe just because the url itself doesn't contain anything harmful.
If you are afraid of malicious users, you should warn anyone that is clicking on a link that you don't have full control over, that they are moving to a page that might contain something harmful (or offensive, or illegal...).
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
i'm having a problem how to get a control from form 1 to form 2..for example:
i want gridview name dgvBlaBla from form1 can be access from form 2 ?_?
Can Anyone Help Me..I'm sorry i'm beginner in C#
Regard,
TCim
|
|
|
|
|
#1. Lets say there are two forms (form1, form2) in your application. you put one button called button1 in form2. You wanna get the control (button1) of form2 from form1.
Add one public property which is returned the control that you required in form2
eg:
<br />
public Button Button1<br />
{<br />
get<br />
{<br />
return button1;<br />
}<br />
}<br />
Then, you can access this control from form1.
eg:
<br />
Form2 obj = new Form2();<br />
MessageBox.Show(obj.Button1.Text);<br />
There are another way to get the control from other form or assembles. I'm not gonna mention here. If you are interest about this, please "Reflection" class from MSDN or google.
Hope it helps.
|
|
|
|
|
Thank You
It Helps Me solve My problem
Regard,
Tomi
|
|
|
|
|
You've got an answer already, but I'm asking myself why you want to do this? because I think there is a bit of a design problem here (information hiding? encapsulation?)
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
I have to write the event handler for MSCOMM.OnComm who is listening to serial port for data, so that the event is fired 'OnComm' is executed when the data is arrived.
My understanding for the documentation is unclear as how to achieve this.
Does any one have the sample source code implementation in C# / C++?
Thanks and Regards.
Amar.
|
|
|
|
|
If you're using .NET 2.0 (Visual Studio 2005), why are you even bothering with the MSCOMM control? There's a SerialPort class built into the .NET Framework under the System.Io.Ports namespace.
|
|
|
|