|
Sounds like a school boy's homework question though.
|
|
|
|
|
I have no idea what you are talking about. I answered the original poster's question, although it wasn't much of a question. What is your problem?
Paul Marfleet
|
|
|
|
|
better shut your mouth
|
|
|
|
|
hi all,
Is it possible to display an image in all buttons in a
datagridview(Windows Forms) button column?
if yes,
can anybody help me how to do it?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
I have a Class Library in which i have lot many functions to implement my service but the problem is maximum of functions are Having similar names and similar parameters etc. when i want to use any of these functions i am some what confused which one is the one which exactly i shoould use. So is there any way to "Provide the Description of the function" along with the Prototype of the function which comes as default due to intellisence of MicroSoft.
I tried the [Description("xgdfgdfg")] attribute above the function defination but no use.
Can any body know how to get the user defined description for a function
Thanks in Advance.
|
|
|
|
|
Hi,
just type /// before your function name , VS will then build some 'comments tags' you just have to fill.
such as
///
/// my summary for intellisens
///
/// <param name="a_parameter" />my param descr. for intellisens
Hope it helps
|
|
|
|
|
Wow.........
It really helped...
Thanks grim.
|
|
|
|
|
oops < > where missing
/// <summary>
/// my summary for intellisens
/// </summary>
/// <param name="sender">my param descr. for intellisens</param>
|
|
|
|
|
What you are looking for is known as XML comments. They provide a lot of documentation possibilities for you code. You can look on MSDN or Google for "Xml comments" and find a lot of information about them. The Description attribute is a runtime concept and doesn't have any affect on the Visual Studio IDE.
|
|
|
|
|
Hi iam new to window services.
I developed a window application which is an desktop alret.
I need to run this application with a window service.
Is there any way to use window applications in window services.
Help me out from this.
Lakshmi.
|
|
|
|
|
Never tried it, but you can try building you windows application as a class library (dll file) from Project Properties->Application->Output type->Class Library. After that you can add to you windows service as reference, and open the form(s) whenever you want. This way your windows application doesn't have to be at specific path.
Hope it helps.
Do your best to be the best
|
|
|
|
|
Hi
I tried the way you said, but iam not getting the result.
Is there any other way? Please do inform me.
Lakshmi
|
|
|
|
|
Hi,
There are several ways try this.
1. First create windows service application(minimal application)
2.
<br />
private static Form Form1;<br />
protected override void OnStart(string[] args)<br />
{<br />
Form1=new Form();<br />
base.OnStart(args);<br />
<br />
}<br />
Ravi
|
|
|
|
|
I would suggest that the best way would be to refactor the application logic away from the form (into a dll) and refactor the form to use this. Then you can create a service project to call the relevant app code.
Paul
|
|
|
|
|
You really shouldn't do this. What you are looking for is a service that has the "Interact with desktop" option selected. This is not recommended practice. Services are intended to be run at the system level, even when someone is not logged in so they aren't supposed to have any UI.
To do what you want, you need to create a Windows service and a Windows client application (2 different executables). The client application can run at Windows startup (when a user logs in). When the service needs to display an alert, it needs to inform the client application that there is something to display to the user. There are a lot of different ways to do this, from shared memory to remoting/wcf calls.
|
|
|
|
|
hi there,
i placed a picture box in my app, and i want to open image through the data which is in byte[]
can some tell how?
Becoming Programmer...
|
|
|
|
|
You need to assign that byte[] to be the contents of a MemoryStream ( from memory ) and then you can construct a Bitmap using a Stream in the constructor.
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 )
|
|
|
|
|
Hy,
<br />
byte[] buffer;
Bitmap bmp = new Bitmap(width, height);<br />
BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);<br />
Marshal.Copy(buffer, 0, bmpData.Scan0, buffer.Length);<br />
bmp.UnlockBits(bmpData);<br />
This is an example of how I used to copy rgb values from a byte array to a bitmap. Of course you have to know the width, height and pixelformat of the image.
Hope it helps,
Do your best to be the best
|
|
|
|
|
Yep i know pixel format (BGRA)
ok buddy i will try then tell you the result
Edited
yeah its working but i have problem that is my format is in BGRA and i didnt find any PixelFormat for it so i convertered my format to ARGB but it isnt showing anything but if left it as BGRA then its showing half correct pict
can you please take a look on the codes
byte[] byt = new byte[0];
.............................................................................
.............................................................................
.............................................................................
byte[] dirtybyt = new byte[width * height * 4];
fs.Position = offset;
fs.Read(dirtybyt, 0, width * height * 4);
byte[] temp = new byte[width * height * 4];
for (int i = 0; i < width * height; i++)
{
temp[i * 4 + 0] = dirtybyt[i * 4 + 3];
temp[i * 4 + 1] = dirtybyt[i * 4 + 2];
temp[i * 4 + 2] = dirtybyt[i * 4 + 1];
temp[i * 4 + 3] = dirtybyt[i * 4 + 0];
}
byt = temp;
.............................................................................
.............................................................................
.............................................................................
Bitmap bmp = new Bitmap(width, height);
BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
Marshal.Copy(byt, 0, bmpData.Scan0, byt.Length);
bmp.UnlockBits(bmpData);
pictureBox1.Size = new System.Drawing.Size(width, height);
pictureBox1.BackgroundImage = bmp;
-- modified at 2:52 Wednesday 3rd October, 2007
-- modified at 3:03 Wednesday 3rd October, 2007
Becoming Programmer...
|
|
|
|
|
The code seems to be OK. It's important how you read from the file and copy the data into the byt array.
Do your best to be the best
|
|
|
|
|
hi friends i have tried to send sms to india through my application but unable to send it the code is as follows
protected void Send_Click(object sender, System.EventArgs e)
{
try
{
SmsTest.net.webservicex.www.SendSMS smsIndia= new SmsTest.net.webservicex.www.SendSMS();
SmsTest.com.webservicex.www.SendSMSWorld smsWorld = new SmsTest.com.webservicex.www.SendSMSWorld();
if(rdoType.SelectedValue == "1")
smsIndia.SendSMSToIndia(txtMobileNo.Text.Trim(), txtEmailId.Text.Trim(), txtMessage.Text);
else
smsWorld.sendSMS(txtEmailId.Text.Trim(), txtCountryCode.Text.Trim(), txtMobileNo.Text.Trim(), txtMessage.Text);
lblMessage.Visible = true;
lblMessage.Text="Message Send Succesfully";
}
catch(Exception ex)
{
lblMessage.Visible = true;
lblMessage.Text="Error in Sending message"+ex.ToString();
}
}
protected void rdoType_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(rdoType.SelectedValue =="1")
txtCountryCode.Enabled = false;
else
txtCountryCode.Enabled = false;
}
}
}
and the exception is
Error in Sending messageSystem.Net.WebException: The remote name could not be resolved: 'www.webservicex.net' at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at SmsTest.net.webservicex.www.SendSMS.SendSMSToIndia(String MobileNumber, String FromEmailAddress, String Message) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\smstest\e1b64363\4f679e02\App_WebReferences.dvkrcwdj.1.cs:line 46 at SmsTest.WebForm1.Send_Click(Object sender, EventArgs e) in c:\Documents and Settings\Tapi-net\Desktop\SmsTest\SmsTest\SendSms.aspx.cs:line 52
so will u please help me out.
thanking you in advance.
Amol Pate
|
|
|
|
|
Your code is a black box, no-one here can help you unless they have used that webservice. The problem is lower down than this code. Your best bet is the documentation of the web service you are trying to use.
I can see www.webservicex.net, I wonder if you have network issues ?
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 want to bind a dataset in SQL reporting services. My procedure outputs data from 3 select statements. But when i try to bind it in
reporting services,the dataset shows the resultset of only the 1st select statement
of the proc.
In all my reports before, I had used only 1 select statement to output data in the proc
and they had all worked fine in reporting services. What should I do to get the
resultset form all three select statements in the dataset.
|
|
|
|
|
I was trying to create a Generic class and a Generic method inside. Please check the following code
class Program
{
static void Main(string[] args)
{
MyClass<int, string> m1 = new MyClass<int, string>();
Console.WriteLine(m1.Calculate(10));
Console.Read();
}
}
class MyClass<T,F>
{
public F Calculate(T t)
{
ObjArr.Add(t);
}
}
In this I am giving two generic types for MyClass. I have supplied int and string there. My generic function (Calulate()) returns type F, which is instantiated as string. Now how will I return the type from Calculate() method ?, because we are not getting any objects for type F ? Any help would be appreciated.
-- modified at 2:10 Wednesday 3rd October, 2007
|
|
|
|
|
Did you escape "<" with "&lt;"? The code isn't correct as-is.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|