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
C

Chun Te Ewe

@Chun Te Ewe
About
Posts
16
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Random Gaussian numbers
    C Chun Te Ewe

    Thanks for the suggestion. I look into it.

    C / C++ / MFC c++ delphi lounge

  • Random Gaussian numbers
    C Chun Te Ewe

    I've found a mathematical formula to do this now. It assume zero mean and it is written in MatLab. sigma = 2; %The std deviation x1 = rand(1000,1); %Linear rand number between 0.0 to 1.0 x2 = rand(1000,1); z = sqrt(-2*sigma*log(x1)) * cos(2*pi*x2); the log here is ln, that is log to the base e. Now all we need is just to put it in C. Thanks to all who replied my post.

    C / C++ / MFC c++ delphi lounge

  • Random Gaussian numbers
    C Chun Te Ewe

    Thanks...

    C / C++ / MFC c++ delphi lounge

  • Random Gaussian numbers
    C Chun Te Ewe

    Sorry for the typo. The rand() just generates random numbers but not gaussian/normal distribution numbers. Chun Te

    C / C++ / MFC c++ delphi lounge

  • Random Gaussian numbers
    C Chun Te Ewe

    Dear all, I was wondering if there is a way to generate random gaussian numbers with Visual C++. Borland Builder has the option randg to do just this. Many many thanks Chun Te

    C / C++ / MFC c++ delphi lounge

  • Dialog Box after Dialog Box
    C Chun Te Ewe

    Dear All, I'm trying to make a program that looks like installer programmes that displays one dialog box at a time. The user will then just have to chose some options and click Next to the next dialog box. Problem is I do not know where to start and how to structure the program. Can anyone please help me out here. Many many thanks in advance Chun Te, Ewe

    C / C++ / MFC help tutorial

  • Launching another program
    C Chun Te Ewe

    Dear all, This would be a major easy question to most people here but How do I launch another program from my program, and to just show the other program window if the program is already launched? Just out of interest, how do I launch a seperate instance of the program instead of just showing it? Many many Thanks, Chun Te

    C / C++ / MFC question

  • Integrating Perl?
    C Chun Te Ewe

    Dear all, I was told by my professor to make a program in Perl and that is done. I now would like to intergrate it into a GUI program that will execute the Perl program. If this is possible, how do I do so? Does the user have to have a copy of Perl on his/her computer? Many thanks. Chun Te

    C / C++ / MFC question perl

  • Memory leak searcher?
    C Chun Te Ewe

    jhwurmbach wrote: 'BoundsChecker' or 'Purify' spring to my mind. Both are big money, but very good. Are there any freewares around?

    C / C++ / MFC performance question

  • Memory leak searcher?
    C Chun Te Ewe

    Dear all, Correct me if I'm wrong, is memory leak due to not using delete after a new? Is there a program to check my program for memory leak? Thanks Chun Te, Ewe

    C / C++ / MFC performance question

  • Splitter Window with 2 views with MFC
    C Chun Te Ewe

    Dear All, I would like to have 2 different views for a document. Each view to be display one at a time or together using a splitter window at any point of time. How best should I approach this? I'm open to any new ideas. I've just started programming and I think my question will be trivial to most of you out there. Thanks very much for taking the time to help me out Regards, Chun Te

    C / C++ / MFC question c++ help

  • DDV and DDX in Dialog Bars
    C Chun Te Ewe

    Thanks :)

    C / C++ / MFC help

  • DDV and DDX in Dialog Bars
    C Chun Te Ewe

    Dear all, I was wondering if I can perform DDV and DDX for dialog bars. If yes, could someone please help me out... Many Thanks Chun Te

    C / C++ / MFC help

  • Dialog Bars and Buttons
    C Chun Te Ewe

    Dear All, I hope anyone can help me out with this seeming simple problem. I've implemented a dialog bar with buttons on them which I would like to disable them from time to time. I've used m_wndDlgBar.GetDlgItem(IDC_BUTTON1)->EnableWindow(FALSE); and it wouldn't work. I even disabled it with the resource editor. Thanks very much for your precious time. Regards CT

    C / C++ / MFC help learning

  • Dialog Bars
    C Chun Te Ewe

    Dear all, I would like my dialog bar to be permenantly docked to the left frame. Is there anyway to do this? Thanks. CT

    C / C++ / MFC question

  • Bitmap question
    C Chun Te Ewe

    Dear all, This problem of mine has been bugging me crazy. I have to load a 24bit .bmp file and convert it to a 32 bit bmp file. I've manage to load the bitmap file, display it on the screen and even made the code to make it a 32bit bitmap. The problem is to attach the modified bits to the m_bmpBitmap CBitmap object. Then I get the info of the m_bmpBitmap with the BITMAP structure. BITMAP bm; m_bmpBitmap.GetBitmap(&bm); The bm.bmBits is 0x0 which it shouldn't be. All the CreateBitmap() and GetBitmap() funtions return successful but I can't even display the image to screen and I feel it is due to bm.bmBits = 0x0. I've even tried to create a 24 bit bitmap with the same method below and it didn't work too. I would like to be able to view the image that I created and as well as to be able to save it. I welcome any new ideas on how to approach this matter. Many many thanks. Chun Te, Ewe -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ CBitmap m_bmpBitmapOri; CBitmap m_bmpBitmap; BYTE *m_pOriSrc, *m_pSrc; HBITMAP hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), "h:\\logo.bmp" ,IMAGE_BITMAP, 0, 0, R_LOADFROMFILE | LR_CREATEDIBSECTION); m_bmpBitmapOri.Attach(hBitmap); BITMAP bmOri; m_bmpBitmapOri.GetBitmap(&bmOri); // Get the loaded bitmap m_pOriSrc = (BYTE*)bmOri.bmBits; // Pointer to the original bitmap bits // Prepare a new location if(m_pSrc!=NULL) delete [] m_pSrc; m_pSrc = new BYTE[(bmOri.bmHeight+1)*bmOri.bmWidth*4]; ... some code to change from 24bpps to 32 bpps (if needed I can provide) ... if (m_bImageValid) m_bmpBitmap.DeleteObject(); // Creating the image m_bmpBitmap.CreateBitmap( bmOri.bmWidth, bmOri.bmHeight, 1, 32, m_pSrc ); BITMAP bm; // Obtain info regarding bitmap m_bmpBitmap.GetBitmap(&bm); // // Create a device contect to load the bitmap into CDC dcMem; CClientDC pDC(this); dcMem.CreateCompatibleDC(&pDC); dcMem.SelectObject(m_bmpBitmap); pDC.BitBlt(250, 7, bm.bmWidth, bm.bmHeight, &dcMem, 0, 0, SRCCOPY); // Won't display image

    C / C++ / MFC graphics help tutorial 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