I have a piece of .NET code which I want to port to 64-bit. The codes basically is a set of P/Invoke calls to some other C dll. One of the functions in the C dll has a parameter 'size_t'. What datatype should I use in my P/Invoke signature so that the marshalling works fine. I was thinking of using a IntPtr or a UIntPtr but some say that...
Hello,
I have .NET WPF application and one of requirement is that user may select and copy text outside of my application. My application has to respond to clipboard event. Look up word from dictionary and next to selected text show tooltip with word's translation.
As I understand this has to be accomplished using calls to Windows API...
How in MVVM do you set a User Control Focus? Using Focusmanager.FocusElement={Binding ...} Has no affect.
Here is my XAML:
<DataTemplate DataType="{x:Type client:TelephoneNumberViewModel}">
<Grid FocusManager.FocusedElement="{Binding ElementName=TelephoneNumber}" Width="1024" Height="540">
<Grid.RowDefinitions>
...
I been learning basics of generics and it looks like it can really improve the performance of the application.
But, I am not able to see the generic equivalent of Hashtable.
Please share some sample C# code for creating generic hashtable classes. I need this for a demo.
edit:Thanks for the answers.
...
I'll be more specific.
Lets say I have a contract defined for my WCF service. And I have two different WCF clients which reference to this service : "ClientA" and "ClientB".
Now , lets say I want to add an operation (method) to my service which only "ClientB" will use , Lets say I added this operation to the contract and "ClientB" upda...
I want to make a many to many connection with a field in it.
example:
User -----works (hours)----- Company
Hours is a field in the many-to-many table. The field describes how many hours a user works in the company.
How is this best modeled in the entity framework?
Can you even model this without making a entity out of the connection ...
I've got an AIX script I would like to run from a .NET application. I'm not opposed to kicking off a Windows batch file if that gives me better options.
Most of what I've seen on Google relates to using a tool such as rsh or Plink, or using ssh or telnet. I don't have access to rsh or Plink (although I do have PuTTY and could probably g...
What is the difference between a.Equals(b) and a == b for value types, reference types, and strings? It would seem as though a == b works just fine for strings, but I'm trying to be sure to use good coding practices.
...
Using the following text as a sample, I need to be able to extract text between LI tags. Notice that the first LI is intentionally mal-formed as this may be the case. Said another way, I want everything from an LI tag to either it's closing LI tag or the next LI opening tag.
<UL>
<LI class="test">This is the first ListItem Text.
<...
I am attempting to do some data conversion. Unfortunately, much of the data is in strings, where it should be int's or double, etc...
So what I've got is something like:
double? amount = Convert.ToDouble(strAmount);
The problem with this approach is if strAmount is empty, if it's empty I want it to amount to be null, so when I add i...
What sites do you know of that are using Silverlight? This information will help us to decide when to adopt the Silverlight platform.
The sites should be public-facing and be considered high-traffic. (at least 300,000 hits per month).
We are a Microsoft shop and Silverlight is based on .NET, so that is very attractive to us. But my res...
I have just downloaded and and am using db40 7.9 and am testing it on two different .NET 3.5 applications using the supplied tutorial.
When I access the same database (c:\pilot.db4o) file using these two applications, one after the other, each one is reflecting only the changes made by that application, even if those changes were made d...
How can one look at .NET Debug.WriteLine traces outside the debugger?
...
Trying to do the following:
order.ExpirationDate =(DateTime) ( ExpMonth + "/" + ExpYear);
ExpMonth, Expyear are both ints.
...
I'm trying to access the Count Property on the array of rows returned by the datatables select method, this is after converting the Web Project to 3.5
...
I'm busy building a software update application in C#, WinForms, .NET 3.5, where I have a collection of pluggable task classes with a common base class. I would like one task, the database upgrade, to begin a transaction, and another task, the web site upgrade, to commit or roll back the same transaction, so the web site and DB are alwa...
Hello,
I have .NET WPF application, that sits in background, and responds to user selecting text for example in Microsoft Word. After user selects text I need to draw window next to selected text.
My question is: How it is possible to get selected text coordinates in currently active application?
As I understand it has to do with Int...
I've run into a very odd bug today. I have a button on a form, clicking it causes a grid on my form to be populated with data. If you click the button twice, it crashes with an 'Object reference not set to an instance of an object.'
I ended up placing a breakpoint at the start of the Sub that handles the population of that grid and I ...
I started thinking about how to handle the save functionality of my app, and thought about 2 options:
The application has nodes like:
Blur
Contrast
Sharpen
Invert
...
1. Interpreting the saved file, like:
Blur name:"Blur01" Amount:5
...
2. Having the saved file in a self executable format, like:
Blur blur = new Blur ();
blur.Name...
I am exploring calling .net methods from unmanaged C++ code and have found the function below in How To Inject a Managed .NET Assembly (DLL) Into Another Process
void StartTheDotNetRuntime()
{
// Bind to the CLR runtime..
ICLRRuntimeHost *pClrHost = NULL;
HRESULT hr = CorBindToRuntimeEx(
NULL, L"wks", 0, CLSID_CLRRun...