|
Hello
Pf course I'll assume you are doing this using COM interop. Actually the dll that's in your application's folder is something like a router. All it does is to call whatever version of Excel that's present on the user's computer to do the job.
So it all depends on the version that's installed on the runtime machine. To solve the issue you have two options:
1- In the reference list of your project try to set ht eIsolated property of the interop library to true -this tries to prevent version conflect, but sometimes doesn't work-
2- Make Excel 2000 as a "minimum requirement" for your application, so that users would know that have to have it on their machines.
3- Remove whatever features you are using that requires Excel 2000 to be on the machine -This is NOT guranteed to solve the issue. Actually it's likely NOT to work!-
4- You can also try 3rd party libraries which doesn't require Excel to be installed at all.
And for the solution suggested by Ista,it would work, but it's hard to implement specially with large applications such as Excel, as each dll may call other functions in other dlls.
Regards
|
|
|
|
|
Hi to all,
I want to perform DirectShow coding in VC# 2005. In that I want to set properties of 'Mpeg-2 Demultiplexer' Filter.
Regarding that I have code written in C++ as follows,
BYTE SeqHdr[] = { ... };
<br />
AM_MEDIA_TYPE mt;<br />
ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));<br />
mt.majortype = MEDIATYPE_Video ;<br />
mt.subtype = MEDIASUBTYPE_MPEG2_VIDEO;<br />
mt.formattype = FORMAT_MPEG2Video;<br />
<br />
mt.cbFormat = sizeof(MPEG2VIDEOINFO) + sizeof(SeqHdr);<br />
mt.pbFormat = (BYTE*)CoTaskMemAlloc(mt.cbFormat);<br />
if (mt.pbFormat == NULL)<br />
{<br />
}<br />
ZeroMemory(mt.pbFormat, mt.cbFormat);<br />
<br />
MPEG2VIDEOINFO *pMVIH = (MPEG2VIDEOINFO*)mt.pbFormat
This code is obtained from http://windowssdk.msdn.microsoft.com/en-us/library/ms787857.aspx[^]
How to Convert it into C#? What is the interface for 'MPEG2VIDEOINFO' in C#?
Thanks & Best Regards,
Aniket
|
|
|
|
|
Search for the DirectShow.NET lib on SourceForge. Then once you have it figured out, write an article
|
|
|
|
|
leppie wrote: Search for the DirectShow.NET lib on SourceForge.
I have DirectShow.NET lib. And I have designed a filter graph using it in C#. But when I tried to set properties of 'Mpeg-2 Demultiplexer' Filter using IMpeg2Demultiplexer Interface in C#. This I have done in VC++, for following properties I failed to convert in into C#.
memset(&Video_Info , 0x0 , sizeof(MPEG2VIDEOINFO));
#if !USE_DUMP_EX_FILTER
pMediaVideoType.cbFormat = sizeof(MPEG2VIDEOINFO);
#endif
#if !USE_DUMP_EX_FILTER
pMediaVideoType.pbFormat = (BYTE *)&Video_Info;
#endif
( pMediaVideoType is of 'AMMediaType' DataType). I didn't found Interface 'MPEG2VIDEOINFO' in C#. What should be done to set this properties?
Plz, help me.
Regards,
Aniket
|
|
|
|
|
Is there any way that i can receive any arguments from any Audio or media files or vice versa? ex: mp3 !!!
please help me !!!!
|
|
|
|
|
Tell it you don't like its mother - That'll usually start an argument.
|
|
|
|
|
Hello
What is exactly your definition of "arguments"? Maybe you mean metadata??
Regards
|
|
|
|
|
Parameters
|
|
|
|
|
Hello
Parameters??!! How and why on earth would you send or receive parameters from a file?? Are you joking?? Post more details on what exactly you are trying to do.
Regards
|
|
|
|
|
like fscommand("Commandname","argumant") in flash that cause an argumant from swf file send to C#.
forget anything about my question.i can manage it myself, otherwise i have to spend many time to write that u get my mean.;P
|
|
|
|
|
Hello All,
My requirement is that after I access a machine as \\machinename, I want to see if Printers and Fax folder is listed or not.
Please point me to any sample code or APIs that can enumerate the objcets in the \\machine window or see if an item exists in the window or not.
I see that there are couple of shell APIs like but I didnt know how to use them for my case.
Thanks in Advance...
|
|
|
|
|
Hello
Actually you won't be seeing any printers on that machine unless they are shared, otherwise it would be hacking. If the printer is already shared on the network, then why not acces it from your machine?
Regards
|
|
|
|
|
Thanks for the reply Nader.
Actualy Couple of printers are shared on the machine and I can safely access them. But my requirement is to find if the Printers and Fax folder is listed or not.
Thats I was thinking of enumerating the objects in the window and see if one of the objects is "Printers and Fax" folder.
Please help.
Thanks
|
|
|
|
|
Hello
Well, now I see. Two approaches:
1- Access "\\Computer" and try to enumerate everything on it. This will depend on how you access it.
2- If you you just want "Printers and Faxes" then in a try to access it by "\\Computer\Printers and Faxes"
Regards
|
|
|
|
|
Hello ...
I access another machine from the run command.
I use Process.Start(@"\\" + sMac); and it opens the window for me. Let me know how do I enumerate the objects now.
Also "\\Comp\Printers And Faxes" didnt work for me. Its says no network provider has accepted the path. Let me know if its the right usage.
I think there must be some WMI scripting as well to enumerate the list.
Any piece of source is fine with me.
Thanks in Advance.
|
|
|
|
|
Hi,
I have an html page (with tags) and i want to remove html tags of this page.
I just want keep some elements on this page and remove another.
How can i do that, please ?
Thanks for ur answer.
PS: My page is in WebResult (string type)
A piece of my code:
<br />
string WebResult = string.Empty;<br />
try<br />
{<br />
System.IO.StreamReader MonReader = new System.IO.StreamReader(WebClient.OpenRead(UrlFichier), System.Text.Encoding.ASCII);<br />
WebResult = MonReader.ReadToEnd();<br />
}
|
|
|
|
|
Hi,
Do you know which tags you dont want? If yes then create an XmlDocument from the data in WebResult and search for the tags you want to remove, and remove them !
You can also use XmlNavigator for this purpose.
XmlDocument doc = new XmlDocument(WebResult);<br />
XmlNode xn;<br />
XmlNode tempNode;<br />
string returnVal ="";<br />
try<br />
{<br />
<br />
xn = doc.DocumentElement;<br />
<br />
foreach (tempNode in xn.ChildNodes)<br />
{<br />
if(tempNode.Name == "html tag name")<br />
{ <br />
xn.RemoveChild(tempNode);<br />
}<br />
}<br />
returnVal = doc.InnerText;<br />
}<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
}
Also there are various methods for node removal in the XmlDocument class. Please go through them!
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
You could use regular expressions in order to match the tags you want removed, and then simply replace them with string.Empty.
For instance, if you want to find a tag, you could use the <img [^>]*?> regular expression:
Regex r;<br />
Match m;<br />
<br />
r = new Regex(@"<img [^>]*?>",<br />
RegexOptions.Singleline | RegexOptions.IgnoreCase);<br />
<br />
for (m = r.Match(WebResult); m.Success; m = m.NextMatch())<br />
{<br />
WebResult = WebResult.Replace(m.Groups[0].ToString(), "");<br />
}
You can also group matches into groups, so for instance if you have a <a ...> linked text </a> , you could use <a [^>]*?>(?<1>.*?)</a> regular expression, that will replace the whole match of the regular expression with the group 1 text (that is the linked Text in the exemple), like:
r = new Regex(@"<a [^>]*?>(?<1>.*?)</a>",<br />
RegexOptions.Singleline | RegexOptions.IgnoreCase);<br />
<br />
for (m = r.Match(WebResult); m.Success; m = m.NextMatch())<br />
{<br />
WebResult = WebResult.Replace(m.Groups[0].ToString(), m.Groups[1].ToString());<br />
}
You can use RegexBuddy[^] to construct oyur regular expressions. It has a 30 perdiod evaluation and it's really easy to use it, because it explains every element and what it does. You can also test your regex. I also recommend a Regular Expressions Tutorial[^]. You fill find regular expressions to be really usefull in other situations as well, and they are also faster than any string parsing code you will write.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
hi all
my problem is when i try to open an excel workbook, it gives a runtime ComException in win2K where in XP its working fine
Code is
Excel.Workbook wb =wbs.Open("mtc.xls",false, Type.Missing, Type.Missing, Type.Missing, false, Type.Missing, Type.Missing,true, Type.Missing, Type.Missing, Type.Missing,Type.Missing);
Can anyone suggest an idea??
Thanks in Advance
Akhil
|
|
|
|
|
Are you talking about Office 2000/Office XP? (the Office you are trying to automate)
Or Windows 2000/Windows XP? (the OS on which you run your program, also which versions of Office are installed on each of them?)
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Hi
There are some mp3 files with their text, i want to set it ,when a sentence
of mp3 is heard , in parallel i can set exactly that sentence show as a text.
How could i sync these together?
|
|
|
|
|
Your program should be able to get the playtime and depending on it you show the apropriate text. For instance if your playtime for your mp3 is at 1'30" you should show the text that coresponds to the the one spoken at that particular time.
It's an approach that subtitles for movies use.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
thanks , but i dont think it could be possible , because i have many mp3 files and many text for them , so it waste many times.
C# couldnt receive any argument from Mp3 files?(like flash object that could send argument to C#)
|
|
|
|
|
There is nothing in the MP3 file that says "place your text here", so there is nothing to get from the MP3 file. You'll have to put the text together yourself and figure out the timing by hand. The MP3 won't have any information to do this automatically.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have some code that I need to include in my project. The code is organized in a directory structure, such as:
Directory1 - Directory2 - Directory3 - Lots of C# files.
- Directory4 - Lots of other C# files
I right click on the project, and select Add Existing Items, but it would not retain the directory structure, all files are added to the project directory.
If I want to retain the directory structure, the only thing I can do is to manually create a directory structure as the structure of the external code. Go to each directory and import the files in the corresponding directory of the external code.
Its the same for both Visual Studio 2003 and 2005.
Is there a better way to do it ? Or let me rephrase my question, what would be the best way to include a whole external directory structure to your project ?
Thanks for your help.
|
|
|
|