|
You would find a ton of examples on this web site if you only did a search. Here's one: http://www.codeproject.com/csharp/ConvertDOCintoOtherFormat.asp[^]
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
Thanks for the reply, the link which you send, i have tried the example. But implementing this example on a machine where only Visual studio.net is installed not Microsoft Office. But when i am trying to create the object of
Word.Application. I am unable to create the object, even i follow the given instruction like add reference "Microsoft Office 9.0 object library". still giving problem. so please help me in this regard.
Thanks.
Atul.
|
|
|
|
|
Hi,
Now i am able to create the object of Word class but while compiling the code it will give two errors. These are given below. But another thing is, is that necessary to give 15 arugument for Open methood and SaveAs method.
No overload for method 'Open' takes '1' arguments
No overload for method 'SaveAs' takes '2' arguments
Code is like this
newApp.Documents.Open(ref Source);
/*newApp.Documents.Open(ref Source,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,
ref Unknown,ref Unknown,ref Unknown,ref Unknown);*/
// Specifying the format in which you want the output file
object format = Word.WdSaveFormat.wdFormatHTML;
newApp.ActiveDocument.SaveAs(ref Target,ref format);
Please guide me in this regards.
Thanks.
|
|
|
|
|
The function is declared with that many parameters, IL doesn't allow / understand [optional] parameters like COM does (with which many of those parameters are attributed), so yes, yes it is necessary.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I try to get a reference to the main window of an application
i started but i always get a null.
That's the code i use.
ProcessStartInfo si = new ProcessStartInfo();
si.FileName="notepad.exe";
Process p =Process.Start(si);
IntPtr ptr = p.MainWindowHandle;
Form f = (Form)Form.FromHandle(ptr);
[...]f.Components.....
There's a way to reference such an object from the space of my
application?
Thanks.
|
|
|
|
|
Yeah, umm...notepad.exe is NOT a managed application, i.e. it has no "components". If Form.FromHandle even works (in essense, it's just a wrapper for a frames HWND), the components (or Controls ) collection won't contain anything.
At the very most, you could find all child HWNDs and try to associate them with their respective wrapper classes, but this is not a good idea.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
How can I adjust my IE .NET sandbox security level?
Sergiu.
|
|
|
|
|
In your administrative tools folder (in the Control Panel), use the Microsoft .NET Framework Configuration or Microsoft .NET Framework 1.1 Configuration.
Also, it's best to leave the defaults alone but add specific code groups to the appropriate policy (Enterprise, Machine (usually), and User).
Tip: for code to be run off the Internet via Internet Explorer (and touchless deployment), you can only use host evidence in your membership conditions (Site, Url) because IEExec doesn't gather assembly evidence like X.509 certificates and what-not.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Did you used .NET Framework 1.0 before? I think I got out of the sendbox with a my custom control. I ran this code and it works (and I think it shouldn't work):
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
OpenFileDialog dialog = new OpenFileDialog();<br />
if(dialog.ShowDialog() == DialogResult.OK)<br />
{<br />
System.IO.StreamReader r = new System.IO.StreamReader(dialog.OpenFile());<br />
MessageBox.Show(r.ReadToEnd());<br />
}<br />
}<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show(ex.StackTrace);<br />
}<br />
}<br />
I opened a file from the disk.
Sergiu.
|
|
|
|
|
Yeah, I'm a software architect and have done research deep into the frameworks.
It depends from where you're running your code. If you're running it locally, local assemblies have FullTrust which means they can do anything. From a network share, some things are allowed. Just look at the code group - taking into account the appropriate membership conditions - and you'll see what is and what isn't allowed.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
when i use = operator some times i have strange result :
sometimes it sets the value of object to anothre one and some times it set the refrence of an object to the other
so did any body knows how can i detarmine when it happen as example when i create a new class A inharits from ArrayList the instances of ojcets sets by value and if you use other classes the setting operator will use the reference .!!??
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
The behaviour of the assignment operator ( = ) differs between reference types and value types.
References types are types defined with the class keyword, and value types are the types defined with the struct keyword. All "simple" types in C# are value types, except for string which is a reference type.
Sample with value types:
int a = 10;
int b = a; Results in a and b beeing two seperate copies of the number 10.
Sample with reference types:
ArrayList a = new ArrayList();
ArrayList b = a; Results in a and b beeing two pointers to the same ArrayList object.
Have a look at my latest article about Object Prevalence with Bamboo Prevalence.
|
|
|
|
|
Dear sir,
i am sorry to tell you that you are not true so if you try the second sample (ArrayList) which you write you will find that the assignment had done by value not by referenc
just try it , if you make any changes in b it won't reflected to a which mean that this assignment have done by value
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
The code sample beneath show that the ArrayLists a and b are in fact the same ArrayList.
ArrayList a = new ArrayList();
ArrayList b = a;
a.Add("Hello");
b.Add("World");
foreach(string s in a)
{
Console.WriteLine(s);
}
Have a look at my latest article about Object Prevalence with Bamboo Prevalence.
|
|
|
|
|
Sorry i have i mistake in my code ....
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
You have a lot of nerve! The first reply is correct. You are the one asking the question which means you are the one that doesn't understand. The problem is reference types vs. value types.
If you would actually read the .NET Framework SDK you might understand. And where you're most confused is that while ArrayList is a reference type, any value types (i.e. Int32 , Enum , etc.) stored in the ArrayList are still value types and store a value - not a reference, and hence changing one won't change another.
See http://msdn.microsoft.com/library/en-us/csref/html/vcrefTypesS.asp[^] for more information.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
sory previosly i had a mistake in my code where i was using an array list but some where in the code i had used clone() method so so it is my falt.
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
The problem that you are facing is nothing but, you are not instantiating the object value initially.
Simple eg:
int i;
Now is a varible. Ok. The value that is there in that i might be any garbage value( might be 0 or and number from the garbage collector). Ok.
if it is like this
int i = 0;
Now the value of i initially is 0.
I think the problem that you are facing is something of this kind.
Hope my solution is some what relevant to your problem?
See you,
Vishnu. A,
BIT,
UC.
Vish_For_You
|
|
|
|
|
dear sir ,
you did not know the problem , the problem is that when you assign any object to other one if the assigning get comes by references , any changes in any one of the variables will be change the other one becase they are the difrent reference to the same instance by the the assignment comes by value it won't happen .
so ..........
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
Hi,
I want to seperate my toolbar buttons into 3 groups, therefore I hope to make 3 individual toolbars, and they must able to dock together under menubar and floatable when Drag it out.
If I need to make own toolbar control, how to do this? And I couldn't find any good example, could some experts help me, thank you ~~!
|
|
|
|
|
i've made a simple web server, but it cannot passing data from any script or form . I wanna know how to using ISAPI extension to pass the data from client to my web server. THX!! GBU!!!
|
|
|
|
|
First, wrong forum!
Second, you're ISAPI extension has to accept appropriate data from the form. See the article http://msdn.microsoft.com/msdnmag/issues/01/10/upload/default.aspx[^] for an example. There's some links at the bottom that discuss general ISAPI programming.
While the example is for files, the idea is similar (and more simple) for plain form data. Just like a GET query string that passes a key/value pairs separated by & and associated with =, POST query data is delimited in the same way but uses the content-type "multipart/form-data".
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Linking database with C# was easy but the problem that I faced when I was working on my project was when the database and the program was is in local drive(C) and working, then I cut that and put it in my network folder.
After that when I again copy that and put it in c drive and run it, then the links are changed and again I had to put all the links again. That is a rediculous task.
Can any one provide solution for this?
Vish_For_You
|
|
|
|
|
Links? You mean connection strings and what-not? Put the connection string in your application configuration file (yourappname.exe.config) using the <appSettings> section (see the documentation for that element for more information) and use the System.Configuration.ConfigurationSettings.AppSettings to get it out. This is pretty much the common practice for both Windows and Web Forms.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
That sounds helpful.
Thank you I will try that one and reply you.
Bye,
Vishnu. A,
BIT,
UC.
|
|
|
|