Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
I

Ilia Blank

@Ilia Blank
About
Posts
24
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Deserializing Generic List<object> taking a lot of time</object>
    I Ilia Blank

    Well, what I basically recommend using StreamWriter, StreamReader class to write to file /read from the file data stored in your objects. The approach requires specifying format of the file and how pieces of the data stored / retrieved from the file.   When applied to your example is might look something like this <code> using System; using System.Collections.Generic; using System.Text; using System.Runtime.Serialization; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Diagnostics; namespace ConsoleApplication1 {       public class CTempClass       {             public int m_uCrc64;             public int M_uCrc64             {                   get                   {                         return m_uCrc64;                   }                   set                   {                         m_uCrc64 = value;                   }             }             public CTempClass()             {                   m_uCrc64 = 0;             }       }       class Program       {             static void Main(string[] args)             {                   List<CTempClass> lsTemp = new List<CTempClass>();                   for (int i = 0; i < 1000000; i++)                   {

    C# json performance help

  • Deserializing Generic List<object> taking a lot of time</object>
    I Ilia Blank

    You won’t be able to improve significantly performance while using .Net built in serializers. They are inheritably slow. I bumped into this many times. If performance is an issue I would recommend considering implementing custom destabilization (another word for “read you file and parse data in you code”).

    C# json performance help

  • MultiThread and File process
    I Ilia Blank

    Sounds as horse position is embedded inside com3 message. Am I right?

    C# help tutorial question

  • MultiThread and File process
    I Ilia Blank

    Sorry, I failed to understand last statement. You indicated that you use com3 event to drive “real time” animation. Can you provide more details?

    C# help tutorial question

  • MultiThread and File process
    I Ilia Blank

    Assuming that you have three files with full history of the race for each horse from start to finish and you are requested to create animation that simulates the race while preserving proper timing of the race. That what I would do 1. Load each file into corresponding list. Each list element represents position of the horse and timing of this position. Each list is sorted by time. 2. Merge three arrays into one list. Each list element represent time and position of all three horses at this time. The list is sorted by time. 3. Develop UI control that is capable of painting one race frame based on individual element from array created on step 2. Development of such control might be challenging but in general you have to assure that method called to draw particular frame “HorseRaceArenaControl::DrawRaceFrame (horse1Position, horse2Position, horse3Position ) “ can be called from arbitrary thread. The topics that you have to explore are Control::Invoke, Control::OnPaint, “implementing own-drown control”, 4. To call DrawRaceFrame method for each element in the list created in step 2. The method has to be called with time intervals as recorded in each element. You can use .Net System.Threading.Timer class to assure proper timing. I realize that this is not detailed instruction but rather general guidelines. Hopefully it can serve as starting point.

    C# help tutorial question

  • MultiThread and File process
    I Ilia Blank

    Correct me if I am wrong, in both cases the files will contain full history of the race for given horse. For example: 0 milliseconds 0 meters 2 milliseconds 0.3 meters 8 milliseconds 0.8 meters 12 milliseconds 1.1 meters … 88354 milliseconds 2000 meters //Finish

    C# help tutorial question

  • MultiThread and File process
    I Ilia Blank

    How the drawing is initiated? For example: I have to update my animation when one of the files is updated on the disk. Or I have to update my animation with specific time intervals.

    C# help tutorial question

  • MultiThread and File process
    I Ilia Blank

    Can you provide more details?

    C# help tutorial question

  • Interrogating objects passed from COM
    I Ilia Blank

    You can use oleview.exe to explore COM types registered on your computer. I assume that you know at least name of the COM type that is passed to your assembly. Use the name to look for the type inside oleview.exe.

    C# com debugging help question

  • What’s wrong with “Race condition” in India?
    I Ilia Blank

    ??

    The Lounge question

  • What’s wrong with “Race condition” in India?
    I Ilia Blank

    To all developers from India We are interviewing candidates for programming position in Hyderabad India. None of them is able to answer question "What is Race Condition". Can it be that you are using different term in India? Regards

    The Lounge question

  • Trace implementation for static methods.
    I Ilia Blank

    Hi, My C# code calls to bunch of external methods exported from gdi32.dll That’s example of the code we use to export the methods from the dll: [DllImport("gdi32.dll")] internal static extern int ExtEscape(HDC hDC, int nEscape, int inputSize, ref CWDDECMD InputData, int outputSize, ref CIWSINFO OutputData); … [DllImport("gdi32.dll")] internal static extern int ExtEscape(HDC hDC, int nEscape, int inputSize, ref CWDDECMD InputData, int outputSize, ref CIOVLTHEATERMODE OutputData); There are over two hundred of method declarations and they are different only by type of parameters (ie CIWSINFO versus CIOVLTHEATERMODE in this examle). The methods are called from all around the code. Now I have to come with design that allows tracing calls to the methods While printing the name of the method and type and values of passed parameters (this part is simple as each passed type implements ToString method). I just hate idea of duplicating each declaration with the method that performs tracing before calling to real method: [DllImport("gdi32.dll")] internal static extern int ExtEscape(…); static int ExtEscapeTrace (…) { DoTrace (); ExtEscape (…) ; //Perform real call } To bad the methods are static; otherwise I would be able to use proxies. Any ideas?

    C# csharp design debugging tutorial question

  • Define a namespace for the WebPage in .NET 2.0
    I Ilia Blank

    Is it possible to define a namespace for the web page, that does not have a separate code-behind class? If yes, how?

    ASP.NET csharp question

  • "Unadvising" Event Sink in VB6
    I Ilia Blank

    I have COM object written in C# that exposes connection points and deployed as out of process server. I wrote VB6 application that supplies handler for the events fired by this COM object. To do that I added reference in my VB project to type library generated for C# COM. Next I used WithEvents statement in my VB code to declare variable of the events firing type exported from the COM. The application works fine. I can consume the events from the C# COM in my VB6 code. Problem arises when I stop my VB application. The delegate that implements the event in C# remains assigned and exception is thrown when attempt is made to call it. When you implement Event Sink say in C++ you use Advise – Unadvise paradigm to assign and clean up your handlers. What you supposed to do in VB6? Any help will be appreciated.

    Visual Basic help csharp c++ com

  • "Unadvising" Event Sink in VB6
    I Ilia Blank

    I have COM object written in C# that exposes connection points and deployed as out of process server. I wrote VB6 application that supplies handler for the events fired by this COM object. To do that I added reference in my VB project to type library generated for C# COM. Next I used WithEvents statement in my VB code to declare variable of the events firing type exported from the COM. The application works fine. I can consume the events from the C# COM in my VB6 code. Problem arises when I stop my VB application. The delegate that implements the event in C# remains assigned and exception is thrown when attempt is made to call it. When you implement Event Sink say in C++ you use Advise – Unadvise paradigm to assign and clean up your handlers. What you supposed to do in VB6? Any help will be appreciated.

    C# help csharp c++ com

  • "Unadvising" Event sink in VB6
    I Ilia Blank

    I have COM object written in C# that exposes connection points and deployed as out of process server. I wrote VB6 application that supplies handler for the events fired by this COM object. To do that I added reference in my VB project to type library generated for C# COM. Next I used WithEvents statement in my VB code to declare variable of the events firing type exported from the COM. The application works fine. I can consume the events from the C# COM in my VB6 code. Problem arises when I stop my VB application. The delegate that implements the event in C# remains assigned and exception is thrown when attempt is made to call it. When you implement Event Sink say in C++ you use Advise – Unadvise paradigm to assign and clean up your handlers. What you supposed to do in VB6? Any help will be appreciated.

    COM help csharp c++ com

  • Compressing directrory tree into single zip file
    I Ilia Blank

    What is a best approach for compressing directories structure witch contains multipile files into single zip file using c#.

    C# csharp data-structures question

  • key down in windows forms (C# 2.0) [modified]
    I Ilia Blank

    It will work only if the the form captured the input. As far as I unerstand the goal is to catch all keyborad key downs regardless to the current window.

    C# question csharp winforms

  • key down in windows forms (C# 2.0) [modified]
    I Ilia Blank

    You can read about windows hooks in .Net here http://msdn.microsoft.com/msdnmag/issues/02/10/CuttingEdge/[^] Use WH_KEYBOARD when installing the hook procedure with SetWindowsHookEx Use following code to detect key down in your hook static readonly int WM_KEYDOWN = 256, public Int32 KeyboardProc(int code, Int32 wParam, Int32 lParam) { if ((Int32)wParam == (Int32)WM_KEYDOWN ) { // do processing } // do not forget to call next hook !!!!!!!!!!!! // CallNextHookEx is win32 api that can be loaded to .Net // using dll import like they did with setwindowshookex in example return CallNextHookEx(hHook, code, wParam, lParam); }

    C# question csharp winforms

  • key down in windows forms (C# 2.0) [modified]
    I Ilia Blank

    You have to install windows hook procedure to intercept all keyboard events. Look at “How can I use 'Hooks' in .NET” article at following link http://72.14.203.104/search?q=cache:NUhXDPTnLJgJ:www.syncfusion.com/FAQ/WindowsForms/FAQ\_c70c.aspx+"DllImport"+SetWindowsHookEx+WH\_KEYBOARD+C%23&hl=en&gl=ca&ct=clnk&cd=1

    C# question csharp winforms
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups