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
A

Andrew Hoole

@Andrew Hoole
About
Posts
31
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Image Save As from webpage using IE7
    A Andrew Hoole

    Hi I am trying to develop a webpage that will display images that are stored on a server and then allow the user to right click on the image and save it to their local disk. This should be simple but the images on the server are not stored using the standard .jpg extension even though they are jpeg images, they have .d01 extensions and I have no control of this. In IE7 when you right click on one of these images the "Save Picture As" option does not work, it just says "System can't find specified file", oddly the Email Picture option does work. Is this something which is peculiar to IE7 and can I get around it in some way. Unfortunately due to restrictions on company PCs I can't update IE or install other browsers. Regards Andrew

    Web Development

  • ChartFX Compatiability
    A Andrew Hoole

    Yes it would appear that running it as administrator solves the problem. Thanks

    C / C++ / MFC

  • ChartFX Compatiability
    A Andrew Hoole

    Sorry yes I certainly do get an error. Not sure about the Administrator thing I'll have to give it a go.

    C / C++ / MFC

  • ChartFX Compatiability
    A Andrew Hoole

    Dear All I wrote an application some time back in Visual C++ 6 and used Chartfx for some stuff. It works fine on XP as long as you register the cfx4032.ocx and the sfxbar.dll using regsvr32 prior to running it. I now need to run the application on Win7 32 bit. The application itself seems to run but I can't get a DLLRegisterServer failed 0x80020009 error when I try to register the cfx4032.ocx and sfxbar.dll using regsvr32. Are there newer version of the ChartFx stuff that I can use without recompiling the application or some other way that I can solve this problem. I need the application in a few weeks time for a training course and then not much there after so I am reluctant to put too much effort it. Thanks for any help that you can provide. Regards Andrew Hoole

    C / C++ / MFC

  • Profiling MFC Windows App
    A Andrew Hoole

    It is standing still on 0% CPU. I have left it for quite a while without seeing anything happen. Andrew Hoole

    C / C++ / MFC

  • Profiling MFC Windows App
    A Andrew Hoole

    Hi Can anyone point me in the right direction. I have a MFC application that I would like to profile. I have the right version of VC++ and have turned on all the profiling options according to the documentation as far as I can tell. When I run the profiler I get the initial startup dialogs from my app but the main window never appears. Task manager shows that an app of the same name but with a ._ex extension is running. If I kill this process then the profiler complains that the .pbo file wasn't of the right format. What am I doing wrong? Many thanks for any guidance that can be provided. Andrew Hoole

    C / C++ / MFC

  • Keyboard focus to ActiveX control
    A Andrew Hoole

    No the control is handle mouse message just fine but even after clicking in the window several times the key messages don't get through. See my further post regarding how I might have fixed it. My concern now is if I have several of these controls on a dialog which one will respond to the messages. Andrew

    C / C++ / MFC

  • Keyboard focus to ActiveX control
    A Andrew Hoole

    Sorry. I am using Visual C++ 6 and MFC. Andrew

    C / C++ / MFC

  • Keyboard focus to ActiveX control
    A Andrew Hoole

    Hi I have solved my problem by making my control handle the WM_GETDLGCODE and forcing it to return DLGC_WANTARROWS|DLGC_WANTALLKEYS|DLGC_WANTCHARS; Still to discover if this has further consequences. Andrew Hoole

    C / C++ / MFC

  • Keyboard focus to ActiveX control
    A Andrew Hoole

    Hi I am trying to develop an activex control. The control has methods to respond to the WM_KEYDOWN messages and in the test container these seem to be working but when a put the control on a dialog window the control doesn't seem to get the focus - seems to remain with the dialog window as the OK and cancel buttons flash wildly when I press the up and down keys. How can I get the messages through to the control. Thanks Andrew Hoole

    C / C++ / MFC

  • ActiveX Control Debug version problem
    A Andrew Hoole

    My program doesn't really crash. It compiles fine, works fine in the ActiveX Control Test Container but whenever I try place it in another application , be that a Powerpoint slide another VC++ MFC dialog application then it causes an exception in ctlnownd.cpp when you try to place the object in the application. I have kind of read on the web that this is a known problem but no one seems to say whether there is a solution to it. Without being able to include the debug version is another app it is proving very hard to debug it. Thanks for any advice you may be able to give. Andrew

    C / C++ / MFC

  • ActiveX Control Debug version problem
    A Andrew Hoole

    Hi I hope I'm in the right group here. I am trying to develop an ActiveX control but whenever I compile a debug version of it I am unable to include it in another application. It always gives an error claiming an exception has occurred in ctlnownd.cpp line 443(if I remember correctly). The release version of this control works fine. I am using VC++ 6 with I think the latest patches although I haven't checked for a while. Any ideas why this happens and if it can be corrected. Many thanks Andrew

    C / C++ / MFC

  • How to drink safely?
    A Andrew Hoole

    Drinking proper distilled water - i.e. the stuff you might top your car battery up with, is bad for you. It has none of the minerals, salts etc that normal water has. When you drink it there is an ion imbalance between the water in your stomach and your body cells and osmodic(spelling) pressure tries to balance this up with the net result that it leaches ions out of your body and cells - bad news over a long time I'm told. Water in those dispenser things shouldn't be distilled just purified - although having seen programs on what people bottle and sell as water I would debate that. Well that's what I have been told.

    The Lounge

  • DLL memory issue
    A Andrew Hoole

    Are you saying that I should wrap my DLL dialog class in another class with a simple interface. Otherwise I can't see how what you are suggesting gets me away from having to have the header file of my DLL dialog exposed to the users. Using the HWND idea - would that mean I don't create a direct instance of the DLL dialog class as I have done but rather pass the HWND into a simple function which then attachs to it and creates the dialog class internally. Sorry I am not being very bright here but thanks for the help.

    C / C++ / MFC

  • DLL memory issue
    A Andrew Hoole

    Ok I have now included the resource.h file in the CLantisPatientSelectDlg.h file and now the whole thing(including the important bits I had removed for debugging purposes) compiles and runs fine. So now I just need to find out how I can use different header files without getting this trouble as it seems the only way to hide from the user all the mess of the implementation. Thanks for all the help and comments so far. Andrew Hoole

    C / C++ / MFC

  • DLL memory issue
    A Andrew Hoole

    Yeah I think I am going to have to use the same header file but when I tried it earlier I get compiler errors on the // Dialog Data //{{AFX_DATA(CLantisPatientSelectDlg) enum { IDD = IDD_SELECTPATDLG }; // NOTE: the ClassWizard will add data members here //}}AFX_DATA section of the header because that is declared in the resource.h file of the dll and not the resource.h file of the application. Is it a problem if several of these IDs resolve to the same number? I would have thought that the layout/size of the class would have been held in one of the compiled files that are used by the linker so something.

    C / C++ / MFC

  • DLL and CTypedPtrList problem
    A Andrew Hoole

    Hi I'm stilling working on this but have started a new post as the topic seems to have move on a bit. See DLL memory issue[^] post. Andrew Hoole

    C / C++ / MFC

  • DLL memory issue
    A Andrew Hoole

    Hi I have been trying to write a dialog dll and have been having some real issues with it see (DLL and CTypedPrtList problem[^]). It seems to have moved away from my initial concerns of using CTypedPtrList in the DLL to a more general issue hence the new post. I stripped the code down to the bare minimum removing all the interesting stuff and it still fails if I OK out of the dialog but not if I Cancel. To recap on the application. void CTestApp::OnFileOpen() { CLantisPatientSelectDlg dlg; if(dlg.DoModal() == IDOK){ m_nPatID1 = dlg.GetPatID1(); } } CLantisPatientSelectDlg is implemented in the DLL with exported constructors, DoModal() and GetPatID1() member functions. void CLantisPatientSelectDlg::OnOK() { int nIndex; CPatientDetails *pPatientDetails; CListCtrl *pList = (CListCtrl *)GetDlgItem(IDC_PATIENTLIST); nIndex = pList->GetSelectionMark(); if(nIndex != -1){ // Do something interesting } else { m_nSelectedPatID1 = -1; } // Get any background list loading to terminate m_bTerminateLoad = true; ::WaitForSingleObject(m_hListLoadingThread,INFINITE); CDialog::OnOK(); } void CLantisPatientSelectDlg::OnCancel() { // Get any background list loading to terminate m_bTerminateLoad = true; ::WaitForSingleObject(m_hListLoadingThread,INFINITE); CDialog::OnCancel(); } Now I have done some debugging on this and it appears that when the program goes through the OnOK() function the line m_nSelectedPatID1 = -1; corrupts the "this" pointer of the CTestApp class such that when I get back into the OnFileOpen() function the m_nPatID1 = dlg.GetPatID1(); fails. Looking at the memory allocation somehow the m_nSelectedPatID1 variable and the "this" pointer are using the same memory and hence setting the variable to -1 in the DLL gives a pointer which is nonsense. Now why is this happening? I am using two header files for the CLantisPatientSelectDlg. One for build the DLL which needs to know about all the internal stuff and another for building the application which only has the exported functions in it. Reasoning being that the users don't need to know all that internal stuff

    C / C++ / MFC

  • DLL and CTypedPtrList problem
    A Andrew Hoole

    Yeah I agree with you and I was doing that but it doesn't seem to be the problem. When it comes time to destruct the instance of the dialog the list, which is empty by this time, appears to have been corrupted in some way and hence can't delete properly. I have just noticed something else. In the code section void CTestApp::OnFileOpen() { CLantisPatientSelectDlg dlg; if(dlg.DoModal() == IDOK){ m_nPatID1 = dlg.GetPatID1(); } } In my testing before posting I didn't have the m_nPatID1 = dlg.GetPatID1(); line and hence my code went on to destruct the dlg instance immediately. Now with this code a new failure mode is occurring along with the old one which is generated when you Cancel out of the dialog. In the line highlighted above the dlg.GetPatID1() function runs correctly and returns an int but an access violation occurs when this return value is copied to the m_nPatID1 variable. I must be doing something silly. I just can't see it. Andrew

    C / C++ / MFC

  • DLL and CTypedPtrList problem
    A Andrew Hoole

    Hi All I have run out of ideas can anyone help me. I have created a extension DLL for a Patient selection dialog. When the dialog opens it initializes a list with with patient details. The user can then select one of the patients and the dialog closes and then the program can query the dialog before its destruction to get the index of the patient who was selected. void CTestApp::OnFileOpen() { CLantisPatientSelectDlg dlg; if(dlg.DoModal() == IDOK){ m_nPatID1 = dlg.GetPatID1(); } } To try and be tidy in the OnOK() member function of my class derived from CDialog I delete all of the list. void CLantisPatientSelectDlg::OnOK() { int nIndex; CPatientDetails *pPatientDetails; CListCtrl *pList = (CListCtrl *)GetDlgItem(IDC_PATIENTLIST); nIndex = pList->GetSelectionMark(); if(nIndex != -1){ POSITION pos = m_lpPatients.FindIndex(nIndex); if(pos != NULL){ pPatientDetails = m_lpPatients.GetAt(pos); m_nSelectedPatID1 = pPatientDetails->m_Pat_ID1; } } else { m_nSelectedPatID1 = -1; } // Get any background list loading to terminate m_bTerminateLoad = true; ::WaitForSingleObject(m_hListLoadingThread,INFINITE); DeletePatientList(); CDialog::OnOK(); } void CLantisPatientSelectDlg::DeletePatientList() { CPatientDetails *pPatientDetails; POSITION pos = m_lpPatients.GetHeadPosition(); while(pos != NULL){ pPatientDetails = m_lpPatients.RemoveHead(); delete pPatientDetails; pos = m_lpPatients.GetHeadPosition(); } } Now all of this seems to work alright until it comes to the end of the OnFileOpen() function at which point the instance of the dialog goes out of scope and the system deletes it. At this point the list which was cleared before and had 0 elements now seems to have a count of -1 (0xFFFFFFFF) and the routine to get rid of it crashes. I am using a different header file for the DLL'ed Dialog in the application which only lists the functions that have been exported. Any ideas??

    C / C++ / MFC
  • Login

  • Don't have an account? Register

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