|
You're not the first idiot to ask this, nor will you be the last. Here are the issues:
1 - if you can't think for yourself, how can you hope to write code ?
2 - if you can't think for yourself, how is it likely your experience is so broad that any topic we suggest will show of the strengths of your experience ?
3 - how is it that whatever we suggest will be something that's likely to be at the right level to impress your teachers ?
It's a dumb question. You know what you're good at ( if anything ) and you know what you've been taught. You're the one who should decide the best project to give you a good mark at the end
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
I think you should aim to write a system that is fully capable of passing the Turing test. Don't let people put you off by saying it's defeated the finest minds in the industry - keep at it, don't sleep, eat, attend lectures, interact with humans in any way until you've completed this task.
Good luck.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: write a system that is fully capable of passing the Turing test
Yes, but what will he do after lunch?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Choosing a project for a dissertation (or even at the undergrad level) can be much harder than it sounds. I suspect many of the people criticizing your question have never selected a project for a dissertation themselves.
There must be an element of originality in your project; the more the better. The best topics are those that solve a previously unsolved problem, or that open up an entirely new area for research. Your own background, strengths, and interests are factors, as well as the current state of technology.
You want to find an area where you can make a contribution. Obscure corners of technology that haven't been extensively studied are good candidates. So is applying an existing technology to a new area where it hasn't been used before.
Another is areas that are cutting-edge, and so new that they haven't been extensively explored. In these new areas, discoveries you make probably haven't been made by others yet.
Look at areas you're interested in learning about first. This will provide more motivation for you to explore. Once you have an area, keep working on it, even though the end isn't in sight yet. You can make progress even when it looks like you're not making progress.
|
|
|
|
|
I need a way to pass messages inside my application in a queued fashion just like a Win32 message pump.
I need to insert the messages with one thread and retrieve them with a different thread.
Should I use the MessageQueue .NET class, or is there a way to send Window messages in Windows Forms?
Thanks for reading my post.
|
|
|
|
|
Are these messages for internal use in your application, or external also? If it's for internal you could use a Queue.
only two letters away from being an asset
|
|
|
|
|
They are completely internal to the application.
I was looking for something where I didn't have to implement the object locking and thread waiting parts involved in message passing between threads.
Do you know how to send a windows message in .NET? I already see how to receive them - override the WndProc method in the form.
|
|
|
|
|
Hi,
you could use P/Invoke to call SendMessage or PostMessage, providing a message code, wParam, and lParam.
however using a Queue, and adding a lock, would probably look easier.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
You're right about the easier part.
Plus, any data passed with the WM_COPYDATA message might be garbage collected before it gets used, so that would be a problem.
Thanks for the help!
|
|
|
|
|
If one instantiates a form by: myform = new asssetinq(), what 'variable' holds "myform"? In other words, if I have a string variable "formname" defined, and I wish to set this to the form name, how would the command "formname = ????" be written so that formname has the value "myform"? Tons of searching has not yielded a result, so any specific help would be most appreciated!
|
|
|
|
|
The strict answer is string formname="myform"; but that is not what you were hoping.
Variables are defined when you generate the source code, and seldom used afterwards (it would take reflection to get access to some of them).
Abyway, if you have:
Form form1=new Form();
Form form2=form1;
Form form3=form2;
which variable is "holding" the one form?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Point taken, although in playing with this, if you use "this" in various syntaxes, I'm getting the title bar verbiage. So things seem to know what form I'm working with. (This code is intended within the keydown event logic of a listview on a form, so even though a few forms may be in the works, the keydown event would be associated with a specific form. I'm just hoping there's a way to retrieve what the form name was. Long story short, I create the forms with a SCO unix process ID value, so these are variable. Short of setting a public string variable to my form name when I create the form, I was hoping there was something identifying that form name.)
|
|
|
|
|
When you create a form, you normally store its reference in a variable, as in MyForm myForm=new MyForm(); so you can always use myForm to act on that one Form.
Furthermore, event handlers associated to myForm get two parameters, the first one (object sender) can be cast to its owner's type to return the real sender, so MyForm me=(MyForm)sender; could be useful, although at the Form level, this most often is all that is required.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I instantiate the form in a proprietary language, using a "bridge" to the .net world. So this is not a 'normal' way of doing things. I will: "F_1098 = New ERUtil.assetinq();" to create the form in our application software (which is NOT C#), and this bridge makes it happen. "assetinq" is a 'normal' form created in Visual Studio, and so when I'm adding C# code to events associated with controls on this form, I'm finding the need to know what the form name is I've given it (F_1098 in this example), keeping in mind that the form was not instantiated in the C# code, so I don't know in the C# code what the form name is. So in the example below, of code supporting the keydown event of a control "list" on this form:
private void list_KeyDown(object source, KeyEventArgs e)
{
MessageBox.Show(this.ToString());
}
Shows me: "ERUtil.assetinq, Text: Asset Inquiry". Forgive my inability to comprehend your response Luc, as I'm getting my feet wet with C#, and am still far more used to procedural coding than object-oriented code, and C# as a whole. In my example, is there anyway I get "F_1098" into a string in this method, and if so, what specific commands would give me this? (I will assume this is not possible, and thank you for your responses anyway).
|
|
|
|
|
I still don't get the global picture.
It might help telling what you want to do with F_1098 later on.
Here are some facts, maybe they can help:
1.
genisyssoftware wrote: I'm finding the need to know what the form name is I've given it (F_1098 in this example)
F_1098 is NOT the name of the Form, at best it is the name of a variable somehow representing a Form.
The following do exist In System.Windows.Forms:
- Name: a string mainly used by Visual Designer to indicate the name of the variable that was used to create and hold a Control
- Text: the Form's title
- Tag: a free object, you can assign and use any way you like
2.
The name of a variable is pretty useless at run-time, unless your app needs to think about itself, and uses reflection, which is part of .NET
3.
Once the Form is created (with new) you can store its reference in as many Form variables as you like (I have shown that before).
4.
ToString() returns a string; by default it is the type string of the type it belongs to. You can override ToString() to return something else.
5.
Application.OpenForms returns a list of all open windows belonging to your app.
6.
you can store associations (i.e. key-value pairs) in a Dictionary.
Hope some of this may help.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Lots of helpful notes in your last reply Luc, so thank you. The tag value is giving me what I want. So I'm now setting the tag value to the name that I instantiated the form with, so I can retrieve this form "name" on the C# side. What I need to do in C# is send back to the server formatted commands that resemble what this gui "bridge" does. If I define a form name as F_938, I need to send back "3Click,F_938.SelectButton", for example, to the server. I started out a couple of years ago just creating forms in visual studio, and using this bridge (www.truegui.com) to give our character-based application a gui front-end. While this bridge allowed us to have a more appealing look to our application, there's a lot of I/O between the client and the server. I'm now adding more and more business logic on the C# side (the client side), which means less I/O communication needed between the client and the server (where our old legacy application is running). This is yielding an increase performance in our application, as we continue to migrate from a character-based application to a gui one. If you double-click a line in a listview, for example, the client sends "3DoubleClick,F_828.ListName" to the server, where I then have to ask for the index with "F_828.ListName.LastSelectedIndex?", and will get back the index value, and then I need to retrieve contents of that index with "F_828.ListName.Items[(index value)].Text?", and will get back "2Bob Johnson" for example." So in this simple example, there are 5 I/O elements. I can cut this down to 1 now by having the logic to retrieve the selected contents within the form. My initial question here was a result of me needing to know what "F_828" would be in some cases, so it can be used on the C# side, when the form was instantiated on the server side, through the bridge. I'm sure in this process, this forum will hear from me again Thanks again Luc.
|
|
|
|
|
You're welcome.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Luc - making progress here, but I'm a bit baffled by what is wrong here in this code:
public static void CloseAllForms()
{
MessageBox.Show("Number of open forms: " + Application.OpenForms.Count);
string tag;
int i=0;
foreach (Form frm in Application.OpenForms)
{
// frm.Dispose();
i = i + 1;
tag = frm.Tag.ToString();
MessageBox.Show("in loop, i="+i+" tag = "+tag);
}
}
What I'm trying to do is go through all the open forms that have a tag value populated, as those would be forms that I opened (The intial count that I display here seems to show more forms than I have opened, but I'll get to the bottom of this once I can figure out the simple things). In this code above, I'd sure think I'd be able to set the tag value to a string, and then display that in this loop. This code compiles, but when I execute it, I only get the initial count displaying, and I get one blank dialog box displaying. If I remove the "tag = frm...." line, the loop displays 4 or 5 times). So there's something I don't yet understand about how to access form names, or forms themselves. I think there's some issues with trying to set the "tag" variable above if the .Tag property has not yet been set on a form, and maybe that's my problem. But if you were to replace my code above with trying to loop through and display the .Tag property of forms, how would you do this? (Keeping in mind that not all open forms may have a tag value set).
|
|
|
|
|
genisyssoftware wrote: Keeping in mind that not all open forms may have a tag value set
You really should take your own advice here. What is in a Tag that hasn't been set by you?
And what happens when you execute null.ToString() ?
Suggestions:
- tell your IDE to always show line numbers in editor windows (for Visual Studio see here[^])
- put one big try-catch around the thing you are experimenting with, and within the catch show the entire Excecption.ToString()
- use the error messages and their line numbers to your advantage to pinpoint to location and cause of the problems you have.
genisyssoftware wrote: // frm.Dispose();
you shouldn't dispose of objects that still are referenced by some collection, unless the very next thing you do is killing the collection too. And you can't kill Application.OpenForms, it isn't even your collection.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
I implemented your try/catch suggestion (had to investigate the syntax here, as I'm a newbie), and this yielded the problem I had: you cannot set the .Tag property to a string if it is null. So I check for a null first, and things seem to be ok now. I'm still living in the "null is the same as a blank" logic which holds true in everything BUT C# in my experience But there are form names "AutogenForm" and "FrmMain" that are showing up in my "for" loop that I didn't instantiate, so that's why I need to only dispose of the "tagged" forms. (This may be a result of that 'bridge' I use, where maybe embedded - and hidden to me - is the instantiation of these forms, for whatever purpose they are for.). Your other suggestions here are worth noting, so thanks again Luc.
|
|
|
|
|
in many languages obj.method() or obj->method() is the way to apply a method to an object using a reference, sometimes simply called a pointer. You can dereference (i.e. use) a valid pointer, you can't dereference a null-pointer. Not in C/C++/Java/C# anyway.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
hey guys
I have this code:
axMedia.URL = Application.StartupPath + "\\playlist.asx";
it loads a playlist file and runs it in Media Player Addon.
PlayList file has nodes(tags) of links of websites
<Entry>
<ref href="www.blah.com/well.mp3" />
</Entry>
Am asking how can i check if there is a connection at all or not.
because there is no taste to load a file and computer has no connection to the net.
so before using axMedia.URL="playlist.asx";
i need to ask if there is already connection or not.
thanks.
|
|
|
|
|
Hi,
you can use P/Invoke and some Win32 functions to get Internet connection info; this:
enum LP_InternetConnectionState : int {
Configured=0x40,
LAN=0x02,
Modem=0x01,
OffLine=0x20,
Proxy=0x04,
RAS_installed=0x10
}
public static bool Connected() {
LP_InternetConnectionState description=0;
return InternetGetConnectedState(ref description, 0);
}
public static string ConnectionName {
get {
LP_InternetConnectionState description=0;
StringBuilder sb=new StringBuilder(512);
InternetGetConnectedStateEx(ref description, sb, sb.Capacity, 0);
return sb.ToString()+" ("+description.ToString()+")";
}
}
[DllImport("wininet.dll")]
static extern bool InternetGetConnectedState(ref LP_InternetConnectionState lpdwFlags,
int dwReserved);
[DllImport("wininet.dll")]
static extern bool InternetGetConnectedStateEx(ref LP_InternetConnectionState lpdwFlags,
StringBuilder name, int nameLength, int dwReserved);
should get you started.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi All,
I need to be able to connect to a database on a remote server without using an ODBC connection or anything of that kind. Does anyone know the parameters I would need to include in the connection string to achieve this?
Any help would be really appreciated.
Thanks
|
|
|
|
|