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
Z

zecodela

@zecodela
About
Posts
151
Topics
95
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • .net event in Excel
    Z zecodela

    I am not sure about the Excel Object Model. I want to have a C# library I can call a C# function, which i have done with help of below article. http://blogs.msdn.com/eric\_carter/archive/2004/12/01/273127.aspx I also want to have setup callback, event in the C# space and i can get the callback/event inside Excel. eg. i have an event like below, i can get the event with AlarmEventHandler. I just want to have such event happening in Excel. (below code copied from msdn)

    public class AlarmClock
    {
    public event AlarmEventHandler Alarm;

      protected virtual void OnAlarm(AlarmEventArgs e)
      {
         if (Alarm != null) 
         {
            // Invokes the delegates. 
            Alarm(this, e);
         }
      }
    

    }
    public static void Main (string[] args)
    {
    // Instantiates the event receiver.
    WakeMeUp w= new WakeMeUp();

         // Instantiates the event source.
         AlarmClock clock = new AlarmClock();
    
         // I want to able to get this event inside Excel VBA space.
         clock.Alarm += new AlarmEventHandler(w.AlarmRang);
    
         clock.Start();
    

    }

    C# csharp tutorial question

  • .net event in Excel
    Z zecodela

    Hi all, Any idea how to handle an C# event in a Excel? eg. invoke Excel action with a C# timer event. (I can article "C# handle Excel's event" but not "C# event in Excel") thank you! Jim

    C# csharp tutorial question

  • polymorphism question - child pointer to parent class
    Z zecodela

    Let me restate my question below code can be compile and run with no problem. but, i confused how the bold line works. I have not initialzed a CTriangle object in the bold line but i can access the data by a CTriangle pointer. I dont think it is a good practice but i am quite confused how it works...

    class CPolygon {
    protected:
    int width, height;
    public:
    void set_values (int a, int b)
    { width=a; height=b; }
    //virtual int area (void) =0;
    virtual int area (void)
    {return 0;}
    void printarea (void)
    { cout << this->area() << endl; }
    };
    class CTriangle: public CPolygon {
    public:
    int area (void)
    { return (width * height / 2); }
    int testdata;
    };

    int main () {
    CPolygon poly;
    CTriangle trgl;
    CPolygon * ppoly2 = &trgl;
    CTriangle * ptrgl = (CTriangle *) &poly;
    ppoly2->set_values (4,5);
    ptrgl->set_values (4,5);
    ppoly2->printarea();
    ptrgl->printarea();
    ptrgl->testdata = 100;
    cout << ppoly1->area() << endl;
    cout << ppoly2->area() << endl;
    cout << ptrgl->area() << endl;
    cout << ptrgl->testdata << endl;
    system("PAUSE");
    return EXIT_SUCCESS;
    }

    C / C++ / MFC oop question

  • polymorphism question - child pointer to parent class
    Z zecodela

    hi all, anyone have a idea the meaning of the bold lines. using child pointer to a the parent class. class CPolygon { protected: int width, height; public: void set_values (int a, int b) { width=a; height=b; } //virtual int area (void) =0; virtual int area (void) {return 0;} void printarea (void) { cout << this->area() << endl; } }; class CTriangle: public CPolygon { public: int area (void) { return (width * height / 2); } int test; }; int main () { CRectangle rect; CTriangle trgl; CPolygon * ppoly1 = ▭ CPolygon * ppoly2 = &trgl; CTriangle * ptrgl = (CTriangle *) ▭ ppoly1->set_values (4,5); ppoly2->set_values (4,5); ptrgl->set_values (4,5); ppoly1->printarea(); ppoly2->printarea(); ptrgl->printarea(); ptrgl->test = 1; cout << ppoly1->area() << endl; cout << ppoly2->area() << endl; cout << ptrgl->area() << endl; system("PAUSE"); return EXIT_SUCCESS; }

    C / C++ / MFC oop question

  • C# connects to Sybase IQ
    Z zecodela

    Hi all, does anyone know how to connect to Sybase IQ with using ODBC driver? Is there something DataProvider library can be used? thanks, jim

    C# csharp tutorial question

  • Get exact memory usage of a process.
    Z zecodela

    Hi All, I am debugging my application by printing the Working Set at the specific point with the function provided in psapi.h My purpose is to check which part of my application used up the memory. However, just look at the Working Set is not very conclusive. I found if allocated 1k memory in the app but the Working Set may not grow up 1k accordingly. It will grow eventually(say allocated 10 times 1k, Working Set will grow up around 10k.) In the psapi.h, there are several values such PageFault, PagedPool, Pagefile... i can see those values will change each time when allocating memory. I guess the result of memory allocation action has reflected in those values. What i want to ask is any formula to calculate the exact memory usage of the application? say, i do "new char[128]" the memory usage result will grow up 128byte immediately. Any reply will be appreciated! Thanks! Jim

    C / C++ / MFC performance question

  • how to print application memory
    Z zecodela

    Mark, Thank you for your quick response! let me take a look! Jim

    C / C++ / MFC question c++ performance tutorial

  • how to print application memory
    Z zecodela

    Thanks! Mark. This is what i did but i used the _CRTMemXXXX function from crtdbg.h. i guess your CMemoryState is from MFC. I have i question. If there is no memory leak, but i want to print the app's allocated memory size (sth like the "memory" column in task manager). Any function can serve this purpose? thanks! jim

    C / C++ / MFC question c++ performance tutorial

  • how to print application memory
    Z zecodela

    Hi All, i have an MFC application receive event message and based on the message type to new "Order" object. the created object stored in a map and never delete thro' the application cycle. my "Order" class size only < 1k byte. however, the application memory grow as 100k per order inputted. i added the CRT memory leak statement (use _CrtMemDifference, _CrtMemCheckpoint) to see the difference after executed function for each event. the result can show the object size (Order class) i created. however, the 100K grow rate still not able to show. questions: A) i wonder i dont know what reflect in those functions. anyone have idea on this? B) more effective question is how can i print the memory size of my application? so, i can check the memory usage difference for each big function call and drill down the problematic function. like this : printf("b4 handler"); printMemSize(); BigHandler(); printf("after handler"); printMemSize(); any reply will be highly appreciated! thanks! jim

    C / C++ / MFC question c++ performance tutorial

  • how to read VERSION value in resource file
    Z zecodela

    hi, anyone know how to read the VERSION value in the resource file? i am referring to VERSION value that can be found as file version, product version in the windows explorer. basically, i want to read this value and write to the log file. any have any idea? thanks!

    C / C++ / MFC tutorial question announcement learning

  • auto versioning?
    Z zecodela

    yes, this is great! thanks!!!

    C# csharp question

  • auto versioning?
    Z zecodela

    hi, any method to add versioning information automatically in .NET? or, any method to place the build date/time in the source file then i can read it back in the binary? thanks, jim

    C# csharp question

  • crash with dump?
    Z zecodela

    i have tested with another application. i make it crash. i can still see event log capture this event even dr. watson failed to get the dump. i heard that dr watson only dump for some problems will affect the OS. anyway, the event log and drwatson should be running. (at least, it can capture the crash i make) however, i just dont know my target application is really crashed or being killed by somebody.

    C / C++ / MFC help sysadmin debugging tools question

  • crash with dump?
    Z zecodela

    hi all, is it possible an application crashed but the dr. watson and windows event log not able to detect it? i have a server application running daily. it have a simple dialog and a tray icon. today, i found it disappear from the screen in lunchtime, just like being killed by taskkill.(the tray icon is still here) i cant find any eventlog for application crash and dr. watson have no dump for this, which suppose logged for the crash i found b4. i added taskkill in the scheduler to kill the application at 5pm and i experienced some strange behaviour of this schedule b4. (like it run a long while later than our schedule time..) so, i wonder if the killtask killed the application abnormally. i dont think it is a reasonable answer anyway! so, i want to ask u guys experience any an application crash but windows cant detect? (just like the application disappear suddenly, no dialog asking u to report MS, no eventlog and no dr.watson dump) and, i have tried to make another simple application with bug to crash and test in that server. the crash of that application able to create the eventlog and all the dumps i said b4... of course, this crash may not the same as the crash of that application. just want to make sure the windows started dr.watson and all debug monitoring tools. pls help! i just feel to frustrate this problem appear. i have no hint what happen... thanks, jim

    C / C++ / MFC help sysadmin debugging tools question

  • VS 's Installer
    Z zecodela

    hi, anyone know how to add a file/shortcut to All User's Desktop? currently, i know how to add to user desktop(user install the application). however, not all the case user account is same as installation user account. any help? thanks, jim

    Visual Studio visual-studio help tutorial question

  • VS 's Installer
    Z zecodela

    hi, anyone know how to add a file/shortcut to All User's Desktop? currently, i know how to add to user desktop(user install the application). however, not all the case user account is same as installation user account. any help? thanks, jim

    C# visual-studio help tutorial question

  • #define in C#
    Z zecodela

    hi, i want to know any method to implement #define similar thing in C#. i need to declare some const like below in C++ #define STATUS_A 'a' currently, i used public const char STATUS_A = 'a'; or enum STATUS { A = 'a'; } apart from above methods, any other method? thanks, jim

    C# csharp c++ question

  • how to remove an EventHandler?
    Z zecodela

    hi, i found a form can't be destroyed after registered for the Main form's timer event. below are 2 methods used to create the form. one register with timer event, one without. i can see that the destructor of the one without timer event registered will be called after i open and close the form several times. but, the one with timer event registered. destructor will be called only when the main app exit. so, any method to help? // inside main form private Form2 frmbulk; private int counter; private void button1_Click(object sender, System.EventArgs e) { Cursor currentCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; frmbulk = null; frmbulk = new Form2("Form2_"+System.Convert.ToString(counter++)); this.timer1.Tick += new EventHandler(frmbulk.TimerEventHandler); frmbulk.Show(); Cursor.Current = currentCursor; } private void button2_Click(object sender, System.EventArgs e) { Cursor currentCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; frmbulk = null; frmbulk = new Form2("Form2_"+System.Convert.ToString(counter++)); frmbulk.Show(); Cursor.Current = currentCursor; }

    C# help tutorial question

  • System.String - Reference Type
    Z zecodela

    in .net documentation, System.String stated as reference type. so, i supposed it will pass the reference to the method and the modification will affect to the original variable. but, i found it is not true! here is the sample i draft. anyone could give me a help so that i work as call by reference.? private void button1_Click(object sender, System.EventArgs e) { System.String A; System.String B; A = "A for apple"; B = "B for boy"; Sub(A, B); MessageBox.Show("A: "+A+", B: "+B); } private void Sub(System.String a, System.String b) { System.String tmp; tmp = a; a = b; b = tmp; }

    C# csharp help question

  • Serialization for an ArrayList
    Z zecodela

    yes, the current method i used is the copy the arraylist to a object array like below code but it need extra work private ArrayList listTradePattern; public class TradePatternList { public TradePatternList() { listTradePattern = new ArrayList(); } [XmlElement("Pattern")] public TradePattern[] TradePatterns { get { TradePattern[] tradepatterns = new TradePattern[ listTradePattern.Count ]; listTradePattern.CopyTo( tradepatterns ); return tradepatterns; } set { if( value == null ) return; TradePattern[] tradepatterns = (TradePattern[])value; listTradePattern.Clear(); foreach( TradePattern tradepattern in tradepatterns ) listTradePattern.Add( tradepattern ); } } }

    C# xml json question
  • Login

  • Don't have an account? Register

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