.net

DynamicMethod returns incorrect value when property type is Int64.

I'm working on a routine to use DynamicMethod to retrieve values from a object. It worked fine with most of data types, except for DateTime.Ticks, which is int64 In the following test app. I uses both MethodInfo and DynamicMethod, the methodInfo returns correct value but DynamicMethod doesn't. Any ideas? using System; using System.Re...

How to find a foreign window and track its location?

I am looking to make a simple application that will capture the video from a Skype window every few milliseconds. My questions are: How do I automatically locate the window handle? That is, which is the best strategy (by name or?) and how do I achieve that programatically? How I keep track of the window location as the user resizes it...

C# Automatic find a Children Class by a Unique ID

Hello! I have about 20 classes for different messages and this number are growing. Each class has a unique ID, so I can transform the class on a byte[] with my own method of serialization and then transform a byte[] again on my class with this uniqueID. All my messages are children of a BaseMessage class that already implements the uniq...

Having problems with converting my DateTime to UTC

Hi I am storing all my dates in UTC format in my database. I ask the user for their timezone and I want to use their time zone plus what I am guessing is the server time to figure out the UTC for them. Once I have that I want to do a search to see what is range in the database using their newly converted UTC date. but I always get th...

Java LoadLibrary UnsatisfiedLinkError, though Java can see the file and runs on another computer

Hi All: This problem is really befuddling me and hopefully someone could help me out. I've written some plugin libraries for a large java software. Everything works fine and well on my development computer. However, after I compiled and wrapped the software in Nullsoft Installer and install onto another computer, everything but the nat...

COM Interop without regasm

I'm a limited user, and I need to write an Outlook macro that exposes a C# library in Outlook 2003 and 2007. I do not have any admin privilges at all, not even at install time, so I can't run RegAsm and I can't (I assume) write a managed add-in. Is there any way to call .Net code from VBA in this scenario, or are there any other solu...

Considering moving to .NET from java

Hello, I am a 4th year computer science student, at university alot of my projects were Java based so I am pretty used to the language, platform and apis. However for a long time, I have been reading alot regarding the .net platform improvements and it's large career opportunities (at least in my country). Now I am considering shifting t...

Writing to the compression stream is not supported. Using System.IO.GZipStream

Hello.. I am trying to decompress a (.gz) file using the GZipStream class that is included in the .NET framework. I am using the MSDN documentation and I keep getting this exception: "Writing to the compression stream is not supported." Here is the application source: try { var infile = new FileStream(@"C:...

Synchronous and asynchronous callbacks

I get confused with some terms while reading MSDN documents and code samples. What are callbacks in C#? In particular, what are synchronous and asynchronous callbacks ? Please explain these from a layman's point of view. Also, please explain the IAsyncResult interface. How can we implement it? (with very simple example) Thanks in adv...

LINQ to Entities: Why can't I use Split method as condition?

Hi, I have the following LINQ query: var aKeyword = "ACT"; var results = from a in db.Activities where a.Keywords.Split(',').Contains(aKeyword) == true select a; Keywords is a comma delimited field. Everytime I run this query I get the following error: "LINQ to Entities does not recognize the method 'Boo...

Attached properties in WF4.0?

Is there support for attached properties in WF4? If not, how are scenarios common to attached properties ("arbitrary property of parent associated with children") supported in WF4? ...

Local access to remoted object

I have a remoting server that I am successfully using as such. That assembly references a proxy assembly that defines all of the interfaces that will be passed around when a client makes use of the remoting server. The server itself uses a plugin architecture. I don't think having the plugins access the server object by way of remotin...

Postback event issues

I'm trying to raise a button_click event in my code behind for a asp:Button, however it only seems to postback when I click it the SECOND time, rather than the first, am I missing something? Below is my code <asp:Button AccessKey="Y" EnableViewState="true" Height="25px" runat="server" ID="myButton" Text="hello" OnClick="clickit"...

Space-efficient in-memory structure for sorted text supporting prefix searches

I have a problem: I need space-efficient lookup of file-system data based of file path prefix. Prefix searching of sorted text, in other words. Use a trie, you say, and I thought the same thing. Trouble is, tries are not space-efficient enough, not without other tricks. I have a fair amount of data: about 450M in a plain-text Unix-for...

C# sound visualisation

I would like to create a sound visualisation system using C# language and .NET Framework. This could look like in Winamp application. Maybe exist free library or some interesting articles which describe how to do it? Example: ...

Launch Reporting Services Reports from .Net Code

What is the best way to launch reporting services reports from .Net code? One method would be to dynamically build a URL and launch a browser. Something like this: http://server/ReportServer/Pages/ReportViewer.aspx?%2fReport+Directory%2fReport%20Name&amp;FirstParameter=1,2,3&amp;SecondParameter=8/30/2009&amp;rs%3aCommand=Render I don...

Getting "final" prepared statement from MySqlCommand

I have the following MySqlCommand: Dim cmd As New MySqlCommand cmd.CommandText = "REPLACE INTO `customer` VALUES( ?customerID, ?firstName, ?lastName)" With cmd.Parameters .AddWithValue("?customerID", m_CustomerID) .AddWithValue("?firstName", m_FirstName) .AddWithValue("?lastName", m_LastName) End With I have a class that handles e...

Scroll panel based on mouse position in vb .net

I'm trying to make an autoscroll enabled panel that will scroll if the mouseposition.x > panel.location.y However, I cannot seem to find a panel.scroll() function. Is there a way to programable make the control scroll? Thanks ...

"Dialogs must be user-initiated." with SaveFileDialog in Silverlight 3.

I am working on a Silverlight 3 app with C#. I would like to allow the user to download an image from the Silverlight app. I am using SaveFileDialog to perform the file download task. The flow goes this way: User clicks on Download button in the SL app. Web service call invoked to get the image from server OnCompleted async event h...

Using PropertyInfo.GetValue()

I have a class that creates a static array of all properties, using a static constructor. I also have a function -- GetNamesAndTypes() -- that lists the name & type of each property in that array. Now I want to create another instance-level function -- GetNamesAndTypesAndValues() -- that displays the name & type of each property in the...