|
Hi All,
I implemented a C# class library and registered it to be visible for COM objects, then i used it from VB6 application and it works fine. Now the problem is that i want to raise an event in the .NET COM and pass it as an event in VB6. i.e. when the .NET COM catched an exception i want it to raise event in the VB6 application to log the event (because the logger works there). Any ideas?
Thanks,
Mayy
|
|
|
|
|
Throw a COM exception?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
How can i implement AutoScroll in Scrollviewer?
i want when i expand something inside it , Scroll var will automaticaly comes down ....
Any idea !!!!
Thanks in Advance !!!
|
|
|
|
|
I was just having this problem with one of my programs. What I had to do was create a single scrollviewer and then I had to embed a wrappanel or stackpanel inside of it. Then make sure the scrollviewer CanContentScroll property is set to false.
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[ ^]
|
|
|
|
|
I build an application in C# with crystal reports. If I try to use application in user's machine, when I open some crystal rep. I get this messagebox:
Cannot find keycodeV2.dll or invalid keycode.
Can somebody tell me what's the problem
kpp
|
|
|
|
|
Search Google. Crystal is notorious for this. Also, you can only redistribute binaries and not source with Crystal unless everyone has a license.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I have written a window service in C#. On windows XP it runs fine. I checked it on my computer and some other computers in office. I am able to install it on production system. But when i try to run this service i receive following error:
"ERROR 1053: The service did not respond to the start or control request in timely fashion"
I google on this error. Most of people are saying that Start method of service should return as soon as possible. In my start method, i am opening a file, making a socket and creating and starting a thread.
After this when i try to uninstall the service i got following error:
Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\game firewall\New Folder (4)\Firewall.exe' or one of its dependencies. The module was expected to contain an assembly manifest..
ANY BODY COULD TELL ME TO RESOLVE THAT PROBLEM?
|
|
|
|
|
Well, is that file there in the first place? Also, why on earth would you want to name an application folder New Folder (4) ?
If the file *is* there and you *want* that folder name, check the folder permissions. Then try opening it using ildasm.
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|
|
I have to copy again to uninstall the windows service. That is why "New Folder (4)" i am copying fourth time to uninstall the application and then trying to reinstall.
I have given all permission to administrator as well as creator. By using ildasm i compare uploaded exe file and local exe file. Both have same manifest also same structure of classes.
ANY OTHER HELP?
|
|
|
|
|
I have a ComboBox that is populated with values from a MS Access table. Next I use the below code to delete the record that is selected in the comboBox.
private void button3_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Magazi.mdb");
conn.Open();
OleDbCommand cmd = new OleDbCommand("DELETE FROM Suppliers WHERE Name=@Name", conn);
OleDbParameter parDel = new OleDbParameter();
parDel.ParameterName = "@Name";
parDel.Value = comboBox1.SelectedItem;
cmd.Parameters.Add(parDel);
cmd.ExecuteNonQuery();
conn.Close();
}
For some reason I get an "OleDbException was unhandled" message...
|
|
|
|
|
Plz. use "comboBox1.SelectedValue" rather than comboBox1.SelectedItem;.
|
|
|
|
|
SelectedItem.ToString(); might solve your problem. If you're adding objects rather than strings so your comboBox make sure you've overridden the ToString method.
|
|
|
|
|
Ok. I have tried some things and this what I get...
Using the below code and I have also display member, value member and SelectedValue of the comBox set to Name.
private void button3_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Magazi.mdb");
conn.Open();
OleDbCommand cmd = new OleDbCommand("DELETE FROM Suppliers WHERE Name=@Name", conn);
OleDbParameter parDel = new OleDbParameter();
parDel.ParameterName = "@Name";
parDel.Value = comboBox1.SelectedValue.ToString();
cmd.Parameters.Add(parDel);
cmd.ExecuteNonQuery();
conn.Close();
}
When I try to select a value from comboBox I get this message:
Column 'Name' is constrained to be unique. Value 'Champion' is already present.
|
|
|
|
|
Use this
comboBox1.SelectedItem.ToString();
|
|
|
|
|
Hi Guy
I seen your code in above. i seen may be ur combobox haven't a selected value may be pass null value, so error will raise.
and second may be comboBox haven't records. so verify both condition after get comboBox1.SelectedItem.
when directly to use comboBox value we must do validations.that's give error free to us.
thanks
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
Hi Guroos,
I want to send newsletter to all recipients. I do not want to write all email address in BCC. and Also do not want to write in TO box. What should I do?
Simply I want every member should get newsletter with his own email address in TO box.
|
|
|
|
|
AkmalSyed,
You could do it in a loop.
foreach (string email in emailCollection)
{
string header = "welcome to spammers are us!";
string body = "your message";
Email email = new Email();
email.Header = header;
email.Body = body;
email.EmailAddress = email;
email.Send();
}
|
|
|
|
|
Dear.
Please send solution in C#. I am using ASP.NET,C#
S.Akmal
|
|
|
|
|
Jamman wrote: Please send solution in C#. I am using ASP.NET,C#
It's rude to ask people to do your work for you. The poster gave you some useful advice. I suggest you use it to solve the problem yourself.
If you want someone to do you your work, go to Rent A Coder. This site is for people who want to learn.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi every buddy
i have to display a image on the page to how to do that?
image is a animated image,
plz help.
Rajeev Kr. Sharma
VRI Software Pvt.Ltd.
New Delhi India
HumOnline.com
Stay Connected
|
|
|
|
|
RajeevKumarSharma wrote: display a image on the page
If you mean a web page, you can use Img[^] tag
If you are trying to use display it in a form, use PictureBox[^] control
*jaans
|
|
|
|
|
private Bitmap MyImage ;
public void ShowMyImage(String fileToDisplay, int xSize, int ySize)
{
// Sets up an image object to be displayed.
if (MyImage != null)
{
MyImage.Dispose();
}
// Stretches the image to fit the pictureBox.
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage ;
MyImage = new Bitmap(fileToDisplay); HOW TO GIVE HERE FILE PATH WHICH EXIST IN MY PROJECT
pictureBox1.ClientSize = new Size(xSize, ySize);
pictureBox1.Image = (Image) MyImage ;
}
please look on the bold,under line text
Rajeev Kr. Sharma
VRI Software Pvt.Ltd.
New Delhi India
HumOnline.com
Stay Connected
|
|
|
|
|
Just use the relative path for fileToDisplay. Example: "cool.bmp" or "..\\images\\cool.bmp".
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|
|
RajeevKumarSharma,
You have to ways. Use Graphics to do it, or use a PictureBox. I am guessing your pretty new to C# so id go with PictureBox.
Regards,
Gareth.
|
|
|
|
|
This should do what you want
Bitmap pic = new Bitmap(fname);
xsize = pic.Width;
ysize = pic.Height;
// Adjust the position of the picture box
pictureBox1.Location = new System.Drawing.Point((0, 0);
// Adjust the size of the picture box
pictureBox1.Size = new System.Drawing.Size(xsize, ysize);
// Display the image
pictureBox1.Image = pic;
|
|
|
|