Where do I put the code?


  • Below is the body of code for a small DLL I'm writing. Where do I put the code? This is from Processor.cpp in VS2010.





    // TODO: add construction code here,


    // Place all significant initialization in InitInstance



    // The one and only CProcessorApp object

    CProcessorApp theApp;


    // CProcessorApp initialization

    BOOL CProcessorApp::InitInstance()







    Monday, June 06, 2011 2:14 PM

All replies

  • I thing that you should create an MFC DLL and select the ‘Regular’ type of DLL. Call it “Processor” and the Wizard will generate the CProcessorApp class.

    Monday, June 06, 2011 2:31 PM
  • Thank you Viorel_.

    I think I did. I know I created an MFC DLL. I elected to link the libaries in with the DLL. Is that OK?

    And where do I put the code?


    Monday, June 06, 2011 2:36 PM
  • What's your point? or what do you want? I did not understand.

    Tuesday, June 07, 2011 8:04 AM
  • Hi Renee,


    Would you mind letting me know the result of the suggestions? If you need further assistance, feel free to let me know. I will be more than happy to be of assistance.


    Best regards,


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, June 13, 2011 2:19 AM
  • I did not receive any usable answers really and I have a book that has none of that BUT I added a file called main.cpp and Voila it started right up. Actually I need a book on theory....

    So that gives me a starting point.....


    Monday, June 13, 2011 2:23 AM
  • Veg,


    I worked whem 4 mb was a large system and it ran fast with 30 people. It was on VAX/VMS. My first x86 system was a 4 or 8 MB system. You know it was a 30 person projrct for MCI and I was doing failover and shadowing so I had my own system.


    Monday, June 13, 2011 2:43 AM
  • Out of curiosity, are you writing code to try to determine how many threads to start and run simultaneously in a multi-threaded application?

    If so, what operating systems do you intend to run it on?

    In developing a graphics-intensive multi-threaded app (datasets generally much larger than the L2 cache sizes) I found that in general starting the number of threads equal to the number of physical processors + 0.5 * the number of additional logical processors because of hyperthreading, but reduce the count by 1 if every physical processor would be used when there are more than two, seemed to be the best overall approach for running on a variety of old and new systems.  VERY interesting to see the tradeoffs in performance in actual operation.

    I sense you're going to have fun.


    Monday, June 13, 2011 4:31 AM
  • No, I left in 92 at the end of the 32 bit processors. I've never seen an Alpha believe it or not.

    The local wisdom is not to exceed the number of processors with a greater nimber of threads and put each thread on it's own processor. This seems a little exhorbitant to me because Windows is a time sharing system. Whereas I understanf the concerns, I domt know why they set the thread ratio that low.

    VMS never had formalized multithreading for it's 32 bit machines although it did for Alphas. So what I know about it I learned in the VB forum for Windows.


    Monday, June 13, 2011 4:44 AM
  • I am rewriting a realtime performance monitor that I run called pmon. It's color coded an I'm very worried about runing out of colors since there is a unique color for every processor.


    Monday, June 13, 2011 4:48 AM
  • A valid concern.  A dual 6 core system with hyperthreading will net you 12 physical and 12 additional logical processors...

    Is this "local wisdom" you speak of Intel processor-specific?  Not exceeding the number of physical processors doesn't seem to leverage the additional capabilities Hyperthreading brings to the party, and I can tell you based on testing that more processing gets done if you DO keep the execution units more busy via additional hyperthreading threads.  Leaving half the hyperthreading thread slots free for the rest of the system to get by while the high performance computing task is going on seems to be enough to keep from interfering with the user experience and using them all up simply doesn't net that much more throughput (and sometimes less). 

    So in essence, a hyperthreading logical processor seems to be worth about half a real processor in additional performance.  This seems to be a fair rule of thumb in Windows XP, Vista, and 7 with both the 32 and 64 bit instruction sets on various Intel processors.


    Monday, June 13, 2011 12:50 PM