How to get active view pointer?
P. Senthil -- senthilp@geocities.com
Wednesday, January 15, 1997
Environment: VC++ 1.52, Win 95
I have a distributable AFXDLL which is dependent on two other Extension
Dlls.
/ Package.dll -- Extension DLL
Engine.Dll
| \ Design.dll -- Extension Dll
|
_AFXDLL
This Engine.Dll creates a CFrameWnd and also a view for an SDI Document
template. The calling application is an _AFXDLL compiled EXE and this
has an application object.
Problem:
I need to get the active View pointer created by Engine.Dll
I can't use AfxGetMainWnd() because it returns the applications Framewnd
And that does not contain any active view.
How can I get the Frame window pointer?
P. Senthil
Gururaja D. -- gururaja@aditi.com
Thursday, January 16, 1997
[Mini-digest: 2 responses]
>>>>
>Environment: VC++ 1.52, Win 95
>
>I have a distributable AFXDLL which is dependent on two other Extension
>Dlls.
> / Package.dll -- Extension DLL
> Engine.Dll
> | \ Design.dll -- Extension Dll
> |
> _AFXDLL
>
>This Engine.Dll creates a CFrameWnd and also a view for an SDI Document
>template. The calling application is an _AFXDLL compiled EXE and this
>has an application object.
>
>Problem:
>I need to get the active View pointer created by Engine.Dll
>I can't use AfxGetMainWnd() because it returns the applications
>Framewnd
>And that does not contain any active view.
>
>How can I get the Frame window pointer?
>
>>>>>>>>>>
Hi Senthil,
I had ran in to same type of problem while working with VC4.2b on Win
95. When I tried to call AfxGetMainWindow, I was getting applications
main window in the Exported function of the .dll. Then I used
AFX_MANAGE_STATE macro to set the proper state in the Exported function
to work it properly. You can try the same but keep this as a last option
to try out.
You can get more help on AFX_MANAGE_STATE in Online Help or in MSDN.
It's just a guess. Hope it works.
Regards
Gururaja
Aditi Technologies Private ltd.
>
-----From: SCS.007@mch.scn.de
You must be calling some function in your Engine DLL to initiate this
creation process. Let this function return a FAR pointer to that view/frame.
Surely, this can't be your problem.... is there more to the question???
chandru.
| Вернуться в корень Архива
|