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
N

neilsolent

@neilsolent
About
Posts
59
Topics
23
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SVG window
    N neilsolent

    Thanks for that. I am going to try the ActiveX adobe.svgctl for the moment, and see if I can figure out how to do the necessary directly from VC++. I'll post again if I get it working! cheers, Neil

    C / C++ / MFC graphics c++ xml question

  • SVG window
    N neilsolent

    Hi One for the hardcore coders .. I would like to display a window in a VC++ app that is a web view, in that the source for the view is a .SVG file (the Web XML vector graphics format). BUT .. I need to be able to interact with the view from the C++ code - I need to modify the colour of certain parts of the picture (tagged appropriately in the SVG file). The colours may change dynamically, depending on other parts of the program. Anyone done anything like this ? :~

    cheers, Neil

    C / C++ / MFC graphics c++ xml question

  • Why don't splitters appear?
    N neilsolent

    I am initialising GUI components (in a CMDIFrameWnd) using the code below. It works fine, except that the CMDIChildWnd child frames are blank at startup. If the user fiddles with the child windows (e.g. stretches them) then the splitter displays immediately appear. What have I missed in the initialisation ? :confused: CMainFrame* pMainFrame = new CMainFrame; if (! pMainFrame->LoadFrame(IDR_MAINFRAME)) return FALSE; CCreateContext context; context.m_pCurrentDoc = NULL; context.m_pCurrentFrame = NULL; context.m_pLastView = NULL; context.m_pNewDocTemplate = NULL; context.m_pNewViewClass = NULL; CMDIChildWnd* alertWnd = new CMDIChildWnd; alertWnd->Create(NULL, "Alerts", WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW, CFrameWnd::rectDefault, pMainFrame); CSplitterWnd* alertSplitter = new CSplitterWnd; alertSplitter->CreateStatic(alertWnd, 1, 2, WS_CHILD | WS_VISIBLE, AFX_IDW_PANE_FIRST); alertSplitter->CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(100, 100), &context); alertSplitter->CreateView(0, 1, RUNTIME_CLASS(CSsfconView), CSize(100, 100), &context); pMainWnd->ShowWindow(SW_SHOW); pMainWnd->UpdateWindow(); cheers, Neil

    C / C++ / MFC question

  • Dynamic CSplitterWnd
    N neilsolent

    Thanks. That works fine.

    cheers, Neil

    C / C++ / MFC question

  • Dynamic CSplitterWnd
    N neilsolent

    Sorry, assertion is in WINSPLIT.CPP: if (GetDlgItem(IdFromRowCol(row, col)) != NULL) { TRACE2("Error: CreateView - pane already exists for row %d, col %d.\n", row, col); ASSERT(FALSE); return FALSE; } cheers, Neil

    C / C++ / MFC question

  • Dynamic CSplitterWnd
    N neilsolent

    I have created a dynamic splitter with: CSplitterWnd clientSplitter; .. clientSplitter.Create(this, 2, 2, CSize(200, 200), pContext, WS_CHILD | WS_VISIBLE | SPLS_DYNAMIC_SPLIT, AFX_IDW_PANE_FIRST); How do I add a view to it? This code .. clientSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(100, 100), pContext); .. causes an ASSERT.

    cheers, Neil

    C / C++ / MFC question

  • Simplest way to add tabs to SDI
    N neilsolent

    Hi I have an SDI application. The CMainframe currently has a CSplitterWnd embedded in it. In order to prevent over-crowding, I would like to add a CTabCtrl to intervene in between the CMainframe and the CSplitterWnd, such that the first tab shows the CSplitterWnd, and the other tabs show different views, and the user can move between the views without the views re-initialisaing. (Much like the "Contents / Index / Search / Favourites" tabs in the help system of VC++.) What's the simplest way to achieve this please?

    cheers, Neil

    C / C++ / MFC c++ database hardware help question

  • How to get SQL stored procedure output / return code
    N neilsolent

    Hi I am calling one of my SQL server stored procedures using SQLExecute(). If there is a SQL syntax error, I can see it in the C++ code by checking the return code of SQLExecute() and calling SQLGetDiagRec(). If the stored procedure does not error, but outputs some warning message with a SQL PRINT statement, or RETURNs non-zero ... is there a simple way that the C++ code can detect this kind of soft failure ?

    cheers, Neil

    C / C++ / MFC database c++ sql-server sysadmin help

  • CRecordSet - odd behaviour with image data fields
    N neilsolent

    Further testing has revealed that the image data column is always corrupted (set to all zeroes) for the first row returned when Open() or Requery() is run against the CRecordset-derived class.. not sure what is different about this first row..

    cheers, Neil

    C / C++ / MFC database debugging question

  • CRecordSet - odd behaviour with image data fields
    N neilsolent

    Thanks for your input. Possibly could be caused by something like that. I have run an isql statement and independently verified that the correct data is returned. So it would have to be caching within that database session. I'll try coding in dropping and recreating the connection, but it's obviously a terrible idea performance-wise. Also, why would it return all zeroes? I would have thought you would just get the old copy of the image returned if caching was going on.. I don't have many ideas how I can effectively debug this.

    cheers, Neil

    C / C++ / MFC database debugging question

  • CRecordSet - odd behaviour with image data fields
    N neilsolent

    Hi Everyone I am using CRecordSet to read data from a SQL database. For an image column, it retrieves the data correctly the first time I try. When the image data is changed in the database, the next query pulls back a string of zeroes instead of the actual data in the database. I am using a CLongBinary member in my derived class to represent the image data, and RFX_LongBinary() to exchange the data. I have even tried deleting and recreating the CRecordSet object, and I STILL get the same behaviour! Anyone seen this / got any ideas how I can debug it?

    cheers, Neil

    C / C++ / MFC database debugging question

  • How can i terminate a Services using other service [modified]
    N neilsolent

    What's the difference between stopping and terminating a service? To stop a service use ControlService() with a SERVICE_CONTROL_STOP for dwControl.

    cheers, Neil

    C / C++ / MFC help question

  • How can i terminate a Services using other service [modified]
    N neilsolent

    OpenService(), ControlService()

    cheers, Neil

    C / C++ / MFC help question

  • Creating .ico file from HICON
    N neilsolent

    In a previous post I was attempting to "serialize" an HICON, i.e. save it as a blob in a file or database: the opposite operation to the ExtractIcon() operation. I have since learned how to do this (see routine below). BUT now my problem is, this routine loses color information. When the routine is run against a true-color icon, and the buffer is saved as a .ico file, and the .ico file is reloaded with ExtractIcon(), the resulting icon has reduced to 256 colors. I think this must be a limitation of OleCreatePictureIndirect(). How can I fix my routine? ------------------------------------------------ void SerializeIcon(const HICON icon, DWORD* size, BYTE** data) { LPPICTURE pPicture; PICTDESC rPD; rPD.cbSizeofstruct = sizeof(PICTDESC); rPD.picType = PICTYPE_ICON; rPD.icon.hicon = icon; IStream* pStream = NULL; HGLOBAL hMem = NULL; BYTE* pMem = NULL; long lActual; OleCreatePictureIndirect(&rPD, IID_IPicture, FALSE, (void**) &pPicture); CreateStreamOnHGlobal(0, TRUE, &pStream); pPicture->SaveAsFile(pStream, TRUE, &lActual); pPicture->Release(); GetHGlobalFromStream(pStream, &hMem); pMem = (BYTE*) GlobalLock(hMem); *size = GlobalSize(hMem); *data = (BYTE*) malloc(*size); CopyMemory(*data, pMem, *size); GlobalUnlock(hMem); GlobalFree(hMem); } ------------------------------------------------

    cheers, Neil

    C / C++ / MFC help question database tutorial announcement

  • What's wrong.... [modified]
    N neilsolent

    In these lines: if (j-1 > 0 && i+1 <=5 ) { if (A[i][j] < A[i+1][j-]) "i" can be as large as 4. Which means elements A[5][j] are being accessed - but the declaration was int A[5][5] - i.e. the maximum element is A[4][j] So array out of bounds ..

    cheers, Neil

    C / C++ / MFC help question

  • How to serialize an ICON
    N neilsolent

    Thanks again. Yes, I could use the .ico file as a "serialization". I can load an icon from a .ico file with ExtractIcon(), but there doesn't seem to be a reverse-function - to create the .ico file from an HICON.... do you know of a function to do this?

    cheers, Neil

    C / C++ / MFC database json tutorial question

  • Sending File Through UDP
    N neilsolent

    I don't agree that UDP is "wrong". It depends on the application. For example UDP is massively better than TCP if you want to multicast to multiple hosts. But yes, you do have to handle transmission problems yourself - you don't get return codes from the APIs that you do with TCP. It is also difficult to make UDP secure - then again TCP isn't secure on its own (needs a security layer such as SSL).

    cheers, Neil

    C / C++ / MFC c++ help

  • How to serialize an ICON
    N neilsolent

    Thanks for the post. Does this work if the ICON is loaded in externally (e.g. from a .ico file) so is not a hardcoded resource in the application ? (I am using ExtractIcon() to create my icon from a file).

    cheers, Neil

    C / C++ / MFC database json tutorial question

  • How to serialize an ICON
    N neilsolent

    That's a good idea. How do I get at the BITMAP stucture, starting from an HICON ? I saw GetIconInfo(), GetBitmapBits(), but the latter function doesn't seem to tell you how much memory to allocate - so I can't see how I can use it ! Presumably it is simple to create the mask BITMAP from the color BITMAP?

    cheers, Neil

    C / C++ / MFC database json tutorial question

  • Read registry entry of a remote machine
    N neilsolent

    Try RegConnectRegistry(), and associated functions mentioned in its help page.

    cheers, Neil

    C / C++ / MFC windows-admin tutorial
  • Login

  • Don't have an account? Register

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