|
*Muskan* wrote: Can someone give me the code of my project?
This is a homework assignment. Treat this board as if your prof is reading it. Asking us to just handover the code is cheating.
|
|
|
|
|
Dave Kreskowiak wrote: Treat this board as if your prof is reading it.
I sure wouldn't mind having his professor's email address and drop them a line about the cheat
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
Seriously, assuming you manage to pass your course, when you get a job, did you hope to post here to get your work done for you then, too ?
You need to do your own homework, but, if you try and get stuck on specific things, we're more than happy to help you.
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 )
|
|
|
|
|
We only assist when you have problems with your code. What u are asking for is for this forum to fix u up with a whole project! Wake up and work!
---------------------------
Baniani mbaya, kiatu chake dawa.
Regards,
Hesbon Ongira
Nairobi, Kenya.
|
|
|
|
|
It smell like homework, even through the internet i can smell it
Well, the first, start working, because sure you don't have all the time.
Drill down the assignment in things that you need, try to create what you can, and than with specific questions we will help you. But the meaning of all is learn to program in VB.NET.
Good luck, and I hope to see you here with questions and with the progress of your assignment.
|
|
|
|
|
ESTANNY wrote: It smell like homework
Yes, it reeks of homework...
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
To get help you need to show that you have put significant effort into building your code ie you must have code of your own, then people can comment on your effort. You cant ask people to do all your work. This will not be taken kindly by the other hard working coders out there. This sort of practice is generally frown upon
Future Coding
|
|
|
|
|
I'm sure this has been asked ad nauseum, but I have MTA thread from which I need to write to a textbox on a different form.
Is there any simple, or at least doable, answer?
Thanks
|
|
|
|
|
|
Right, I understand the idea of the delegate and I know how to call one from a backgroundworker or from a STA thread.
My problem is that the code that I'm using (third-party) is running under an MTA (multiple apartment) thread.
I cannot seem to get the same delegates that work just fine from a backgroundworker to work under the MTA thread.
It's my impression that the MTA threading is a different animal entirely...that the GUI is based on calls from STA threads.
Am I wrong about that?
|
|
|
|
|
cstrader232 wrote: It's my impression that the MTA threading is a different animal entirely...that the GUI is based on calls from STA threads.
Am I wrong about that?
Nope. You're not. I'm just too tired and missed that part of your post.
Hmmm...
|
|
|
|
|
Wow, have I really stumped DK? First time on that for me! Makes me wonder whether this is even possible.
|
|
|
|
|
Stumped?? Hardly. I just need to do the research and come up with a testable solution. Time is a bit short right now, so this takes a while.
|
|
|
|
|
Well, it does work and without anything "off the wall". This is the test case I put together under the .NET Framework 2.0. The only controls are a Form, TextBox, and Button.
Imports System.Threading
Public Class Form1
Private Delegate Sub UpdateTextBoxDelegate(ByVal Message As String)
Private Sub UpdateTextBox(ByVal Message As String)
TextBox1.AppendText(message & Environment.NewLine)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
For x As Integer = 1 To 20
Dim t As New Thread(AddressOf GenerateData)
t.SetApartmentState(ApartmentState.MTA)
t.Start()
Next
End Sub
Private Sub GenerateData()
Dim callback As New UpdateTextBoxDelegate(AddressOf UpdateTextBox)
For x As Integer = 1 To 10
TextBox1.Invoke(callback, New Object() { _
String.Format("Thread Id: {0} Apartment: {1} Message: {2}", _
Thread.CurrentThread.ManagedThreadId, _
Thread.CurrentThread.GetApartmentState().ToString(), _
x)})
Next
End Sub
End Class
Sorry, I just went back and found out you're using a third party component. The short version of apartments is COM components written in STA mode can only have one thread call their methods at any one time, the thread that created the component. In MTA (sometimes called "free threading", multiple calls to the component's methods from any thread(s) are possible with complete safety.
Since most of Windows Forms and the controls it supplies wrap the existing COM controls, most of which are written in STA mode, the default apartment mode for a Windows Forms app is STA. It's possible to change this, but not a good idea because the COM controls backing Windows Forms requires an STA environment to run.
Calling a method of a control in STA can be done from any apartment mode, so long as the call is marshaled to the thread that created the control. It matters more about the apartment your code is calling, than the apartment the call is comming from. I'd be willing to bet that there's something in this third party component that is not marshalling the call back to STA correctly.
|
|
|
|
|
OK, thanks... I think you are on to something there. The 3rd party code is not allowing me to make my callback properly. I'll try to keep checking into this. Thank you so very much for your time....really appreciated.
|
|
|
|
|
Thank You, that is exactly what I need to be using.
|
|
|
|
|
I dont know what is the use of performance counter and how to use it... im just wondering if i could use it on my project...tnx
Sunshine
|
|
|
|
|
|
Click on the Start button, then on Run. Type PERFMON.MSC and hit enter. This is the Performance Monitor. You can montior all kinds of system information such a network activity, disk access, memory usage, ...
The performance counter classes let your code create and expose custom counters so you can monitor components work using PERFMON or some other performance monitoring tool.
|
|
|
|
|
Have you looked around at the PerformanceCounter class?
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
I have an application in Vb.net. There is a crystalreport that displays records from an access Database.But i want to filter records that report displays.Each records has 6 fields and one of this is LisTR.
I have a function VerifyS(...) as boolean , this function get as argument the value of this field and return true if the record that have this filed should display in the report or no.
But i have problem using this function.
I use : CrystalReportViewers1.SelectionFormula=("VerifyS{Table1.LisTr}=True")
But i get an error
So , How to use a function inside SelectionFormula?
Thank You !
|
|
|
|
|
If this VerifyS function is defined in your VB.NET code, you can NOT use it in the SelectionFormula filter. Last I knew, CrystalReports cannot call back into your code to call functions.
The way around this would be to add a field to your table that your code can modify based upon your rules, then you can use that field in the SelectionFormula to filter the records.
|
|
|
|
|
Thank You.
Ok , i change my code and now i want to display in My crystal report only those records that have the maximum value in the filed LisTR. Can i use the function Max or something else to do this. ( so is possible to use in SelectionFormula a standart function of vb.net ?)
Thank You
|
|
|
|
|
mysybet123 wrote: so is possible to use in SelectionFormula a standart function of vb.net
Didn't I just get done telling, "No, it's not possible."??
Stop thinking in terms of VB code in the SelectionFormula and start thinking in terms of either SQL or CrystalReports syntax.
|
|
|
|
|
Hi guys,
I need to create a matrix (array) of buttons at runtime, and i need to associate to every button a couple of events like "MouseDown" and so on.
I explain:
- I get a number from outside (a parameter) that tells me how many buttons I must create in my form, obviously at runtime since I don't know the number before;
- these buttons will be like puzzle items, so for each one I must associate a "mousedown" event and others to let the user move them in the form (actually, from a Panel1 to a Panel2 in the same form);
I tried to create at runtime a matrix of buttons, but this object cannot be associate with events... the same thing happens with a "List" objbect...
anyone has an idea on how to proceed?
thank you
-- modified at 8:16 Wednesday 3rd October, 2007
|
|
|
|