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
U

User 10281465

@User 10281465
About
Posts
9
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • .NET bound to fail...
    U User 10281465

    I agree with the thread on paying for services. Yes they will not be free. However, I see nothing saying this signals the end to MFC and ATL. They can be used to build these services and many other applications. So this is no signal. A new option in VS 7 will be ATL Servers which will support the rest of the framework is one example

    The Lounge

  • Failure to Register DropTarget only on HP Vectra and Win 2000
    U User 10281465

    I have a unique problem that is only showing up when I run Chris's grid control under windows 2000 on a HP Vectra. I can not reproduce in under any other condition. This involves the Drag Drop registration. On the HP the registration fails on the first call. Initially it appeared that the window handle was incorrect but this is not the case. The grid has a proper handle and the drop target is null. In tracing the code (on the HP) Chris's code BOOL CGridDropTarget::Register(CGridCtrl *pGridCtrl) { if (m_bRegistered) return FALSE; // Stop re-entry problems static BOOL bInProcedure = FALSE; if (bInProcedure) return FALSE; bInProcedure = TRUE; ASSERT(pGridCtrl->IsKindOf(RUNTIME_CLASS(CGridCtrl))); ASSERT(pGridCtrl); if (!pGridCtrl || !pGridCtrl->IsKindOf(RUNTIME_CLASS(CGridCtrl))) { bInProcedure = FALSE; return FALSE; } m_pGridCtrl = pGridCtrl; ASSERT (COleDropTarget::m_hWnd==NULL); // OK HERE m_bRegistered = COleDropTarget::Register(pGridCtrl); // THis call failes on the HP bInProcedure = FALSE; return m_bRegistered; } COleDropTraget Code: BOOL COleDropTarget::Register(CWnd* pWnd) { ASSERT_VALID(this); ASSERT(m_hWnd == NULL); // registering drop target twice? ASSERT_VALID(pWnd); LPUNKNOWN lpUnknown = (LPUNKNOWN)GetInterface(&IID_IUnknown); ASSERT(lpUnknown != NULL); // the object must be locked externally to keep LRPC connections alive if (CoLockObjectExternal(lpUnknown, TRUE, FALSE) != S_OK) return FALSE; // connect the HWND to the IDropTarget implementation if (RegisterDragDrop(pWnd->m_hWnd, (LPDROPTARGET)GetInterface(&IID_IDropTarget)) != S_OK) // Failure here but when should it not?? { CoLockObjectExternal(lpUnknown, FALSE, FALSE); return FALSE; } // connect internal data m_hWnd = pWnd->m_hWnd; ASSERT(pWnd->m_pDropTarget == NULL); pWnd->m_pDropTarget = this; return TRUE; } In RegisterDragDrop: The first argument is the handle to the window that excepts the drop. Now the trace gets "lost" in the os at this point. On the HP the next viewable code in the call stack following the assert is in a CWnd::Attach with the handle of the grid and it asserts since it is not null. It seems that this should have been the handle to the droptarget. So what is wrong with the HP's to link in this code or why does it not fail on all platforms??? On other platforms it step right though this section with no problems and all

    C / C++ / MFC

  • .Net vs Java
    U User 10281465

    I agree with the surprise on the lack of responce. From my perspective and influence with my company your missing the core issue. JAVA is a proprietary language owned by a single company. It is a great concept that is limited by that fact. We will just have to see how .Net is recieved, to me the fact that it is being released as a public standard is a big factor. Microsoft or not

    The Lounge

  • LPARAM associated data in TVITEM in TreeCtrl
    U User 10281465

    If someone can explain the following I would appreciate it. I have a simple Tree control in which I need to associate data with individual items in the tree. The 32 bit LParam seems like an easy place to place an identifier that I can then use to lookup the assoicated data in a secondary array (or what ever). When I try to directly use this field it appears to always be blank (zero). But when I use the SetItemData function with the item handle returned in from the InsertItem function all works fine. HTREEITEM pItem = m_ProdTree.InsertItem("My Text",pRoot,NULL); DWORD MyNum=nnn; m_ProdTree.SetItemData(pPar,MyNum); Doesn't the SetItemData/GetItemData use the LParam field?? Thanks Mike

    C / C++ / MFC

  • Display of Code with lt and gt signs.
    U User 10281465

    This is just to note a problem. I just responded to a question involving templates. Due to the usage of the lt and gt signs some of the code was taken as html. this made the question and the reply rather unreadable. I tired adding the pre tag but that had no effect. Any suggestions? Again thanks for the site.

    Site Bugs / Suggestions

  • CList with user defined type is not working
    U User 10281465

    Benedikt, I missed what the lt gt signs did to the code. Now my sample worked. Can you describe what goes wrong? Given the code is not being post clearly is the problem with the CList or the CArray? The following is adding the "pre" html prior to the code just to see what it looks like.

    typedef struct TABELLE
    {
    CString strSQL;
    CString intTID;
    int VokAnzahl;
    CList clistGeprueft;
    };

    C / C++ / MFC

  • Discussion Navigation
    U User 10281465

    Chris, Looks like things are taking off well. Good job to you and all the others helping. One item that would help me is on the discussion pages add the Prev/Next records links to the bottom of the list as well as the top. I am generally scrolling down the page and then have to scroll back up to go to the next page. Again thanks, Mike

    Site Bugs / Suggestions

  • CList with user defined type is not working
    U User 10281465

    The CList is a template. You need to define what is being stored in its definition. such as. typedef struct TABELLE { CString strSQL; CString intTID; int intVokAnzahl; CList clistGeprueft; }; After this the following works fine. TABELLE NewTab; NewTab.clistGeprueft.AddTail(20); NewTab.clistGeprueft.AddTail(21); NewTab.clistGeprueft.AddTail(24); int myval; myval = NewTab.clistGeprueft.GetHead(); POSITION pos = NewTab.clistGeprueft.GetHeadPosition(); myval = NewTab.clistGeprueft.GetNext(pos); myval = NewTab.clistGeprueft.GetNext(pos); myval = NewTab.clistGeprueft.GetNext(pos); myval = NewTab.clistGeprueft.GetNext(pos); NOTE the last line here fails because the list had 3 elements and I did not test for a NULL position. ================== The original message was: within my class i created a struct and a CList template containing the struct. but i something goes wrong when i try to add a struct variable to the CList object. Whats wrong?

    #include "StdAfx.h"
    #include "Afxtempl.h"

    //HoleVok.h

    class CHoleVok
    {
    private:

    typedef struct TABELLE
    {
    CString strSQL;
    CString intTID;
    int intVokAnzahl;
    CList clistGeprueft;
    };

    CArray arrTabellen;

    CDatabase *db;

    public:
    bool fnConnect(CDaoDatabase &db);

    };
    ___________________________________________
    #include "stdafx.h"
    #include "HoleVok.h"

    //HoleVok.cpp

    bool CHoleVok::fnConnect(CDaoDatabase &db)
    {
    TABELLE tabTest1;
    tabTest1.clistGeprueft.AddTail(20);
    tabTest1.clistGeprueft.AddTail(21);
    tabTest1.intTID = 4;
    tabTest1.intVokAnzahl = 200;
    tabTest1.strSQL = "Das Wetter ist schoen";

    arrTabellen.Add(tabTest1);

    return true;
    }

    C / C++ / MFC

  • ATL Exe Server Problem
    U User 10281465

    I am needing to create a Singleton COM component. This needs to have data served to several programs so of course needs to be an out of process server which leads me to using the ATL EXE server rather than a DLL or a MFC based COM object. It appears that I can create one rather straight forward from the ATL wizard under the new option in Visual Studio 6. However I am missing something. Although I can see the created component in the OleViewer via its TypeLib I can not access it to use in any programs. When trying to add it via "Project/AddtoProject/ComponentsAndControls" I get a message "File Does Not Exist". Any pointers on what I am missing. Thanks Mike.

    C / C++ / MFC
  • Login

  • Don't have an account? Register

  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups