Click here to Skip to main content
15,885,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker226-May-09 14:18
snacker226-May-09 14:18 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker226-May-09 14:21
snacker226-May-09 14:21 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
Stuart Dootson26-May-09 14:32
professionalStuart Dootson26-May-09 14:32 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker227-May-09 7:08
snacker227-May-09 7:08 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
Stuart Dootson26-May-09 14:19
professionalStuart Dootson26-May-09 14:19 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker231-May-09 18:22
snacker231-May-09 18:22 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
Stuart Dootson31-May-09 21:42
professionalStuart Dootson31-May-09 21:42 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker21-Jun-09 20:38
snacker21-Jun-09 20:38 
I was saving the reference in memory and calling release just before the window is closed.

But now...

I changed it to call Release().
Here is how I am creating the control (changed to use a url):

VOID CreateControl( HWND hwnd )
{

    HRESULT hr = CoInitialize( NULL );
    printf( "CoInitialize(NULL) -> hr=[0x%x]\n", hr );
    printf( "Create AtlAxWin Begin...[0x%x]\n", hwnd );

    BOOL rslt = AtlAxWinInit();
    printf( " AtlAxWinInit() --> %d\n", rslt );

    IUnknown *pUnk = NULL;

    hr = AtlAxCreateControl( OLESTR( "http://www.microsoft.com" ), hwnd, NULL, &pUnk );
    printf( "AtlAxCreateControl(...) -> hr=[0x%x] : pUnk=[0x%x]\n", hr, pUnk );

    ULONG relRslt = pUnk->Release();
    printf( "Release() -> %d\n", relRslt );

}


Here is the output:
CoInitialize(NULL) -> hr=[0x0]
Create AtlAxWin Begin...[0x150dac]
 AtlAxWinInit() --> 1
AtlAxCreateControl(...) -> hr=[0x0] : pUnk=[0x3233e30]
Release() -> 7


Although the "Release()" is returning 7, it appears to be working... ONLY if I send WM_CLOSE to the HWND prior to closing the window.

However, I don't think I want to close the HWND in all cases.

Is there a way to just remove or unload the control, so the HWND can be reused?

In fact if I use Adobe Reader via specifying c:\test.pdf it works until I shutdown the application.
At the end of the app I get an access violation:

>	Multimedia.api!2d80acf5()
 	[Frames below may be incorrect and/or missing, no symbols loaded for Multimedia.api]
 	msvcr80.dll!04932bd9()
 	Multimedia.api!2d83e2a5()
 	Multimedia.api!2d802cc0()
 	Multimedia.api!2d80c885()
 	Multimedia.api!2d80123c()
 	Multimedia.api!2d8b3698()
 	Multimedia.api!2d80101d()
 	ntdll.dll!7c90118a()
 	ntdll.dll!7c923ada()
 	ntdll.dll!7c910435()
 	ntdll.dll!7c90eb99()
 	kernel32.dll!7c81cb26()
 	java.exe!004071b4()
 	java.exe!004072f3()
 	java.exe!00407319()
 	java.exe!004087cb()
 	kernel32.dll!7c817077()
 	java.exe!00410072()
 	java.exe!00410072()
 	java.exe!00410072()
 	java.exe!00410072()


I'm guessing the java vm doesn't know about the win32 HWND being "closed"... but that's just a guess?
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker21-Jun-09 20:42
snacker21-Jun-09 20:42 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
Stuart Dootson1-Jun-09 20:49
professionalStuart Dootson1-Jun-09 20:49 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker25-Jun-09 7:51
snacker25-Jun-09 7:51 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
Stuart Dootson5-Jun-09 7:57
professionalStuart Dootson5-Jun-09 7:57 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
Stuart Dootson1-Jun-09 20:52
professionalStuart Dootson1-Jun-09 20:52 
GeneralRe: Adding ActiveX Control Container to Win32 Window Pin
snacker25-Jun-09 7:55
snacker25-Jun-09 7:55 
QuestionAppending a number to the end of a string to display in GLUI_ EDITTEXT_TEXT Box? Pin
bushimports26-May-09 11:41
bushimports26-May-09 11:41 
AnswerRe: Appending a number to the end of a string to display in GLUI_ EDITTEXT_TEXT Box? Pin
Stuart Dootson26-May-09 12:56
professionalStuart Dootson26-May-09 12:56 
QuestionHow to save javascript file Pin
yunpil26-May-09 11:22
yunpil26-May-09 11:22 
AnswerRe: How to save javascript file Pin
David Crow26-May-09 17:00
David Crow26-May-09 17:00 
AnswerRe: How to save javascript file Pin
ThatsAlok26-May-09 22:13
ThatsAlok26-May-09 22:13 
Questionget the differents data from a list control Pin
MrKBA26-May-09 8:55
MrKBA26-May-09 8:55 
QuestionRe: get the differents data from a list control Pin
David Crow26-May-09 9:09
David Crow26-May-09 9:09 
AnswerRe: get the differents data from a list control Pin
MrKBA26-May-09 9:12
MrKBA26-May-09 9:12 
QuestionRe: get the differents data from a list control Pin
David Crow26-May-09 9:14
David Crow26-May-09 9:14 
AnswerRe: get the differents data from a list control Pin
MrKBA26-May-09 9:19
MrKBA26-May-09 9:19 
GeneralRe: get the differents data from a list control Pin
David Crow26-May-09 9:27
David Crow26-May-09 9:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.