|
Hi folks,
Is C# is suitable for real time image processing.... ?
comments plz...
|
|
|
|
|
|
I’m writing a distributed app. I have a web service and windows form. In my form I have declared an instance of the web service like so:
WindowsForm.localhost.service1 ws = new WindowsForm.localhost.service1();
The web service has a web method that sets a string and another web method that retrieves it. The string (m_word) is initialized to “ “ (space).
This is what I’m trying:
Some button event handler ()
{ ws.SetString(this.textbox.text); }
Other button event handler()
{ this.Lable1.text = ws.GetString(); }
What I’m expecting to happen it the word from the text box will appear in the lable but it doesn’t. Its as if I’m typing this.
Some event handler()
{
WindowsForm.localhost.service1 wsA = new WindowsForm.localhost.service1();
WsA. SetString(this.textbox.text);
}
Some other event handler()
{
WindowsForm.localhost.service1 wsB = new WindowsForm.localhost.service1();
this.Lable1.text = wsB.GetString();
}
I know this is a bit cryptic so if any one need clarification let me know. I think I’m missing something about how web services’ live.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
My understanding of your problem is this:
in the first event, you are creating a webservice object wsA, whose string variable you set to a particular value.
But then when you call the function GetString() its on an entirely new object of the webservice class.So technically you should get " " back as the result.
You need to use the same instance of the class to persist the value.
So instead of creating a new object of webservice class, call the GetString() on wsA instead of wsB.
HTH
Cheers!
<bold>Looney Tunezez
"If you build it....
.....BUGS will come!" -JB
Application.Run(new Form1(this.Dispose())); <--WHAT :wtf::confused::eek:
"Stability. What an interesting concept" - Chris Maunder
<bold>
|
|
|
|
|
Yeah I got all that. In the first part of my question I said that I have a global Web service declared and I’m using it in my functions but when I use it from two function calls It looks like I’m getting two different instances of the web service.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
Can you post the code for the web service class? Maybe something is wrong in there?
|
|
|
|
|
Hi,
Web services are stateless, they don't preserve information across method calls. If you want to preserve state, you need to implement your own mechanism, like passing around a session key..
Regards
Senthil
|
|
|
|
|
I am a VB programmer new to C# and I can't seem to find a simple way of raising an event. What I am trying to do is raise an event from one class that will update a progress bar on the main form.cs. In VB this was rather simple, declare the event and then raise it. So far, all of the examples I have seen in C# seem to be pretty involved or don't fully explain what is being done. Is there anyone here that can give me a brief sample with an explanation of what is going on?
|
|
|
|
|
|
I followed the example provided above and I think I understand it a little better. However, I am still not sure how you raise an event in one cs file, for example, process.cs to update something on the form in the form.cs file. The above, and all other, examples I have seen all show the event method overides in one cs file, the listener code and actual code that triggers the event in the main or form.cs file.
|
|
|
|
|
Jk published in his weblog(JKOntheRun) an article about the problem that maybe the new Windows Media Player 10 and the new "playsforsure" Features will never be available for actual Windows Mobile 2003 Pocket-PCs... thats a thing I am also worried about these days - because why the hell did I spent more than €600 for a device, with more than adequate memory capacity for all types of media, when it does not integrate in the existing "Media-World" that is drawn by available and upcoming Microsoft Products. Well have a look at the portable MediaCenter Devices... neat and really cool gadgets - a must have - you can sync them with your home pc´s - you can have the movies from your home´s MediaCenter on your portable MediaCenter, you can buy content from Microsofts Content-providing Partners... okay thats cool isn´t it. - But infact - I got that nifty "all-in-one device suitable for every purpose" called Pocket PC.... - Iam watching high-quality-mpeg4 movies on my PocketPCs for months... I listen to my mp3´s, ogg´s, aac´s and whatsoever... but those cool integration-feeling doesn´t come up with my PocketPC... and the Windows Media Player 10 for Windows Mobile would help that a bit - but what would sort things out: to have the same integration and Features that are available for other, compared to the Pocket PC dumb, devices....
And that´s why I started the "MTP-over-IP" Project. Because MTP is the Protocol all this cool devices use to communicate with the Applications... (there are some more like auto-discovery and so on...but first things first)... a working Implementation of MTP would make it possible that the Windows Media Player 10 on the PC could recognize the Pocket PC as a Media Device, as a Smart Device that it is...
So. Due to quite heavy workload I have the moment I cannot do such a project alone - so I would like to ask everyone that is interested and capable of helping me with this project in doing so.
At the moment the first lines of code are already written - I started the MTP Library in C# based on the .NET Framework at the Moment - the goal is to get the MTP Protocol working, on the .NET Framework and on the .NET Compact Framework...
I published the first lines of code some days ago... you can grab it here (sorry that the blog-article is mainly in German...)
Some links to the source: http://maniac.rz.tu-ilmenau.de/schrankmonster/PermaLink,guid,bc4f4294-54bc-4675-87c3-a8c892ab4b3d.aspx[^]
|
|
|
|
|
Any ideas to the question above? i can make the form appear but there are a few problems to note.
1. The mouse does not draw on the form that appears on top of the app.
2. you cannot move the form around or else the backround will 'brake up'
The app is full screen (non-exclusive although i would like it to work with exclusive). How do i have to setup my direct draw drawing methods to work when this form i being draw? the code im using to make the form is just a test code basicly this: Form f = new Form(); f.ShowDialog();
Thanks alot for your time.
|
|
|
|
|
I don't know exactly what controls there are included but if you get the new SDK (December 2004 update) there are form type controls included with directX. I know there are text boxes, buttons, labels etc but i've notlooked into it in any great detail yet but you may be able to find what your looking for there.
Kev
|
|
|
|
|
i currently have that version installed on my comp..i noticed that it seems to be d3d controls? im using direct draw and i think the best way to just show buttons and options is to pop open a standard windows form and work from that. in any case i looked through the directx documents and they seems to be lack luster to say the least.
Jesse
The Code Project Is Your Friend...
|
|
|
|
|
Maybe just include a reference to D3D and have a go? Although i must admit the documentation all seems very poor for managed DirectX. I'm working on some DDraw stuff myself so if you figure it out then let me know, it would be nice to have some sort of options form or something like that in some of my future projects.
I can't even point you in the direction of any good source material for managed directX, the best book i have found is Managed DirectX Kick Start by Tom Miller but the main focus of that is on D3D and it doesn't cover working with forms. As for websites i haven't been able to find any that specifically cover Managed DX, the best i have found is sites like this one that cover programming in general. A friend and I are working on a website at the minute but we have just started it and are going to focus on games programming so i don't see us worrying to much about getting forms displayed at the minute. If you fancy taking a look at the site go to www.monkeycmonkeydo.co.uk
Kev
|
|
|
|
|
Hi everybody,
I want to return a result from a client form or dialog (no standard results like dialogresult.OK or somthink like that) but my own resultcodes.
In which memberfunc. do I have to place the (return)code so that the calling parent can get the returnresult.
Is it only possible with dialogs or in forms too.
Thank you for helping.
fracalifa
|
|
|
|
|
If you call a dialog or form from the parent, that dialog or form won't be destroyed until the calling function ends, or you explicitly call the destructor. This means that any variables, or functions, will still be accessible. Just call a public function to get return values, or make the variables public.
- D
|
|
|
|
|
Hi I have a question about how constructors are used when it comes to inheritance in C#. I have come across this problem:
<br />
Class A<br />
{<br />
public A(int x)<br />
{<br />
}<br />
}<br />
<br />
Class B : A<br />
{<br />
public B()<br />
{<br />
}<br />
}<br />
The compiler gives me this error:
No overload for method 'A' takes '0' arguments
When I put in an empty constructor in A it works. Whatever I do to the constructor in B do not matter; the same error is generated by the compiler. The thing is I relay don’t want any constructor in B at all. I want to use the same one that is used in A. Is there any way I can do this with out working around it and make the constructor in A into a method?
|
|
|
|
|
Try:
<br />
Class B : A<br />
{<br />
public B(int x) : base(x) {}<br />
}<br />
You have to define the constructor in B because constructors are not inherited. But by using the base call you just call the constructor of the base class A and dont have to implement anything in B.
|
|
|
|
|
Ok so if I understod this right, the first thing that happens is that the constructor of A is called and then the constructor of B which in this case does nothing, but it can potentialy do something.Right tnx for your qick answer and sorry for my lazy reply.
|
|
|
|
|
Hi,
I am working on a Folder Browser for a program, my only guess of what to use is TreeView, but i have never used it before. I have searched on Codeproject for similar application that has a FolderBrowser, but they seems to advanced for me.
Can anyone tell/show me how to make such a program.
Though i do not have a clue on how to do, i started by doing this:
private System.Windows.Forms.TreeView _Directory = new System.Windows.Forms.TreeView();
private void AddTo_Directory()
{
DirectoryInfo all = new DirectoryInfo("c:\\");
foreach(DirectoryInfo x in all.GetDirectories())
{
this._Directory.Nodes.Add(x.ToString());
}
}
but that just give me the directories in "c:\\", I have no idea on how to get all the sub directories!
Thanks
QzRz
QzRz
|
|
|
|
|
You will have to make a recursive algorithm:
<br />
private void AddDirectory(DirectoryInfo dir, TreeNodeCollection col)<br />
{<br />
TreeNode node = col.Add(dir.Name);<br />
try <br />
{<br />
foreach(DirectoryInfo x in dir.GetDirectories())<br />
AddDirectory(x, node.Nodes);<br />
} <br />
catch {}<br />
}<br />
Now you could call AddDirectory(new DirectoryInfo("I:\\"), _tree.Nodes); to fill the tree with the complete hierarchie. The problem that arises is that this will load the entire folder structure of your hdd to the treeview at once. This would probably be frustrating to the user.
To avoid this you should always onle fill into the tree what you have to. So your first step isnt that wrong, because you are filling only the subfolders of the first hierarchie. To add needed subfolders when a node is expanded you will need to catch the AfterExpand event of the treeview and add the needed subfolders to the nodes in the expanded node. The following functions should work to do this:
<br />
private void AddParent(string dir) <br />
{<br />
DirectoryInfo dirInfo = new DirectoryInfo(dir);<br />
TreeNode node = _tree.Nodes.Add(dirInfo.Name);<br />
node.Tag = dirInfo;<br />
GetDirectories(dirInfo, node.Nodes);<br />
}<br />
<br />
private void GetDirectories(DirectoryInfo dir, TreeNodeCollection col) <br />
{<br />
try <br />
{<br />
foreach(DirectoryInfo x in dir.GetDirectories())<br />
{<br />
TreeNode node = col.Add(x.Name);<br />
node.Tag = x;<br />
}<br />
} <br />
catch {}<br />
}<br />
<br />
private void Tree_AfterExpand(object sender, System.Windows.Forms.TreeViewEventArgs e)<br />
{<br />
foreach (TreeNode node in e.Node.Nodes)<br />
GetDirectories((DirectoryInfo)node.Tag, node.Nodes);<br />
}<br />
Tree_AfterExpand must be set as the eventhandler of the corresponding event of your treeview. For each drive you want to add there must be one call to AddParent.
|
|
|
|
|
Robert,
Snap. Your way of dynamically creating the tree of course would be better ...
Allan
|
|
|
|
|
Thanks alot... it helped me alot
I only have one more question (I think)...
Do you know if the "Environment" is the best way to get all the logical drives?
Thanks
QzRz
QzRz
|
|
|
|
|
To determine if its the best way I would have to know ALL ways to get this information .
The only other way I know of (beside direct api calls) is System.IO.Directory.GetLogicalDrives , but I dont know if there is any difference between the two.
|
|
|
|