|
Assalam-0-Alaikum
Are you willing to do it on ClientSide or ServerSide?
Regards.
Atif Ali Bhatti.
|
|
|
|
|
Alaikum Assalam.
He is talking about a Winforms app.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
|
Thanks! I'll take a look. This works fine in other systems, so there has to be a solution.
The PetroNerd
Walt Fair, Jr.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Well, I looked at the links you provided and realized I had already checked them before posting my original question here. However, I also have done some more troubleshooting - and still have no idea what I'm doing wrong.
I now removed the MouseClick event totally and replaced it's behavior with the SelectionChanged event. I still don't get the MouseDoubleClick event firing until the 3rd mouse click. I even removed the SelectionChanged event - same thing - it takes 3 clicks to get the MouseDoubleClick event.
I guess I still have some more playing around to do. My random thought is that maybe the MouseMove event or something else is interfering, but I wouldn't have expected that at all. Is it possible that the list control doesn't have focus and it takes an extra click to get focus, then start with the double click? As you can probably tell, I'm grasping now.
Thanks for the links and at least it got me thinking along a different line.
The PetroNerd
Walt Fair, Jr.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Assalam-0-Alaikum,
Well why the MouseDoubleClick event is taking 3 clicks to fire is due to the fact that you have to rollback the activity performed during the first click.. this is very important point to keep in mind. after rolling back the first click event activities, you are supposed to handle the double click event.
Hope you get my point.
Regards.
Atif Ali Bhatti.
|
|
|
|
|
Maybe I'm just dense, but I don't get the point.
As I mentioned in another post in this thread, I've disabled the MouseClick event. It doesn't have a delegate, it doesn't do anything, the event handler has been deleted. There doesn't seem to be anything to roll back.
The only mouse event I have active with a handler is MouseDoubleClick.
And it still takes 3 mouse clicks to get it to fire.
Obviously I'm missing something or .....
The PetroNerd
Walt Fair, Jr.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Actually it's a desktop app, no client or server involved.
The PetroNerd
Walt Fair, Jr.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I have an exe file built in .Net 1.1
I use the System.Web.Mail class to send an email...
when i run the executable locally say by double clicking the file the program runs fine and i receive the email.
However the purpose of the exe is to be run from a website that i have developed by using ProcessStartInfo. Under this scenario i get the error
'Could not create CDO.Message object'
Now i did all the correct checks as having permission to cdosys.dll and making sure the user ASPNET and NETWORK SERVICE have full permissions to the exe. As stated before the code runs perfect when run by double clicking the exe but not when run by the web app im running on my localhost.
|
|
|
|
|
I found a Swedish article with someone running into a similar problem. I don't know the exact wording of the message - he only wrote something about the code "not being able to access the CDO.Message object" (in Swedish), which may or may not boil down to the same message.
In any case - he solved the problem by recursively looking at the InnerException of the exception thrown and so on. Turned out to be a really simple mistake (missing e-mail address), but the original exception was a bit misleading.
Try do something like this:
try
{
}
catch (Exception ex)
{
Response.Write(ex.ToString());
Response.End();
}
(note: written as if it were a web app, which your exe probably isn't. Response.Write won't do you any good then, of course - use whatever's appropriate)
Later,
--
Peter
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Text;
namespace WindowsApplication1
{
class Pupil
{
public int ID;
}
static void Main (string[] args)
{
Pupil Patrick = new Pupil();
Pupil Cathy = new pupli();
.....................................................................
using System;
using System.Collections.Generic;
using System.Text;
namespace WindowsApplication1
{
class Homework
{
public int numberofWork;
public string keyword;
}
static void Main (string[] args)
{
Homework Patr = new Pupil();
Homework Cath = new pupli();
.......................................................................
Am getting error message Expected class delegate,enum,interface or struct.
Any guidance on how I may rectify this?
|
|
|
|
|
Looks like you're missing closing curly braces.
Also you're headed for casting problems unless you fix the last 2 lines in your example.
Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.”
-Edsger Dijkstra
|
|
|
|
|
First code snippet:
Change pupli to Pupil.
Second code snippet:
Change Pupil to Homework.
Change pupli to Homework.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Angelinna,
How come you have two program entry points:
static void Main (string[] args)
Also, it's a good idea to use Properties, instead of public variables.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Your main method isn't in a class. It's just sitting there within the namespace. You need to have something like:
namespace myApp
{
class stuff
{
}
class Program
{
static void Main (string[] args)
{
}
}
}
So that everything is in a class.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Am totally confused. Not getting any where.
|
|
|
|
|
Your Main method just needs to be in a class, thats what the error is saying. The compiler expected a class or struct etc. but it found a method, so it gave you the error.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Am practising on writing classes from an exercise that requires hardcoding values into a program.
Task requires
1. defining a class Pupil and a class Homework
2. Containing data for two sample Pupils and their homeworks(hardcoded in the program)
3. Lets the user enter the keywords to be checked for
4. Let the user request to see the homework data of a pupil
Hard coded data/values like
John Kay
67890
initial sentence ;= There was a tiny little.....
Words; = 200
keyword; = overwhelming
Woul really appreciate your thoughts on the approach
Angelinna
modified on Tuesday, May 20, 2008 9:59 PM
|
|
|
|
|
1 - I think you had this OK, just define classes
2 - Create two pupils and their homework in your static void main, and pass in the values
3 - Accept user input and then check your items to see if they match
4 - accept user input to select a pupil, and output the contents of their homework.
Is this a console app or a windows one ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
What i understand from reading all the posts is
You can't initiate
Homework Patr = new Pupil(); //Simply can't do that
Homework is different type and Pupil is different type
it is same as doing
string Patr = new int();
You must derive your Homework class from Pupil or take a object of Homework in Pupil
|
|
|
|
|
I think you're a bit confused on classes here - you need to do some serious research and study.
I'll try to help a little but I'm not doing it for you - I'm sure you wouldn't want me to!
Let's look at a Pupil class.
There's many ways to create a class, but I find the easiest is to have four sections (or regions - you can actually use this word in your code!).
1. Member variables - declare these as private so only the class itself can modify them.
2. Properties - public so they can be accessed outside of the class.
One benifit of the above two over a single public variable is the property get and set methods can alter/filter/validate the data. There a many others but this isn't supposed to be an article!
3. Methods - these actually do stuff with the data and if necessary return a value of any type needed.
4. Constructors - these are used to create an instance of your class.
This is an example Pupil class - see if you can follow what's happening. When you understand *EVERY* line you may be ready to attempt the task you've posted. This code won't work fully without some work and understanding from you as it references 2 other classes - Homework and PupilHomework . I'm leaving it up to you to create those, make them interact with the Pupil class, and add any neccesary enhancements to the Pupil class.
public class Pupil
{
#region Member Variables
private int m_ID;
private string m_Name;
private List<PupilHomework> m_HomeworkList;
private static int lastID = 0;
#endregion
#region Properties
public int ID
{
get { return m_ID; }
}
public string Name
{
get { return m_Name; }
set { m_Name = value; }
}
public List<PupilHomework> HomeworkList
{
get { return m_HomeworkList; }
}
#endregion
#region Methods
public void AddHomework(Homework homework)
{
m_HomeworkList.Add(new PupilHomework(homework.ID));
}
#endregion
#region Constructors
public Pupil(string name)
{
m_Name = name;
m_ID = ++lastID;
m_HomeworkList = new List<PupilHomework>();
}
#endregion
}
Dave
|
|
|
|
|
Thanks Dave. You have been most helpful
|
|
|
|
|
No problem. Post back if you have any more problems
Dave
|
|
|
|
|
When I used to code console apps for C++, my program could take runtime arguments, like
int main ()
{
return 0;
}
How can I do something similar to this in C#? I am running a windows form application, and when I tried static void Main(string open) it gave me an error saying it wasnt a proper place for program entry.
How can I accomplish this?
Thanks in advance.
|
|
|
|
|
That Asian Guy,
static void Main(string[] args)
Regards,
Gareth.
(FKA gareth111)
|
|
|
|