Board index » cppbuilder » Application Error Using VCL Component in Explorer Namespace COM Object

Application Error Using VCL Component in Explorer Namespace COM Object

I'm writing an Explorer Namespace COM Object. I've gotten the COM Object to
imbed the List View in Explorer's Right Pane. However, After The List View
is Shown I get An Explorer.exe Application Error "the Instruction at
0x6d726f46 refrenced memory at 0x6d726f46. The memory cannot be read".
Explorer then terminates. I Actually see the Listview in Explorer. Any help
Would be appreciated.
More Info:
C++Builder Version 5.0 Build 12.34
The List View is A TurboPower SysTools ShellListView.

Code:
STDMETHODIMP TTIShellViewImpl::CreateViewWindow (LPSHELLVIEW pPrevView,
LPCFOLDERSETTINGS lpfs,
                                 LPSHELLBROWSER psb, LPRECT prcView, HWND
*phWnd)
{
    HWND hWnd;
    AnsiString NSPath;
    *phWnd = NULL;

    psb->GetWindow(&FParentHandle);
    Application->CreateForm(__classid(TForm1), &Form1);
    Form1->Left = prcView->left;
    Form1->Top = prcView->top;
    Form1->Width = prcView->right - prcView->left;
    Form1->Height =  prcView->bottom - prcView->top;
    NSPath = GetDirectorySettings();
    Form1->StShellListView1->RootFolder = NSPath;
    Form1->Show();
    hWnd = Form1->Handle;
    phWnd = &hWnd;

    ShowMessage( (int)*phWnd);

    return S_OK;

Quote
};

Show Message without Error - After Press OK - The Error Message Pops-up.

Thanks in advanced for any help.

Joe

 

Re:Application Error Using VCL Component in Explorer Namespace COM Object


I forgot to mention I overrode the CreateParams for Form1 to Give it the
handle from Explorer.

Quote
Joe Rich <jr...@tricerat.com> wrote in message news:3971e4d4@dnews...
> I'm writing an Explorer Namespace COM Object. I've gotten the COM Object
to
> imbed the List View in Explorer's Right Pane. However, After The List View
> is Shown I get An Explorer.exe Application Error "the Instruction at
> 0x6d726f46 refrenced memory at 0x6d726f46. The memory cannot be read".
> Explorer then terminates. I Actually see the Listview in Explorer. Any
help
> Would be appreciated.

> More Info:
> C++Builder Version 5.0 Build 12.34
> The List View is A TurboPower SysTools ShellListView.

> Code:
> STDMETHODIMP TTIShellViewImpl::CreateViewWindow (LPSHELLVIEW pPrevView,
> LPCFOLDERSETTINGS lpfs,
>                                  LPSHELLBROWSER psb, LPRECT prcView, HWND
> *phWnd)
> {
>     HWND hWnd;
>     AnsiString NSPath;
>     *phWnd = NULL;

>     psb->GetWindow(&FParentHandle);
>     Application->CreateForm(__classid(TForm1), &Form1);
>     Form1->Left = prcView->left;
>     Form1->Top = prcView->top;
>     Form1->Width = prcView->right - prcView->left;
>     Form1->Height =  prcView->bottom - prcView->top;
>     NSPath = GetDirectorySettings();
>     Form1->StShellListView1->RootFolder = NSPath;
>     Form1->Show();
>     hWnd = Form1->Handle;
>     phWnd = &hWnd;

>     ShowMessage( (int)*phWnd);

>     return S_OK;
> };
> Show Message without Error - After Press OK - The Error Message Pops-up.

> Thanks in advanced for any help.

> Joe

Other Threads