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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
R

rambojanggoon

@rambojanggoon
About
Posts
13
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • why myDiagl subclassed from CDialg don't have destructor?
    R rambojanggoon

    Hi, I'd like to know,,. 1) when I create my Dialog from CDialog class, why my Dialog does not have Destrucotr? I want to free some heap memory I used in program,,, when I write writ memory clear code? 2) class CMyView { //from somewhre(such as thread) can FuncA() {A();} //from somewhre(such as thread) can send Window Message via (SendMessage()) FuncB(WPAAM w, LPARAM l) { A();} A(){ print("A() called"); } } I'd like to know How they are diffrent? when from calling function and calling via SendMessage()? Have a day.

    C / C++ / MFC performance question

  • Can I run .exe file such as explorer.exe or notepad.exe as child window of my CView?
    R rambojanggoon

    Hi, Can I run .exe file such as explorer.exe or notepad.exe as child window of my CView? so,that .exe file is placed within my CView? Thanks.

    C / C++ / MFC question

  • can I run notepad.exe inside View window?
    R rambojanggoon

    hi, I'd like to know.. is it possible to run notepad.exe in my CView window? my Cview window coule be parent window of notepad.exe? so notepad.exe can move only inside my view window? thanks.

    C / C++ / MFC question

  • How find out the line number of died line in VC6.0?
    R rambojanggoon

    Hi I made some simple program..it sometimes die... so I'd like to know the line number which line cause problem and die. so, is there macro or function to find out died line for VC6.0? Thanks.

    C / C++ / MFC help question

  • Is it possible to split CView window with CSpliterWnd just like frame window?
    R rambojanggoon

    Hi,

    Is it possible to split view windows like frame frame window with CSplitterWnd?

    class CMyWnd : public CView
    {
    protected:
    DECLARE_DYNCREATE(CMyWnd)

    public:
    CMyWnd();
    virtual ~CMyWnd();
    CSplitterWnd m_sp;
    };

    BOOL CMyWnd::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
    {

    m_sp.Create(this, 1,2, CSize(10, 10),
    pContext);

     //CAView is subclass of CView.
    

    if(!m_sp.CreateView(0, 0,RUNTIME_CLASS(CAview), CSize( 100, 300), pContext))return FALSE;

    //CCview is subclass of CView.
    

    if(!m_sp.CreateView(0, 1,RUNTIME_CLASS(CCview), CSize(400, 300), pContext))return FALSE;
    return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
    }

    After doing above, to make window I did as followings.
    program die...
    Is it possible to split CView window with SplitterWnd?

    CMyWnd *p = new CMyWnd;
    p->Create(NULL, NULL, WS_CHILDWINDOW | WS_CLIPSIBLINGS | WS_OVERLAPPED | WS_VISIBLE|WS_BORDER,
    CRect (10,80, 1280,1024), this, 100, NULL);

    p->ShowWindow(SW_SHOW);

    C / C++ / MFC question

  • How can I avoid "Socket Notification Sink" error?
    R rambojanggoon

    when I try to "restart system" or "turn off system" , I get error message "Socket Notification Sink" Dialog box. And it didn't work reboot or turn off.. How can I avoid "Socket Notification Sink" error? My main brief code as followings. /* tread will do send something infinitely with 5 second sleep unless it is ended*/ UINT _ThreadDoSomethingInfinite(LPVOID pParam) { char buf[100]; CSocket h_sock; CMyDlg *p=(CMyDlg*)pParam; h_sock.Create( nPort , SOCK_DGRAM); while(1) { Sleep(5000); . . stcpy(buf, "some data..buffering.."); h_sock.SendTo( buf , 1234 , "127.0.0.1" ); } //will never reach... h_sock.ShutDown(2); h_sock.Close(); } CWinThread g_updsock; BOOL CMyDlg::OnInitDialog() g_updsock=AfxBeginThread(_ThreadSendAgentStatus,this,THREAD_PRIORITY_NORMAL); if(g_updsock==NULL) return; }

    C / C++ / MFC question help

  • how to caputre screen including movie play ?
    R rambojanggoon

    Hi, I'd like to know how to caputre screen including movie play which runs on Media player or GOM Player. for example, Media player run on cetner of screen... I can caputre screen with WindowDC() function... but Media player play. Media player area is captured with whole black screen... Could Someone advice me ... or some example soource ... how to capute whole screen includeing movie play... Thansk.

    C / C++ / MFC tutorial question

  • how to caputure scrollview including unvisible area?
    R rambojanggoon

    Hi, I'd like to how caputre scrollview area, incluing unvisible area... scrollview size is nomally big than actually monito's resoluton, unvisible area don't captured...

    CRect rect;
    HWND	hWnd = m\_hWnd; // m\_hWnd is hanle of scrollview. 
    if (hWnd == NULL) return;
    
    HDC hScrollView = ::GetWindowDC(hWnd);
    HDC hCaptureDC = CreateCompatibleDC(hScrollView);
    
    CRect m\_rDrawingSurface;	
    ::GetWindowRect(hWnd,&m\_rDrawingSurface);
    
    BITMAPINFOHEADER BMIH; 
    HBITMAP m\_hCaptureBitmap;
    BYTE\* m\_pDrawingSurfaceBits;
    
    CDC\* pDC = GetDC();
    if(pDC != NULL)
    {
    	BMIH.biSize = sizeof(BITMAPINFOHEADER);
    	BMIH.biBitCount = 24;
    	BMIH.biPlanes = 1;
    	BMIH.biCompression = BI\_RGB;
    	BMIH.biWidth = m\_rDrawingSurface.Width();
    	BMIH.biHeight = m\_rDrawingSurface.Height();
    	BMIH.biSizeImage = ((((BMIH.biWidth \* BMIH.biBitCount) + 31) & ~31) >> 3) \* BMIH.biHeight;
    	m\_hCaptureBitmap = CreateDIBSection(pDC->GetSafeHdc(), (CONST BITMAPINFO\*)&BMIH, DIB\_RGB\_COLORS, (void\*\*)&m\_pDrawingSurfaceBits, NULL, 0);
    	ReleaseDC(pDC);
    }
    
    SelectObject(hCaptureDC,m\_hCaptureBitmap); 
    BitBlt(hCaptureDC,
    	0,
    	0,
    	m\_rDrawingSurface.Width(),
    	m\_rDrawingSurface.Height(),
    	hScrollView,0, 0,SRCCOPY|CAPTUREBLT); 
    
    CxImage \*image = new CxImage();
    if(m\_hCaptureBitmap)
    {
    	image->CreateFromHBITMAP(m\_hCaptureBitmap);
    	bool retval;
    
    	retval = image->Save("c:\\\\ss.bmp", CXIMAGE\_FORMAT\_JPG);
    }
    if (image) delete image;
    
    
    
    ::ReleaseDC(hWnd,hDesktopDC);
    DeleteDC(hCaptureDC);
    DeleteObject(m\_hCaptureBitmap); :)
    
    C / C++ / MFC tutorial question

  • CreateCompatibleBitmap() retuns 0 , and GetLastError returns 8 , what does error code 8 means?
    R rambojanggoon

    Hello. CDC *pDC = GetDC(); CDC tmpDC; BOOL bRet=tmpDC.CreateCompatibleDC( pDC ); //bRet is 1 => it means succes. CBitmap m_bmp; bRet= m_bmp.CreateCompatibleBitmap( pDC, rect.Width(), rect.Height() ); //bRet is 0 ==>it is an error. DWORD err=GetLastError(); //err is 8. --> it is an error. error code 8 means : "Not enough storage is available to process this command. " here, my hdd is 50M remains, and I have enough space fo runing some program... Why, CreateCompatibleDC() return error code 8? my System is abnormal? Thanks.

    C / C++ / MFC help question

  • flowing strings on BMP image of SDI View window?
    R rambojanggoon

    Hi, I'd like get some idea how to do it? I displayed BMP image(full screen) in OnPaint fuction of SDI CView Window.(it's OK ); I'd like to flow a strings over the BMP image form right-bottom to left-bottom. it is just like subtitle on TV... How can I approach it to do it? because I'm VC beginner ... Any comment will help.. Have a day.

    C / C++ / MFC question help tutorial learning

  • after calling GetCurrentBuffer(&lBufferSize,NULL), lBufferSize is minus value.
    R rambojanggoon

    Hi, to capture video screen in DirectShow , I did as follwing... it's woring well in case of *.wmv file... but in case of *.avi didn't work... After calling ...GetCurrentBuffer(&lBufferSize,NULL); the value of lBufferSize is minus...(for example -2838382392 ) I don't know why lBufferSize is minus value... void CTest::play() { m_pGB = NULL; m_pMC = NULL; m_pVW = NULL; m_pBV = NULL; m_pME = NULL; m_pMS = NULL; m_pSampleGrabber = NULL; m_pSG = NULL; CoInitialize(NULL); CString m_file; WCHAR wFileName[MAX_PATH]; TCHAR m_szFileName[MAX_PATH]; m_file = m_,"C:\\cs\\mds\\movie\\a.avi"; #ifndef UNICODE MultiByteToWideChar(CP_ACP, 0, m_file , -1, wFileName, MAX_PATH) ; #else lstrcpy(wFileName, m_szFileName); #endif CoCreateInstance(CLSID_FilterGraph,NULL,CLSCTX_INPROC,IID_IGraphBuilder,(void**)&m_pGB); CoCreateInstance(CLSID_SampleGrabber,NULL,CLSCTX_INPROC,IID_IBaseFilter,(void**)&m_pSampleGrabber); m_pGB->AddFilter(m_pSampleGrabber,L"Sample Grabber"); AM_MEDIA_TYPE m_pMedia; ZeroMemory(&m_pMedia,sizeof(m_pMedia)); m_pMedia.majortype = MEDIATYPE_Video; m_pMedia.subtype = MEDIASUBTYPE_RGB24; m_pSampleGrabber->QueryInterface(IID_ISampleGrabber,(void**)&m_pSG); if(m_pSG != NULL) { m_pSG->;SetMediaType(&m_pMedia); m_pSG->SetBufferSamples(TRUE); } m_pGB->QueryInterface(IID_IMediaControl,(void**)&m_pMC); m_pGB->QueryInterface(IID_IVideoWindow,(void**)&m_pVW); m_pGB->QueryInterface(IID_IBasicVideo,(void**)&m_pBV); m_pGB->QueryInterface(IID_IMediaEventEx,(void**)&m_pME); m_pGB->QueryInterface(IID_IMediaSeeking,(void**)&m_pMS); m_pGB->RenderFile(wFileName,NULL); m_pMC->Run(); } void CTest::ScreenShot() { m_pSampleGrabber->QueryInterface(IID_ISampleGrabber,(void**)&m_pSG); if(m_pSG == NULL) { return; } long lBufferSize; m_pSG->GetCurrentBuffer(&lBufferSize, NULL); BYTE* pBuffer = new BYTE[lBufferSize]; if (!pBuffer) return; m_pSG->GetCurrentBuffer(&lBufferSize, (long *)pBuffer); if (m_pSG != NULL)SaveImage(...); delete pBuffer; }

    C / C++ / MFC tutorial

  • how to give "transaction effect" in case of jpg,gif and so on.
    R rambojanggoon

    Hi, I can give "transaction effect" with BitBlt() on Screen in case of Bitmap image. but I'd like to know how to give "transaction effect" in case of jpg,gif and so on. === short example code === CDC MemDC; BITMAP bm; m_Bitmap.LoadBitmap(IDB_BITMAT1); m_Bitmap.GetBitmap(&bm); MemDC.CreateCompatibleDC(pDC); CBitmap* pOld = (CBitmap*)MemDC.SelectObject(&m_Bitmap); int w=bm.bmWidth; int h=bm.bmHeight; for(int j=0;j<w;j+=2) { pDC->BitBlt(0,0,j,h,&MemDC,w-j,0,SRCCOPY); } pDC->BitBlt(0,0,w,h,&MemDC,0,0,SRCCOPY); MemDC.SelectObject( pOld ); Any comment will help me! Thanks, have a day.

    C / C++ / MFC tutorial graphics help

  • how to convert power point (.ppt ) to image file such as jpg or bmp fles?
    R rambojanggoon

    Hi, I'd like to know. Is it possible to convert power point (.ppt ) to image file(jpg or bmp) with VC6? Actually, I want slide show in my VC6 application. so I need to convert .ppt file to several image files... Any comment will help me.. Have a day.

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