|
|
where can i ask question for sql sever reporting services for 2008.
thanks
|
|
|
|
|
Here perhaps[^]?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hey guys,
Is there a string compression that works in all programming languages?
for example, if I compress the return string of a .net web service method, and the caller from another platform can decompress the returing string
|
|
|
|
|
Maybe gzip? Since it is used to compress HTTP bodies, and suppose to be light and quick should be implemented in most of environments.
No more Mister Nice Guy... >: |
|
|
|
|
|
Thanks for the quick response
I will check it out
|
|
|
|
|
Yes I should really get to work. Now. Just can't force myself to work on another one of WCF services. Bleh
No more Mister Nice Guy... >: |
|
|
|
|
|
I'm trying to compile a archivo.mex. net and when I build I get this error
Executing command: C:\WINDOWS\Microsoft.NET\Framework\v3.0\csc.exe /nologo /optimize /doc:"D:\Matlab\bin\grabacionn\src\grabacionn.xml" /t:library /r:"D:\Matlab\toolbox\dotnetbuilder\bin\win32\v2.0\MWArray.dll" /resource:"D:\Matlab\bin\grabacionn\src\grabacionn.ctf" /out:"D:\Matlab\bin\grabacionn\src\grabacionn.dll" "D:\Matlab\bin\grabacionn\src\Class1.cs" "D:\Matlab\bin\grabacionn\src\dotnet_mcc_component_data.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v3.0\csc.exe" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
Error: An error occurred while shelling out to CSC (error code = 1).
Unable to build executable.
if anyone can tell me I should do that because the framework rebice but I have the csc.exe
modified 19-Nov-12 23:14pm.
|
|
|
|
|
..and now again, in English
Just use a translator. I don't care how bad it sounds, can't be worse than my average post - a half decent English post still reaches a wider audience than a Spanish one.
|
|
|
|
|
|
When I look into C:\Windows\Microsoft.NET\Framework\v3.0 , I do not see a csc.exe . But there is one in C:\Windows\Microsoft.NET\Framework\v2.0.50727 .
|
|
|
|
|
I alter the deployments, .. settings, .. . net .. 2.0 this worked
|
|
|
|
|
You won't find a csc.exe under the .NET 3.0, 3.5 or 4.5 folders as these versions are just extensions on top of the .NET 2.0 and .NET 4.0 versions, which will have csc.exe.
|
|
|
|
|
Hello everybody,
I have a problem about the modification of fields (such as textbox, label, acc) of a form from another thread.
I state that I am not an expert on Visual Studio 2008 and, unfortunately, even on VB.NET but I have to use these tools to write an application that runs on a device with Windows CE 5.0.
In another forum I've already found a post about it and I followed the solution proposed.
Everything works if I write all the code in the class of my form (Form1), I mean in the Form1 there is a button that starts a thread that increments by 1 a variable declared in Form1, and then calls a "Sub AggLab()", always in Form1, that updates the contents of a label (in Form1) with the increased value of the variable:
Imports System.Threading
Public Class Form1
Dim MyNewThread As Thread
Dim tmp As Int32 = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyNewThread = New Thread(AddressOf SubDelThread)
MyNewThread.Name = "NuovoThread"
MyNewThread.Start()
End Sub
Private Sub SubDelThread()
Do
tmp = tmp + 1
AggLab()
Thread.Sleep(1000)
Loop
End Sub
Private Delegate Sub AggLabDel()
Private Sub AggLab()
If Me.InvokeRequired Then
Me.BeginInvoke(New AggLabDel(AddressOf AggLab))
Return
End If
Label1.Text = tmp.ToString
End Sub
End Class
But if the function executed within the thread is in a different class/file it does not work anymore:
Imports System.Threading
Public Class Form1
Dim MyNewThread As Thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyNewThread = New Thread(AddressOf MyThread.MyThreadExecute)
MyNewThread.Name = "NuovoThread"
MyNewThread.Start()
End Sub
Private Delegate Sub AggiornaLabelDelegate()
Public Sub AggiornaLabel()
If Me.InvokeRequired Then
Me.BeginInvoke(New AggiornaLabelDelegate(AddressOf AggiornaLabel))
Return
End If
Label1.Text = MyThread.iii.ToString
End Sub
Imports System.Threading
Public Class MyThread
Private Shared miii As Int32 = 0
Public Shared Property iii() As Int32
Get
Return miii
End Get
Set(ByVal value As Int32)
miii = value
End Set
End Property
Public Shared Sub MyThreadExecute()
Do
iii = iii + 1
Form1.AggiornaLabel()
Thread.Sleep(1000)
Loop
End Sub
End Class
What I check with debugging is that in this case "Me.InvokeRequired" is always false.
Where did I go wrong?
Can anyone give me a tip?
Thanks in advance.
|
|
|
|
|
Does it give an exception? not work as expected?
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
No, it doesn't give an exception, just it does nothing.
The first example, all the code in the Form1 clas, works as expected.
|
|
|
|
|
Member 9496613 wrote: Where did I go wrong?
Can anyone give me a tip?
Two; don't use global variables to pass state, and set MSDN[^] as your homepage. Try something similar to the code below;
Imports System.Threading
Public Class Form1
Dim MyNewThread As Thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyNewThread = New Thread(AddressOf MyThread.MyThreadExecute)
MyNewThread.Name = "NuovoThread"
MyNewThread.Start(Me)
End Sub
Public Sub AggiornaLabel(ByVal What As String)
If InvokeRequired Then
Invoke(New Action(Of String)(AddressOf AggiornaLabel), New Object() {What})
Return
End If
Label1.Text = What
End Sub
End Class
Public Class MyThread
Private Shared miii As Int32 = 0
Public Shared Property iii() As Int32
Get
Return miii
End Get
Set(ByVal value As Int32)
miii = value
End Set
End Property
Public Shared Sub MyThreadExecute(ByVal Origin As Object)
Dim OriginForm As Form1 = CType(Origin, Form1)
Do
iii = iii + 1
OriginForm.AggiornaLabel(iii.ToString)
Thread.Sleep(100)
Loop
End Sub
End Class
|
|
|
|
|
Thanks for your answer.
Your example works if i create a project for a desktop pc, but my project has to run in a Windows CE 5.0 environment (Compact Framework 3.5) and it doesn't work.
I get two errors:
1) MyNewThread.Start(Me): "too many arguments for 'Public Sub Start()'"
2) Method 'Public Shared Sub MyThreadExecute(Origin As Object)' does not have a signature compatible with delegate 'Delegate Sub ThreadStart()'
1) the method Start(Object) is not supported in Compact Framework so I have to call MyNewThread.Start()
For the second error, I'm searching through MSDN... but I don't understand well, I think I have to modify MyThreadExecute(...) because I can't modify ThreadStart()... now I try, but if you already know the answer...
About the use of global variables, is it such a bad thing?
The real application is more complex of this example, the function executed by the thread will communicate with a PLC via ethernet and will read a lot of data (and write some) and then, at the end of each loop, it will call a function to visualize new data in different "pages" (I use UserControl objects) in the application. My idea is to use a class in order to collect all of these data and make them available inside and outside the thread. What do you think about this?
|
|
|
|
|
steve_9496613 wrote: 1) the method Start(Object) is not supported in Compact Framework so I have to call MyNewThread.Start()
For the second error, I'm searching through MSDN...
The delegate is probably missing one of the parameters used.
steve_9496613 wrote: About the use of global variables, is it such a bad thing?
Usuallly done to keep things "simple", usually makes things more complicated. See, you'll need access to the form (from the thread), to invoke one of it's members.
Alternatively, you might want to check out locking.
steve_9496613 wrote: The real application is more complex of this example, the function executed by the thread will communicate with a PLC via ethernet and will read a lot of data (and write some) and then, at the end of each loop, it will call a function to visualize new data in different "pages" (I use UserControl objects) in the application. My idea is to use a class in order to collect all of these data and make them available inside and outside the thread. What do you think about this
Sounds feasible. Remember to only update the visible stuff, resources will probably be scarce
|
|
|
|
|
I'm not able to solve the second error (Method 'Public Shared Sub MyThreadExecute(Origin As Object)' does not have a signature compatible with delegate 'Delegate Sub ThreadStart()').
When I create the thread with the instruction:
MyNewThread = New Thread(AddressOf MyThread.MyThreadExecute)
I can't add any other parameter, or I don't know how.
Searching the help I found that the delegate ThreadStart() is called automatically when I call "New Thread(AddressOf ...)" so how can I modify its parameters?
I really don't know what to do...
|
|
|
|
|
Can you post the code in it's current state?
Guess it'll work if you remove the "origin" parameter that I added there
steve_9496613 wrote: Searching the help I found that the delegate ThreadStart() is called automatically when I call "New Thread(AddressOf ...)" so how can I modify its parameters?
One can pass in an object when the thread is started;
MyNewThread.Start(Me) At that point, "Me" would be the form. The start-method then executes the MyThreadExecute-method, where we have to cast it back to it's original type.
|
|
|
|
|
Here is the code (the code is in two files: one for Form1 and one for MyThread):
Imports System.Threading
Public Class Form1
Dim MyNewThread As Thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyNewThread = New Thread(AddressOf MyThread.MyThreadExecute)
MyNewThread.Name = "NuovoThread"
MyNewThread.Start()
End Sub
Public Sub AggiornaLabel(ByVal What As String)
If InvokeRequired Then
Invoke(New Action(Of String)(AddressOf AggiornaLabel), New Object() {What})
Return
End If
Label1.Text = What
End Sub
End Class
Public Class MyThread
Private Shared miii As Int32 = 0
Public Shared Property iii() As Int32
Get
Return miii
End Get
Set(ByVal value As Int32)
miii = value
End Set
End Property
Public Shared Sub MyThreadExecute(ByVal Origin As Object)
Dim OriginForm As Form1 = CType(Origin, Form1)
Do
iii = iii + 1
OriginForm.AggiornaLabel(iii.ToString)
Thread.Sleep(100)
Loop
End Sub
End Class
if I remove the "origin" parameter as in the commented lines in the code above the error disappears and I can run the application on the device but the label is not updated because the condition "If InvokeRequired Then" is alwais false (as it was in the first example I posted).
Perhaps I have not removed the "origin" parameter in a consistent manner (I have more then one doubt about the line "Dim OriginForm As Form1 = New Form1()"...)
About passing a parameter in an object when I start the thread, I can't do this because in the Compact Framework (not the full .NET) only the method Thread.Start() is supported, the method Thread.Start(Object) is not supported.
Perhaps this is another reason why the code doesnt work: the MyThreadExecute-method has no "connection" with Form1 and so in Form1 InvokeRequired is false.
ps: I thank you for your patience...
|
|
|
|
|
steve_9496613 wrote: About passing a parameter in an object when I start the thread, I can't do this because in the Compact Framework (not the full .NET) only the method Thread.Start() is supported, the method Thread.Start(Object) is not supported.
Aw, darn. Without that, it's not possible to pass the form as an argument.
Since AggiornaLabel is a method of the form (as should be), you'd need to have a reference to the form in order to invoke it. An ugly bypass would be to use a "shared" member, aka a static method. Works similar to the shared integer called 'iii'.
Imports System.Threading
Public Class Form1
Dim MyNewThread As Thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyNewThread = New Thread(AddressOf MyThread.MyThreadExecute)
MyNewThread.Name = "NuovoThread"
MyThread.ThatForm = Me
MyNewThread.Start()
End Sub
Public Sub AggiornaLabel(ByVal What As String)
If InvokeRequired Then
Invoke(New Action(Of String)(AddressOf AggiornaLabel), New Object() {What})
Return
End If
Label1.Text = What
End Sub
End Class
Public Class MyThread
Private Shared miii As Int32 = 0
Public Shared ThatForm As Form1
Public Shared Property iii() As Int32
Get
Return miii
End Get
Set(ByVal value As Int32)
miii = value
End Set
End Property
Public Shared Sub MyThreadExecute()
Do
iii = iii + 1
ThatForm.AggiornaLabel(iii.ToString)
Thread.Sleep(100)
Loop
End Sub
End Class That's abusing things a bit; a class that's never instantiated would be a module, eliminating the need to declare each member being 'shared';
Module MyThread
Private miii As Int32 = 0
Public ThatForm As Form1
Public Property iii() As Int32
Get
Return miii
End Get
Set(ByVal value As Int32)
miii = value
End Set
End Property
Public Sub MyThreadExecute()
Do
iii = iii + 1
ThatForm.AggiornaLabel(iii.ToString)
Thread.Sleep(100)
Loop
End Sub
End Module
|
|
|
|
|
Yessss! It works!
Both with the class than with the module.
In my project I have used a class but, if it is a cleaner way, I can still use a module, the project is not so advanced so the changes will not be too painful.
Thank you very much Eddy, your help has been precious!
|
|
|
|
|
You're welcome
|
|
|
|