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
L

LeonardLay

@LeonardLay
About
Posts
10
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Science geek brain teasers
    L LeonardLay

    -40 degrees is the same for F and C

    The Lounge c++ php database com game-dev

  • How Many Germans Does it Take to Change a Lightbulb?
    L LeonardLay

    I've heard that joke but usually the 3rd is an engineer and he says "I know, but I can get close enough to be within tolerance."

    The Lounge tools question career

  • Assertion error in VS 2005 C++
    L LeonardLay

    Unfortunately I still haven't found a solution for this problem. I ended up just going back to using VS 6.0 to continue developing my software.

    C / C++ / MFC help c++ visual-studio question

  • Converting C++ COM to C#
    L LeonardLay

    Hello, I am working on using a COM from C++ in new C# code. I have connected and I can get access to the member functions. The problem that I am having is that one of the member functions takes a STRUCT as an input and it outputs an array of STRUCT. And in the STRUCT there are some char arrays. So when I run the C# code I get an error message "Specified array was not of the expected type." I'll put in a bit of the code that I am converting: C++ ----------------- interface IHangerAssignment2 : public IUnknown { virtual HRESULT STDMETHODCALLTYPE Analyze(const HangerIn2& rIn, HangerOut2* pOut, int nOut, int& nResults) = 0; }; where HangerIn2 and HangerOut2 are structs that inherit from other structs. HangerOut2 inherits from a struct that contains 2 char arrays. HangerOut2 also contains an array or char arrays. in C# --------------- I rewrote HangerIn2 public struct HangerIn2 { public HangerIn hangerIn; //I just added the HangerIn struct as a member // New USP2 properties public double kingWidth; public double kingHeight; public double []bearingLength; public bool concealedFlange; }; I did the same for HangerOut2 which contains several arrays. The converted code in C# public interface IHangerAssignment { void Analyze(HangerIn2 hgrIn, ref HangerOut2[] hgrOut, int maxOutput, ref int nResults); } When this function is called, that is when I get the error "Specified array was not of the expected type." I did notice that when stepping through the debugger that the members are always listed in alphabetical order.

    C# help csharp c++ com data-structures

  • Assertion error in VS 2005 C++
    L LeonardLay

    LRESULT CFrameWnd::OnActivateTopLevel(WPARAM wParam, LPARAM lParam)
    {
    CWnd::OnActivateTopLevel(wParam, lParam);

    // exit Shift+F1 help mode on activation changes
    ExitHelpMode();
    

    #ifndef _AFX_NO_OLE_SUPPORT
    // allow OnFrameWindowActivate to be sent to in-place items
    if (m_pNotifyHook != NULL)
    {
    // activate when active and when not minimized
    m_pNotifyHook->OnActivate(
    LOWORD(wParam) != WA_INACTIVE && !HIWORD(wParam));
    }
    #endif

    // deactivate current active view
    **CWinThread \*pThread = AfxGetThread(); //This returns NULL for the thread
    ASSERT(pThread); //This is where the assertion error occurs.**  
    if (pThread->m\_pMainWnd == this)
    {
    	CView\* pActiveView = GetActiveView();
    	if (pActiveView == NULL)
    		pActiveView = GetActiveFrame()->GetActiveView();
    	if (pActiveView != NULL)
    		pActiveView->OnActivateView(FALSE, pActiveView, pActiveView);
    }
    
    C / C++ / MFC help c++ visual-studio question

  • Assertion error in VS 2005 C++
    L LeonardLay

    mWnd->ShowWindow(SW_SHOW); When it gets to this point, the assertion error appears. I stepped into the code for ShowWindow and when it calls the AfxGetThread() it returns a NULL then it gives the assertion error because the return should not be NULL.

    C / C++ / MFC help c++ visual-studio question

  • Assertion error in VS 2005 C++
    L LeonardLay

    The assertion error is in File: f:\rtm\vctools\vc7libs\ship\atlmfc\src\mfc\winfrm.cpp Line: 942

    C / C++ / MFC help c++ visual-studio question

  • Assertion error in VS 2005 C++
    L LeonardLay

    I am trying to use a CFrameWnd in my code and I keep getting an assertion error when I try to ShowWindow(SW_SHOW);

    CWnd \* tempWnd = new CWnd(); //Create a new CWnd object
    tempWnd->Attach(p\_adsw\_hwndAcad); //handle to the main window
    CFPLvlLyrWnd \*mWnd = (CFPLvlLyrWnd\*)(RUNTIME\_CLASS(CFPLvlLyrWnd))->CreateObject(); //CFPLvleLyrWnd is derived from CFrameWnd
    RECT sizze = CFrameWnd::rectDefault;
    DWORD dwStyle = WS\_OVERLAPPEDWINDOW;
        //set up Window size
    if (mWnd->Create(NULL, "Levels/Layers", dwStyle, sizze, tempWnd, MAKEINTRESOURCE(0) ))
    {
            mWnd->m\_parentWHandle = p\_adsw\_hwndAcad;
                tempWnd->BeginModalState();
    	mWnd->ShowWindow(SW\_SHOW);
    }
    else
    {
    	AfxMessageBox("LoadFrame failed!");
    }
    HWND tempHandle = tempWnd->Detach();
    
    delete(tempWnd);
    

    This will run in VS 6.0 but in VS 2005 I get an assertion error and the program crashes. What could be the problem? Help me Obi-Wan Kenobi, you're my only hope!:confused:

    C / C++ / MFC help c++ visual-studio question

  • Exception with Visual Studio 2005 C++ when using ShowWindow
    L LeonardLay

    I had been using Visual Studio 6 C++ and I am switching my code to Visual Studio 2005 C++. For 3 cases where I have a CWnd implemented and I try to run CWnd::ShowWindow on the implementation I get an assertion error because the program calls AfxGetThread() and AfxGetThread returns a NULL for the thread. How can I either get the ShowWindow to work correctly or is there another way I can accomplish the same task as AfxGetTread without getting the exeption

    Visual Studio csharp c++ visual-studio help question

  • PS3 or Wii ?
    L LeonardLay

    The Wii does have an internal hard drive. The Wii can play online with others as well. Not that I need to play with people online (there are 6 people in my house).:laugh: I have a Wii, PS2 and GameCube and I really like the Wii. I refuse to pay $600 for a PS3. All of the additional features are not worth the extra cash. I have a computer and a DVD player for most of the PS3 functions.

    The Lounge 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