Thomas Høyrup's Q&A profile
Visual C# C# 2.0 doesn't allow me to use System.Void?
I love generics in 2.0! What a time-saving feature, less code to write! Plus it allows for more code re-use, and thus fewer bugs. I love generics, pat on the back to Anders and the C# team. I ran into a limitation, however, with C# 2 compiler and generics. I wanted to implement a method that would have a generic return type, for instance: TReturn ExecuteSomeDelegate<TReturn>(MyReturnableDelegate<TReturn> serverMethodToExecute) { // pretend there's lots of error catching & handling here... return serverMethodToExecute(); } This is all fine and dandy: // call some s ...Show All
Visual C# how to save a graphics into a jpg file
Now the graphics are painted in a form and i want to save the graphics into a jpg file. Which class will implement that what about ImageConverter class should i first transform the graphics into a image. By the way, i am not sure whether the image class will be useful. thank you Hi, I still get a big black box, here's some of the code I'm using: first my toolbar button for print: if (e.Button == this .tbPrintForm2) // print the validated version of the doc { _bmp = (Bitmap)_currFormImage; pd2 = new PrintDocument(); pd2.PrintPage += new PrintPageEventHandler( this .DrawPanel); PrintD ...Show All
Windows Live Developer Forums Using Caching Application Block
HI Every one i want to use caching application block in my application. What expiration policy should i implement in my application to accomplish following requirements i want to place data table in cache and that item should expire when the underlaying db table which is corresponding to this datatable is updated. keeping in mind application is distributed as well and i dont want to a round trip to db server on every form load. If I got you correctly, you could sessions to cache the data as for the trip to the database server, the client will still need to send the request to your http server every time ...Show All
Visual Studio Express Editions sorry
How do you create multiple lines within a message box when combining a string with variable values I know... it would probably be easier to just create a seperate form and load the form.... just wondering if it was possible to not have to do such though. What if the data that is to appear on the next line is - lets say - the value of an array. I'll explain my question. What if I want to display a list of values which the user entered....not for confirmation purposes but just to show what data had been entered...into a declared array. So.. Dim intArray(5) As Integer Element# Element Value 0 = 11 1 = 22 2 = 33 3 ...Show All
Visual Studio ReportViewer Cause error after deploying the webserver
Dear all, When I deploy my web project into my Web server,everything is work,but except the report does not work properly. The config of my webserver is win2003 with IIS 6.0.And I make use of the report in the local processing mode and set "sessions state mode=InProc","cookieless mode=UseCookie"on the page of the state management in IIS. The error message is showed below Server Error in '/' Application. There is a known bug with the report viewer and cookie based sessions. If you use a cookieless session, the report should render correctly. ...Show All
.NET Development Show XML Items From Internet into Treeview
Hello: Well I need some help, i have the following xml file in a domain: < xml version = " 1.0 " encoding = " utf-8 " > < ListaDisco title = " Directorio " > < Category title = " Bar " > < disco id = " B1 " > < name > Bora Bora </ name > </ disco > < disco id = " B2 " & ...Show All
.NET Development How to get Physical path from a mapped drive in dot net
I need to implement this into a web application. i kow it is possible vis console application but that doesn't give client side information. Is it possible to get Client side mapped drive's phsyical path No, that would be a big security hole.. (and secondly, webclient-spectific operations are made by client-scripting like javascript, not by .NET) ...Show All
Software Development for Windows Vista Reloading the state machine instance from persistence in Tracking
I am trying to extend The Ordering State Machine example. I want the form to load all persisted workflows on start up, displaying each at their current state in the list view. I have implemented the SqlPersistenceService and the Tracking service successfully and both databases are being populated. As a test I am loading a persisted workflowInstance using its GUID WorkflowInstance CurrentInstance = theWorkflowRuntime.GetWorkflow(new System.Guid("63714370-9bd8-4ab3-9928-cc3c0b2c6696")); CurrentInstance.Load(); I have implemented the handler for the workf ...Show All
Visual Studio Team System Unit Test Adapter threw TypeInitializationException
I am getting the following exception in one of my Unit Tests... Unit Test Adapter threw exception: System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.TestTools.UnitTesting.TestConfiguration' threw an exception. The documentation for TypeInitializationException says "The exception that is thrown as a wrapper around the exception thrown by the class initializer". So if this exception is a wrapper, how do I get the wrapped exception How am I susposed to debug this VS Team only shows the exception message. I need to see the full stack trace, and properties of the exception. How i ...Show All
Game Technologies: DirectX, XNA, XACT, etc. .X files
How do i make a .X file and a .FX file what program werwin wrote: How do i make a .X file and a .FX file what program You can also use a program like DelEd, Gamespace, Milkshape, Lightwave, etc... ...Show All
Visual Studio Team System custom rule to check Are stream objects wrapped in wrapper classes?
hi, i need to write a rule in fxcop that checks are stream objects wrapped in wrapper classes. It would be if some one helps me in writing this rule. Thanks in advance Hi Guns, what pattern are you trying to detect exactly e.g. class StreamWrapper { private Stream m_stream; public Stream Stream { get { return m_stream; } } } There are cases where it is completely legitimate to have a stream as a property in a class. e.g StreamReader/StreamWriter in the .NET Framework expose a property that give acess to the stream that the class is working on. ...Show All
Visual C++ VC8, Adding __event to non-CLR code gives error C2712
In a non-CLR class I have a number of __events defined. When compiling the source code in which the corresponding header file has these __events, I receive the error: error C2712: Cannot use __try in functions that require object unwinding pointing to the last of the __event lines in my header file. When I look at the error message it says: "cannot use __try in functions that require object unwinding". Further it is mentioned that "object unwinding" means "destruction". Needless to say I am not using __try anywhere but perhaps the code being generated by the __event extended keyword is. I have no idea what the function that "requires object ...Show All
Visual Studio Team System Custom decimal field in a work item
Hi everybody, I created a new Work Item Type activity and defined the following decimal field: <FIELD name="Estimation" refname="Mycompany.MyProject.Estimation" type="Double" reportable="measure" formula="sum"> <HELPTEXT>A rough estimate of the cost of the work item in days</HELPTEXT> </FIELD> Then i created the following Control <Control Type="FieldControl" FieldName="Mycompany.MyProject.Estimation" Label="Rough Estimation:" LabelPosition="Left" ...Show All
.NET Development UploadFile
Hi everyone! I'm having some trouble uploading a file to my webserver, using the new My.Computer.Network.UploadFile method. This is the code i am using (The credentials are fictitious ) : Dim filepathupload As String = "C:\uploadtest.txt" Dim urlupload As String = " http://hamdisk.hamdev.com/jacob/uploadtest.txt" Dim username As String = "jacob" Dim password As String = "JCrules" Try My .Computer.Network.UploadFile(filepathupload, urlupload, username, password) Catch ex As Exception MsgBox(ex.Message) Finally MsgBox( " Try Completed" ) 'To show the end of the try End Try So, that's ...Show All
Visual Studio Team System Web Test: error 400 Bad Request?
I am connected through our internal network to the server hosting the webservice. If I remote into the Server and bring up web service asmx page, I have the option of entering values and invoking the specific method. I copy n' paste appropriate values in the textbox, click Invoke, and it's successful. If I use the very same data on my machine, then run the webtest, it fails with error 400 Bad Request. Are there any issues with the webtest running over a internal network Any settings I am missing Hello Yes, most asmx pages don't allow a none soap request from a remote client. Please take a look at ...Show All
