Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attach DLL created HWND to CView?

Status
Not open for further replies.

dmosses

Programmer
Nov 5, 2003
11
0
0
GB
Hi,

I'm using a DLL which creates a window for displaying an image. I'd like to attach this to the CView subclass object in my MFC app so that i can manipulate the image using the standard windows messages and handlers, e.g. MouseScroll etc.

I've tried:

Code:
HWND h_displayWnd = GetHwnd(hDisplayObj);

//detach window created with CView
topView->Detach();
//attach my HWND
topView->Attach(h_displayWnd);

This doesn't work - it crashes trying to assert wincore.cpp line 384.

I've also tried using SubclassWindow, which doesn't have the same assertion failure, but does tell me that I'm trying to subclass a window with the incorrect derrived class.

Does anyone know how I can do this - all I want to do is move the window that I've been given by the DLL around.

Many thanks,

Dmosses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top