Hello, I have a DataGrid (not DataGridView) control .NET 2.0 bound to a given DataTable. One of the columns contains alphanumeric values which do not get sorted well: e.g. take the IDs A-12, A-103, B-3, ... Z-0. The default sorter of the DataGrid sorts the first two items incorrectly (A-103, A-12). If I used a custom IComparer implementation I would call string.CompareOrdinal in order to obtain the actual compare result but apparently data-bound grids cannot be sorted that way. I would definitely appreciate any suggestions to resolve this issue. I think this can be achived by creating a derived Control or by handling the SortCompare event of the DataGridView control. Thanks, Stanimir
Stanimir_Stoyanov
Posts
-
Data-bound DataGrid: Custom sorting? -
LZX or MSZIP Compressing Algorithms ImprementationsHello. I'd like to write a CAB extracting/packing application, and am looking for MSZIP/LZX implementations (no matter what programming language it/they is/are in) or format specifications. Thank you, and regards, Stan
-
NTDll's Compression FunctionsHello, I'm writing an application that has to have a de/compressing algorithm used to store data. The algorithm I want to use is the LZNT and its functions are exported in NtDll.Dll as far as an unofficial documentation says. I was able to find the 3 functions' syntax, but I can't get them to work. Here they are (DLLImport info stripped): public static extern void RtlCompressBuffer( ulong CompressionFormat, void *SourceBuffer, ulong SourceBufferLength, out IntPtr DestinationBuffer, ulong *DestinationBufferLength, ulong Unknown, out ulong *pDestinationSize, void *WorkspaceBuffer ); public static extern IntPtr RtlDecompressBuffer( out IntPtr DestinationBuffer, ulong DestinationBufferLength, IntPtr SourceBuffer, ulong SourceBufferLength, ulong *pDestinationSize ); public static extern IntPtr RtlGetCompressionWorkSpaceSize( ulong CompressionFormat, out ulong *pNeededBufferSize, out ulong *pUnknown ); Please correct me if I'm wrong with them, and I'd like to see any sample code which I can use for manipulating data. Thank you in advance, and best regards, Stan P.S. here is the code I tried Stream fs = new FileStream("input.exe", FileMode.Open); //input.exe is a test file byte[] DataIn = new byte[fs.Length]; fs.Read(DataIn, 0, (int)fs.Length); fs.Close(); IntPtr p_DataOut; ulong *pDS; byte* bt = stackalloc byte[DataIn.Length]; fixed(byte *p_DataIn = DataIn) { RtlCompressBuffer(0x0002 /*LZNT*/, p_DataIn, (ulong)DataIn.Length, out p_DataOut, (ulong*)DataIn.Length, 0x1000, out pDS, bt); } I get a NullReferenceException when executing RtlCompressBuffer, but as far as I saw, none of the parameters is null, except the ones with 'out' modifiers
-
Converting a HEX value to a DateTimeHi. I guess you all know about PE files' timestamps. The are in hex, and for example 41DE6BF7 means 07/01/2005 11:01:11. I tried many ways to 'convert' the timestamp to a DateTime object, but they all failed. (DateTime.FromFileTime(...), FromTicks(...) My question is, how to 'convert' the hex value to a DateTime. Thanks in advance and best regards, Stan
-
Converting a HEX value to a DateTimeHi. I guess you all know about PE files' timestamps. The are in hex, and for example 41DE6BF7 means 07/01/2005 11:01:11. I tried many ways to 'convert' the timestamp to a DateTime object, but they all failed. (DateTime.FromFileTime(...), FromTicks(...) My question is, how to 'convert' the hex value to a DateTime. Thanks in advance and best regards, Stan
-
XmlDocument Write problems and Add Identation Help!I use this way: after the XmlTextWriter initialization put this code: wrtr.Formatting = Formatting.Indented; so the code block looks like this XmlTextWriter wrtr = new XmlTextWriter(myXmlPath, Encoding.UTF8); wrtr.Formatting = Formatting.Indented; stan_fisherâ„¢ [www.aeroxp.net]
-
List View items - exporting and importing dataHi. I have a list view with about 4000 items (with 7 subitems, too) and I'd like to 'export', ie. save all the data, to a tab-separated file, so the data can be reloaded later. The problem is, that the saving and loading process using, for example: (Save) (...) foreach(ListViewItem lvi in this.listView1.Items) { string line = ""; line += lvi.Text; for(int i=1;i
-
"Depth Of Field" Sample in C#/VB.NETHi I'm looking for a C# implementation [or VB.NET one] of the C++ sample, included in the DirectX 9 SDK. I tried google-ing and searching The Code Project, but didn't find anything. So I think I have to 'translate' the C++ files to C#/VB.NET ones. If anyone who knows where I can find C#/VB.NET "Depth Of Field" sample, or would like to help me translating the C++ files, please, contact me - f3r0[at]hotmail[dot]com Thanks in advance, Stan
-
"Depth Of Field" Sample in C#Hi I'm looking for a C# implementation of the C++ sample, included in the DirectX 9 SDK. I tried google-ing and searching The Code Project, but didn't find anything. So I think I have to 'translate' the C++ files to C# ones. If anyone who knows where I can find C# "Depth Of Field" sample, or would like to help me translating the C++ files, please, contact me - f3r0[at]hotmail[dot]com Thanks in advance, Stan
-
Fast: Implementing Per-pixel alpha image as backgroundHi! What I would like to do is code a form that has semi-transparent image as background and rounded corners, also some controls on it. I tried a sample, per-pixel alpha, i think, but it doesn't allow you to add any other controls to the form I really need such sample code, quickly. Thanks in advance
-
Question about DLL imports - FastHi. I just have a little question: Is it possible to see an DLL import's map? When I tried to do so in a managed c++ assembly, instead of "XXX.dll" i saw a commented "No map", but in 'normal' (c# or vb.net assemblies), i see all the things. There should be a way to see the map(the name of the dll holding the exported function in an managed c++ exe), right? Here's what I got when I tried to peek at an dll import using ILDASM: .method public static pinvokeimpl(/* No map */) int32 modopt([Microsoft.VisualC]Microsoft.VisualC.IsLongModifier) modopt([mscorlib]System.Runtime.CompilerServices.CallConvStdcall) ThemepDemoCheck(uint16 modopt([Microsoft.VisualC]Microsoft.VisualC.IsConstModifier)* A_0) native unmanaged preservesig { .custom instance void [mscorlib]System.Security.SuppressUnmanagedCodeSecurityAttribute::.ctor() = ( 01 00 00 00 ) // Embedded native code // Disassembly of native methods is not supported. // Managed TargetRVA = 0x001D65D7 } // end of method 'Global Functions'::ThemepDemoCheck Thanks in advance
-
structure of a strong name key filethanks, but what about how to manually generate a token for the public key?
-
structure of a strong name key filei'm looking for an article showing how a key pair is being generated, so how the public key token is, and eventually about "binary attack" to signed .net assembly (e.g. editing the public key token using hex editor) - for educational purposes only :-D. 10x in advance
-
disassembling (correctly) managed c++ assemblies?well, i think some of the functions are native, and that's the prob
-
Question about a function...Hi there. Just wanna ask if someone knows what the function 'ThemepDemoCheck' does, and, eventually, syntax and dll, where it's exported. Thanks in advance. p.s. Think it's found in Microsoft Longhorn, not sure.
-
question about re-signing an assembyyep, i'd read an article to work out re-signing, but the public key changes, and what i need, is not changing the public key
-
disassembling (correctly) managed c++ assemblies?the assembly is just a managed c++ dll. when i disasemble it using ildasm, and (try) to re-assemble it with ilasm, the error functions' names both have 'modopt' and double dots. i do think it's bug, too.
-
question about re-signing an assembyHi. I'm looking for a solution to this question: so, I'd like to disassemble a strong named assembly, edit its IL a little and compile it again with different key pair. however, i want to keep the original public key. Is that possible? I think so, but don't know the right steps. Please help me. Thank you in advance, Stan
-
SHGetFolderPathW function syntax - questioni need to know what the nFolder variable for the value "56" is in the function SHGetFolderPath HRESULT SHGetFolderPath( HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath ); i browsed msdn, but there was no variable with such value, pls help thanks in advance
-
disassembling (correctly) managed c++ assemblies?my problem is disassembling managed c++ assemblies, so that when i try to re-compile the IL i don't get errors for functions, containing 'modopt' in their name. If you can, please tell me how to disassemble such .net assemblies. Thanks in advance, Stan