|
Hai Everybody,
Can any one tell be how to program with the Exchange Server 2003 in C# with the help of API's.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
I have one doubt on User32.dll.
Convert html to Image using c#.
i have download the code from the site http://www.codeproject.com/cs/media/IECapture.asp.
It is working fine in Winxp.
but windows 2000 throwing some errors.
I have debug--> it is problem in User32.dll doesn't support PrintWindow in Windows 2000
Please any one help me out from this
Subash
|
|
|
|
|
What are the exceptions that it is throwing?
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Thanks.Exception Is Entry Point cannot be loaded in User32.dll PrintWindow.
Subash
|
|
|
|
|
If you look at the bottom of this page[^] under "Requirements" from MSDN, you will see that the PrintWindow is only supported on XP and 2003.
From the page:
Windows NT/2000/XP/Vista: Included in Windows XP and Windows Server 2003.
Windows 95/98/Me: Unsupported.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Any other solution for it.
My Scope of the Project is I want to convert HTML or any web page to Image Format using Dotnet. Do u have any solution of it.Please let me know
Subash
|
|
|
|
|
Sorry, you would be better off asking the author of the article you got the original code from.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Dears
i made the service controller having in system tray.....
it work quite nicely but after some time
The Try Catch Message occurs "Can not Stop The New Service(Service Name) On Computer qasim(computer name)"
The code is just as
nStar()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if (sC.Status == ServiceControllerStatus.Running)
{
if (sC.CanStop)
{
// sC.Close();
sC.Refresh();
sC.Stop();
sC.WaitForStatus(ServiceControllerStatus.Stopped);
sC.Refresh();
sC.Start(strArray);
sC.Refresh();
btnConnect.Enabled = false;
btnStop.Enabled = true;
}
}
else if (sC.Status == ServiceControllerStatus.StopPending || sC.Status == ServiceControllerStatus.StartPending
|| sC.Status == ServiceControllerStatus.Stopped)
{
if (sC.CanStop)
{
sC.Refresh();
sC.Stop();
sC.Refresh();
sC.WaitForStatus(ServiceControllerStatus.Stopped);
}
sC.Refresh();
sC.Start(strArray);
//
sC.WaitForStatus(ServiceControllerStatus.Running);
sC.Refresh();
//
btnConnect.Enabled = false;
//
btnStop.Enabled = true;
}
}
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
OnStop()
//////////////////////////////////////////////////////////////////////////////
if (sC != null)
{
if (sC.CanStop)
{
sC.Refresh();
sC.Stop();
sC.Refresh();
sC.WaitForStatus(ServiceControllerStatus.Stopped);
MessageBox.Show("Service Stop Successfully");
btnStop.Enabled = false;
}
else if (sC.Status == ServiceControllerStatus.StartPending || sC.Status == ServiceControllerStatus.Running)
{
sC.Refresh();
sC.Stop();
sC.Refresh();
sC.WaitForStatus(ServiceControllerStatus.Stopped);
MessageBox.Show("Service Stop Successfully");
btnStop.Enabled = false;
}
Now How can i solve thsi problem
Qasim
|
|
|
|
|
Hello,
I tried in the past to use a windows form into my windows service. Some users here at code project pointed me out that a windows service is not intending to have a user interface, also because you can run a service without having the user logged in.
Now my experience, (not so big on that) learned me that my service 'crashed' read go to stop mode when some GUI components were called.
For example, the MessageBox.Show you are using, try to log the output to a file.
Also when you are doing the try catch, print the exception to the log for more information
ex.Message, ex.StackTrace ...
Once that you passed that and found out what is wrong you can decide to get rid of the UI elements (system tray icon ?) I'd love to have a service with a system tray icon where i can do stuff, but it didn't work out for me. So I used Remote.NET to communicate with the service.
Let me know more how it goes.
|
|
|
|
|
Hi,
I'm doing research on application similar to VNC Viewer or build-in Windows Remote Desktop Connection. Can anybody help mi with some basic ideas, links, what to aware of etc... I will be a .NET 2.0 Windows application (run on both comuters).
Thank you very much.
|
|
|
|
|
When i inser a break point and debug a c# programme i m unable to change the code in this mode(Debug Mode). I remeber previously i can change code in c# APplication.Has any body idea what reason may be ????? Why it is not allowing to change code while debugging.Now it gives follwing message on change of code "Changes are not allowed when debugger has been attached to an already running process or the code being debugged is optimized"
|
|
|
|
|
hi,
As far as i know you can make changes to the code during runtime only in a web application. You cannot do it in a windows application.
Thanks
Regards
Anuradha
|
|
|
|
|
That's strange, edit and continue only ever works for me in a winforms application. It never works for me in web apps.
You do need to make sure that you have "break all processes when one process breaks" checked (*This may or may not be the exact text)
Russell
|
|
|
|
|
Are you sure that you can't? Even when the execution point is inside the same method where you want change code?
...
But i think that is a dangerous practice... Sometimes when you change code often in debug mode applications behaviour change, or that's my experience. Because you change code, and seems that it don't applies changes... And when you're angry because you don't know where is the problem, you close VS, clean and rebuild your app and all is fine... That's my opinion...
Have you suffered this?
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Yes I M sure .I have told that i cannot change even within the same method .Dunot know whts happened to this application
|
|
|
|
|
You can, simply enable Edit And Continue as proposed in another post in the project options.
Although it will only work if the process was started by the debugger and not if the debugger is attached to the process.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Is "Edit and Continue" enabled? (Tools->Options->Debugging->Edit and Continue)
|
|
|
|
|
hi all,
I am using a datagridview to display contents of a xml file. say i have a xml file like this.
<xml version="1.0" encoding="UTF-8">
<maincategory>
<cat1>
<title>Category1</title>
<link>http://www.w3schools.com</link>
<description><img src="http://static.ibnlive.com/pix/sitepix/09_2007/flames_ramsetu90.jpg" >some description</description>
</cat1>
<cat2>
<title>Category2</title>
<link>http://www.ibnlive.com</link>
<description><img src="http://static.ibnlive.com/pix/sitepix/09_2007/rahul_gandhi_white90.jpg"
>some description</description>
</cat2>
</maincategory>
initially i display only the title of the category in the grid.
when the cell is clicked, i display title as well as description. when i click the cell again, only the title should be displayed.
i have managed to do this part.
the following code is for the first time click
if (cell_click_flag[rindex]==false)
{
TextAndImageCell cell = (TextAndImageCell)datagridview1.CurrentCell;
cell.Value = "";
cell.Image = Image.FromFile(Application.StartupPath + "//spacer.gif");
datagridview1.CurrentCell.Value = datagridview1.Rows[rindex].Cells["Description"].Value;
cell.Style.Alignment = DataGridViewContentAlignment.TopLeft;
cell_click_flag[rindex] = true; datagridview1.AutoResizeRow(rindex, DataGridViewAutoSizeRowMode.AllCells);
}
else if (cell_click_flag[rindex] == true)
{
//for the second time click
TextAndImageCell cell = (TextAndImageCell)dat.CurrentCell;
cell.Value = "";
cell.Image = Image.FromFile(Application.StartupPath + "//spacer.gif");
datagridview1.CurrentCell.Value = datagridview1.Rows[rindex].Cells["temp_title"].Value;
cell.Style.Alignment = DataGridViewContentAlignment.TopLeft;
cell_click_flag[rindex] = false; datagridview1.AutoResizeRow(rindex, DataGridViewAutoSizeRowMode.AllCells);
}
but when i again click the cell, only the title is displayed and not the description.i tried debugging, the value contains both title and description but only title is displayed.
I could not understand the problem.
Can anybody suggest me with some ideas?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
thanks guys. i solved it myself.
For anybody's reference, i included beginedit(true) and endedit() methods to update the cell values.
Thanks again.
Regards
Anuradha
|
|
|
|
|
I have one button and one listbox on same Form.
Inside InitializeComponent()
{
For button1 I have
this.button1.Click += new System.EventHandler(this.Button1Click);
and for listBox1 I have
this.listBox1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.ListBoxKeyUp);
}
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
void Button1Click(object sender, EventArgs e)
{
Console.WriteLine("Btn Clicked");
this.listBox1.Focus();
}
void ListBoxKeyUp(Object sender, KeyEventArgs kev)
{
Console.WriteLine("List KeyUp");
// My Code to Handle the Key Up
}
}
On Running the App and Pressing Enter on button1
The Output is
Btn Clicked
List KeyUp
All I actually wanted was to give (in button1's Click Event) the Focus to listbox1 and return. My listbox is actually a playlist and whenver Enter is pressed on it the selected entry starts to play. Only one click (via Keyboard) was made on button1 but listbox1's KeyUp Event also is getting fired.
Please Advice
Thanks...
P.S. The Code Works fine if button1 is clicked via Mouse
|
|
|
|
|
Well, what did you expect ? Here's the sequence:
1 - you press enter down. This clicks the default button. This gives the listbox the focus.
2 - you raise the enter key. The listbox has the focus, and so it fires.
Try handling keydown instead of keyup.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hmm. Right Christian. I think I've got a little confused here. The Results are supporting your view. Now If I handle KeyDown with listbox1 then it allows the user to keep the key pressed and the event will keep firing as long as the Key is down. I dont want that.
What is happening here is that the user is clicking the Button, the focus is shifting to listbox1 and a KeyEvent is being generated on listbox and my key handling code is getting executed. (Total KeyPresses 1)
What I really need is that the user should Press a Push Button (button1) and the Focus be transfered to my listbox1. Now if the User wants she may Press a Key (Enter) again to select an Item in listbox1. (Total Key Presses by user 2)
I think I've explained my problem clearly.
So what may be the proper way to achieve this.
Thanks...
|
|
|
|
|
I think I've found the Way
<br />
void Button1Click(object sender, EventArgs e)<br />
{<br />
Console.WriteLine("Btn Clicked");<br />
Application.DoEvents();<br />
this.listBox1.Focus();<br />
Application.DoEvents();<br />
}<br />
Why??? Goto http://www.thescripts.com/forum/post1334126-2.html
|
|
|
|
|
I don't see how that makes any difference, unless you're now beating a race condition by flushing the event queue.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I really dont have much Idea about that too. But my app has started to behave as was desired it to.
<br />
void clickHandler(---)<br />
{<br />
Application.DoEvents();<br />
<br />
<br />
Application.DoEvents();<br />
}
Without the Former Application.DoEvents() my code was unaffected
Similar Issue
Yes I myself am not convinced and will try to find a better solution.
Your Thoughts Please...
Thanks...
|
|
|
|