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
J

JHAKAS

@JHAKAS
About
Posts
35
Topics
22
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Free Grid and charting controls for VB.NEt
    J JHAKAS

    Hello to all Kindly provide me link to free charting and grid controls to be used along with VB.NET Leave your mark wherever you go

    Visual Basic csharp css

  • ScaleViewportExt and SetViewOrg related query
    J JHAKAS

    Any suggestions Leave your mark wherever you go

    C / C++ / MFC help question database

  • ScaleViewportExt and SetViewOrg related query
    J JHAKAS

    Hi all I am facing problem with the following issues: 1.0 Mapping Mode 2.0 ScaleViewport 3.0 SetViewOrg. I am using QZoomView a class from Codeguru as base class of my view which inturn is derived from CScrollView Following is the OnPrepareDC function of the My View Code: void CPatternView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) { if ((m_Mode == MODE_ANALYSIS && m_AnalysisItem == AN_TIME_WINDOW) || (m_Mode == MODE_ANALYSIS && m_AnalysisItem == AN_WFR_DIAGRAM)) { QZoomView::OnPrepareDC(pDC, pInfo); } else { CScrollView::OnPrepareDC (pDC,pInfo); pDC->SetMapMode(MM_LOENGLISH); } } And OnPrepareDC of QZoomView Code: void QZoomView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) { CScrollView::OnPrepareDC(pDC, pInfo); if (!pDC->IsPrinting()) { ASSERT(m_Zoom > 0.0f); int denom(1000); // WHAT IS THIS? int num((int)(m_Zoom * (float)denom)); pDC->SetMapMode(MM_ANISOTROPIC); pDC->ScaleViewportExt(num, denom, num, denom); CRect rect; GetClientRect(&rect); CPoint pntVO = pDC->GetViewportOrg(); // Center in window if small enough if (m_totalDev.cx < rect.Width()) pntVO.x = (rect.Width() - m_totalDev.cx) / 2; if (m_totalDev.cy < rect.Height()) pntVO.y = (rect.Height() - m_totalDev.cy) / 2; pDC->SetViewportOrg(pntVO); } } PROBLEM STATEMENT This indicates that when I am calling QZoomView::OnPrepareDC then it changes the view settings and then if i am using onpreparedc of CScrollview then content of my view get displaced/shifted horizontally. I just want to get the view in initial position i.e. the effect of changes made by QZoomView::OnPrepareDC get neglected. Can you please help me in getting this done? Sandeep Leave your mark wherever you go

    C / C++ / MFC help question database

  • GDI+ startup
    J JHAKAS

    Hi I am new to GDI+. I have been working for last two years on traditional GDI. Well I am having a project in which i will require to perform following tasks and for the purpose of the same i want to use GDI+ 1.0 Saving View content to the Image files, say JPG, BMP,etc 2.0 Antialiasing line and circle drawing to get smooth plot. I am knowing that i have to redistribute teh gdiplus.dll in my application folder and set /BASE while building I just want to know that: 1.0 What are other dependebncy for GDI porting? 2.0 Can we use GDI and GDI+ in one code? 3.0 How to save the content of view to Image file? 4.0 How to draw antialiased lines, etc? Thanking You in advance Sandeep Arya Leave your mark wherever you go

    C / C++ / MFC graphics winforms tutorial question

  • Is there any method to draw point and ellipse using real value( i.e. floats)
    J JHAKAS

    Hi Is there any method of drawing circles and points with float values. I am drawing a series of circles and points on my view. (A scientific application) I am using SetPixel and Ellipse methods to draw point and circles respectively. Every thing is working fine, but to the application context when we analyse further that series of holes have to be closer i.e. at one end all holes circumference must overlap and just give a shape like all circles are connected at that point. Circles are generally one inside other. i.e. bigger outside and then smaller inside. But it instead of showing holes closer it shows them somewhat wider. I thought this might be due to holes i am plotting with int values. Thats why this thought that if holes drawn with float to check whetehr it corrects the problem i am facing. Sandeep Leave your mark wherever you go

    C / C++ / MFC graphics help

  • handling databases in MFC
    J JHAKAS

    Hi derive class from Crecordset using class wizard. (Ctrl+W) In process it will ask you database path and table name. Give the table name and then it will show all the attributes from table as its members list. assign name to member Implement or use Database open and close calls Better to start is some of the tutorials from either codeguru or codeproject Hope this will help Remember Ms-Access - database limit -- 2GB Best of luck Leave your mark wherever you go

    C / C++ / MFC c++ database tutorial

  • Listcontrol problem
    J JHAKAS

    listCtrl problem: Hello I am inserting some item to list control from database. Say items are stored in database as following: A1, B1, C1, A2, B2, C2,A3,B3,C3 ------ line 1 My list control is in ascending sort order, so it displays the design as alphabetically ascending order: A1, A2, A3, B1, B2, B3, C1, C2, C3 ------ line 2 Now in list box i am selecting B1,B2,B3 and using following code: POSITION pos = m_DesignList.GetFirstSelectedItemPosition(); // Get all the item in the listview selected 's Design ID // and assign it to the IDArray in the following loop if (pos == NULL) TRACE0("No items were selected!\n"); else while (pos) { int nItem = m_DesignList.GetNextSelectedItem(pos); if(D_EXPORT == m_ModeFlag ) // EXPORT mode { // indexArr is array filled in function onInitDialog. So it contains index value as shown in line 1 IDArray[incr++] = indexArr[nItem]; -- line 3 } m_indexCount ++; // Increase the counter of number of designs selected } Line 3- is the main root of problem. When i select say B1,B2,B3 from the list , so as there index in the list are 3,4,5 (0 based), but actually in the recordset they are 1,4,7 instead Note: I have to keep the Listcontrol items in sorted manner. Leave your mark wherever you go

    C / C++ / MFC database design data-structures help

  • Print Preview appears microscopic
    J JHAKAS

    Well the printing is dangerous task i do not know why in MFC. I am in fix for this problem. Problem Statement: 1.0 If i am using default mapping mode i.e. MM_TEXT or explicitly mentioning mapping mode as MM_TEXT here then circle is drawn on view. But on the Print Previewing the image turns out to be microscopic. 2.0 If i am using mapping mode MM_LOENGLISH, then on menu item clicking it draws but on OnDraw it doesnot shows again. and every thing is blank. Even in print preview. I had attaching sample code and application on the codeguru forum which illustrates the problem. http://www.codeguru.com/forum/showthread.php?t=304420 Leave your mark wherever you go

    C / C++ / MFC help c++ php com question

  • Simulation:- Rings moving out from points with some delay &amp; store sim. to movie file
    J JHAKAS

    Hi All I have to develop a simulation application (MFC or OpenGL, yet to decide. ) I have to simulate explosive blasting and post blasting air wave movement. There are some holes on the view (say screen). Each hole is having explosive filled. Hole will blast one by one with delay in between. Say firts hole blast when it was initiated and then other holes one by one after some delay. When one hole blasts then a air wave pulse will move out from teh hole location at the propogation speed of the sound. Similar will be for rest of holes. SO i have to simulate following things: >Explosive in hole blasts >Air wave circle generates around the point of blast >Air wave circle keep on moving/travelling away from the point of blast and its size keep on expanding based on time i.e. air wave circle size keep on increasing. I have to show the above seq. in my simulation. So this is the first part of my problem. How to do this? How to start with? Next is i want to save complete simulation as movie file either avi,asf,mpeg (I do not have any idea regarding this) How to proced? Leave your mark wherever you go

    C / C++ / MFC c++ graphics adobe game-dev json

  • Bitmap problem
    J JHAKAS

    Hi i am facing problem related to saving the contnt of the view as image in bitmap file. http://www.codeguru.com/forum/showthread.php?s=&threadid=300550 Help reqd. urgently. I want my memory device context variable to be member of my CMyView class. Sandeep Leave your mark wherever you go

    C / C++ / MFC help php com graphics performance

  • Difference Between ,, Debug build and Release Build
    J JHAKAS

    Hi Dear answering last part first One has to deliever the Release Mode executable to the client. Next i am providing following link here: This will be helpful to get the idea about Debug and Release mode conflict: http://www.codeguru.com/forum/showthread.php?s=&threadid=269905 Apart from this tehre is well known and widely famous good article on codeproject--Debug section i.e. Surviving Release mode Check it out Hope this will help. ;) Leave your mark wherever you go

    C / C++ / MFC debugging question announcement

  • Programatically create Bitmap file: How To???
    J JHAKAS

    Hi i am doing following: From my function SaveAsBitmap CClientDC dc(this); MemDC.Detach (); MemDC.CreateCompatibleDC(&dc); m_WfrBmp.Detach (); m_WfrBmp.CreateCompatibleBitmap(&dc, 860, 1100); CBitmap *pOldBitmap = (CBitmap *)MemDC.SelectObject(&m_WfrBmp); MemDC.SetMapMode(MM_LOENGLISH); // MemDC.PatBlt(0, 0, 860, 1100, WHITENESS); MemDC.SetBkMode (TRANSPARENT); MemDC.SetBkColor (RGB(255,255,255)); MemDC.Rectangle (100,100,400,400); // Now save the bitmap to the BMP file Filename ="C:\\12.bmp"; CDIBSectionLite dib; HBITMAP hnd = (HBITMAP)m_WfrBmp.GetSafeHandle (); dib.SetBitmap (hnd); dib.Save(Filename); I am getting Black bitmaps only..... What is the problem... Any help/suggestions Leave your mark wherever you go

    C / C++ / MFC help question graphics tutorial

  • How to copy ClientDC to Memory Device Context?
    J JHAKAS

    Hello How to copy the content of the client device context to Memory Device context? I want the complete drawing on the view to be stored as Bitmap file. FOr this i want Memory Device context. Further there are issues such as does it affects that when i initialise my memory Device Context, i.e. before complete drawing or after complete drawing. Sandeep Leave your mark wherever you go

    C / C++ / MFC graphics performance tutorial question

  • Detected memory leaks! - How to get the point of memory leak and remove it
    J JHAKAS

    Thanks i will check it and will come up back Leave your mark wherever you go

    C / C++ / MFC c++ regex performance tutorial

  • Detected memory leaks! - How to get the point of memory leak and remove it
    J JHAKAS

    Hi As usual i recd. following message on my build output window How to find the point of the memory leak and how to overcome it. Thanks a lot for any suggestion. Sandeep **Detected memory leaks!** Dumping objects -> strcore.cpp(118) : {1639} normal block at 0x0063B6B0, 181 bytes long. Data: < ODBC> 01 00 00 00 A8 00 00 00 A8 00 00 00 4F 44 42 43 D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) : {1633} client block at 0x0063B900, subtype 0, 100 bytes long. a CDatabase object at $0063B900, 100 bytes long D:\Documents and Settings\erc\Desktop\Pattern\PatternDoc.cpp(508) : {1535} client block at 0x0063A180, subtype 0, 88 bytes long. a CObject object at $0063A180, 88 bytes long :) Leave your mark wherever you go

    C / C++ / MFC c++ regex performance tutorial

  • Why this is happening? -- Why this is capturing screen image instead of ClientDC
    J JHAKAS

    Please follow the following link for better idea http://www.codeguru.com/forum/showthread.php?s=d09323bd39f2dd0a942e34fe1155af42&threadid=296795 My main aim is to draw the content to view such that when user wants he can save the same to image file. Thats it? What i tried that i drawn completely into the ClientDc and at the end (see first post) i am making the memory device context and then storing teh content to the image file. Well but it seems that MemDC is taking the complete Mainwindow instead of the required clientdc. Help me in this regard Thanks in advance sandeep Leave your mark wherever you go

    C / C++ / MFC graphics tutorial question

  • Memory device context help
    J JHAKAS

    Well in plain words my problem is that i have to draw on the view and also in the memory device context, which will be used for storing the device context conte to the image file If you can provide guideline and suggestions then it will be helpful. NOTE 1.0 I have to keep CDC MemDC ( Memory device context) member of the class so that i can write it in the drawing function and then i can use the same in another function of the class to store it in the image 2.0 In OnDraw i have to render the memdc content on the view. Thats what i was doing? On running the application and trying the drawing function 1-2 times it just draws, but after that it does not draw and same 1*1pixel bitmap OnDraw() { pDC->StretchBlt(50, 0, 860, -1100, &MemDC, 0, 0, 860, -1100, SRCCOPY); } 3.0 I want to know that does the following schema is ok? memdc.createcompatibledc() bmp.createcompatiblebitmap() CBitmap *old =memdc.selectobject(bmp); DO THE DRAWING HERE memdc.selectobject(old) another query related to this is that does this will not effect my memdc.stretchblt in the onDraw. What i mean is when i select anaother bitmap then does my mainbitmap on which i had drawn still carries the drawing and can i use that for saving as bitmap file? Would it not affect that bitmap file? If you can provide the sample code taking above points in consideration than i will be greatfull? Well also point out any mistake. Leave your mark wherever you go

    C / C++ / MFC graphics help performance question

  • Memory device context help
    J JHAKAS

    Theme of code: Draw to Memdc in OnDraw Stretch over the clientDc Save the dc content to the image file Problem faced Well this code is executed in starting time i.e. 1-2 turn when the function is called it will display the things drawn on the view. Even when we save bitmap it does save to BMP file (3.6Mb) After 1-2 turns it makes screen blasnk and the MemDC contains nothing. Even when MemDC is saved as Bitmap file then it makes BMP file of 1*1 pixel and of size 70 bytes. What can be the problem? My MemDC is member variable of the class. void CMyView:rawWFRDiagram(int Velocity) { char cc[10]; int maxdelay = -1; CPatternDoc *pDoc = GetDocument(); CSize sizeTotal; sizeTotal.cx = 590; sizeTotal.cy = 1100; SetScrollSizes(MM_LOENGLISH, sizeTotal); CClientDC ClientDC(this); OnPrepareDC(&ClientDC); ClientDC.SetMapMode(MM_TEXT); m_WfrBmp -- Member of CMyView of type CBitmap m_WfrBmp.DeleteObject (); m_WfrBmp.CreateCompatibleBitmap(&ClientDC, 860, 1100); MemDC.CreateCompatibleDC(&ClientDC); CBitmap *pOldBitmap = MemDC.SelectObject(&m_WfrBmp); MemDC.SetMapMode(MM_TEXT); MemDC.PatBlt(0, 0, 860, 1100, WHITENESS); Draw anything further to the MemDC MemDC.SetMapMode(MM_LOENGLISH); // STRETCH THE DRAWING ON THE CANVAS I.E. VIEW if(ClientDC.StretchBlt(50, 0, 860, -1100, &MemDC, 0, 0, 860, -1100, SRCCOPY) == FALSE) AfxMessageBox("Failed to draw WFR diagram"); } OnDraw() { pDC->StretchBlt(50, 0, 860, -1100, &MemDC, 0, 0, 860, -1100, SRCCOPY); } Help me to solve this problem? Thanks in advance Sandeep Leave your mark wherever you go

    C / C++ / MFC graphics help performance question

  • Why this is happening? -- Why this is capturing screen image instead of ClientDC
    J JHAKAS

    Is there any solution for this problem? why i am getting complete mainframe window while i am using teh clientDC I had even tried with ClientDc clientDC(this) still then.? Leave your mark wherever you go

    C / C++ / MFC graphics tutorial question

  • Please help me. how to attach a dialog to a view?
    J JHAKAS

    do you mean of FormView Leave your mark wherever you go

    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