Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / August 2006

Tip: Looking for answers? Try searching our database.

C# and activex

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Valentino Ricci - 26 Jul 2006 13:12 GMT
I've an ActiveX made using MFC that has a method that shows a modeless dialog
box containing a Tree control (SysTreeView32).
This ActiveX is used inside a C++ MFC application and it works fine.
When I use this ActiveX inside a C# application the bitmaps associated to
each item belonging to the tree are not shown.
What can I do?
Kind regards
Dmytro Lapshyn [MVP] - 27 Jul 2006 10:21 GMT
Hi,

How exactly the ActiveX loads those bitmaps? Are they an embedded resource
in the ActiveX DLL?

Signature

Regards,
Dmytro Lapshyn [MVP]
http://blogs.vbcity.com/DmytroL

> I've an ActiveX made using MFC that has a method that shows a modeless
> dialog
[quoted text clipped - 4 lines]
> What can I do?
> Kind regards
Valentino Ricci - 27 Jul 2006 10:46 GMT
Bitmaps are embedded inside the rc file.

To give you more informations I include part of the code I use:

BOOL CDlgLayerTree::OnInitDialog()
{
    CDialog::OnInitDialog();

    m_ShowLayer.LoadBitmap(IDB_SHOWLAYER);
    m_HideLayer.LoadBitmap(IDB_HIDELAYER);
    m_DiscardLayer.LoadBitmap(IDB_DISCARDLAYER);
    m_ImageList.Create(12, 18, ILC_COLOR32, 0, 4);
    m_ImageList.Add(&m_DiscardLayer, RGB(0, 0, 0));
    m_ImageList.Add(&m_HideLayer, RGB(0, 0, 0));
    m_ImageList.Add(&m_ShowLayer, RGB(0, 0, 0));
    m_LayerTreeCtrl.SetImageList(&m_ImageList, TVSIL_NORMAL);

    ....

    return TRUE;
}

HTREEITEM CDlgLayerTree::AddTreeLayer(CLayer* Layer, HTREEITEM hParent,
HTREEITEM hInsertAfter)
{
    ...

    HTREEITEM root = NULL;
    CString descr = Layer->GetDescription();

    if (Layer->IsShownInLayerTree())
    {
        TVINSERTSTRUCT tvInsert;
        tvInsert.hParent = hParent;
        tvInsert.hInsertAfter = hInsertAfter;
        tvInsert.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE |
TVIF_SELECTEDIMAGE;
        tvInsert.item.pszText = (LPSTR)(LPCTSTR)descr;
        enum State ItemState = Layer->GetCurrentVisibility();
        int ItemImage = (    (ItemState == layerShown) ? 2 :
                        (ItemState == layerHidden) ? 1 : 0);
        tvInsert.item.iImage = ItemImage;
        tvInsert.item.iSelectedImage = ItemImage;
        tvInsert.item.lParam = (LPARAM)Layer;

        root = m_LayerTreeCtrl.InsertItem(&tvInsert);

        ...
    }
    return root;
}

> Hi,
>
[quoted text clipped - 9 lines]
> > What can I do?
> > Kind regards
Dmytro Lapshyn [MVP] - 27 Jul 2006 12:39 GMT
OK, can you compile a debuggable version of the ActiveX, attach the debugger
to the client app and step through the code in debugger to see what fails
when the ActiveX is instantiated in a C# application?

Signature

Regards,
Dmytro Lapshyn [MVP]
http://blogs.vbcity.com/DmytroL

> Bitmaps are embedded inside the rc file.
>
[quoted text clipped - 63 lines]
>> > What can I do?
>> > Kind regards
Valentino Ricci - 27 Jul 2006 14:11 GMT
I made this check.
I saw that the attributes m_ShowLayer and so on contained a valid value for
the HBITMAP and that also m_ImageList seems to have a good value.
I also saw that SetImageList returns 0x000000c0.

All seems to work fine but finally bitmaps are not shown.

Below I also attach the debug output window result:
Loaded 'C:\Test\Phoenix\Phoenix\MapViewer\bin\Debug\MapViewer.exe', no
matching symbolic information found.
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\mscoree.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\EntAPI.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\psapi.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\netapi32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll', no
matching symbolic information found.
Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\msvcr80.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shell32.dll', no matching symbolic information
found.
Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Culture.dll', no
matching symbolic information found.
Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\91903202640a844e88a642aded7aec78\mscorlib.ni.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll', no
matching symbolic information found.
Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System\c57ac9784c24b049aed0f8654cb9af5f\System.ni.dll', no matching symbolic information found.
Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Drawing\9b03b8c80b98d54292de541fbd439c0f\System.Drawing.ni.dll',
no matching symbolic information found.
Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\468f9b1529a55545b5021b5aa2c7dc1a\System.Windows.Forms.ni.dll',
no matching symbolic information found.
Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Configuration\75be31408031da43a281605ad0c1e65e\System.Configuration.ni.dll',
no matching symbolic information found.
Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Xml\d61cb4ca3a322049ad7a54145b62637a\System.Xml.ni.dll', no matching symbolic information found.
Loaded 'APP01.EXE', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rsaenh.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorsec.dll', no
matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wintrust.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\crypt32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\msasn1.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\imagehlp.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\riched20.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\softpub.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\xpsp2res.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\userenv.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\netapi32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\cryptnet.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\winhttp.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\sensapi.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\hnetcfg.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\wshtcpip.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\rasapi32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\rasman.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\tapi32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\rtutils.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\winmm.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\msv1_0.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\iphlpapi.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\dnsapi.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\rasadhlp.dll', no matching symbolic information
found.
The thread 0xAB8 has exited with code 11001 (0x2AF9).
The thread 0x1518 has exited with code 0 (0x0).
Loaded
'C:\WINDOWS\assembly\GAC\Infragistics.Win.UltraWinToolbars.v2\2.0.5000.32__7dd5c3163f2cd0cb\Infragistics.Win.UltraWinToolbars.v2.dll',
no matching symbolic information found.
Loaded 'APP02.EXE', no matching symbolic information found.
Loaded
'C:\WINDOWS\assembly\GAC\Infragistics.Shared.v2\2.0.5000.32__7dd5c3163f2cd0cb\Infragistics.Shared.v2.dll', no matching symbolic information found.
Loaded 'APP03.EXE', no matching symbolic information found.
Loaded
'C:\WINDOWS\assembly\GAC\Infragistics.Win.v2\2.0.5000.32__7dd5c3163f2cd0cb\Infragistics.Win.v2.dll', no matching symbolic information found.
Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.2180_x-ww_522f9f82\GdiPlus.dll', no matching symbolic information found.
First-chance exception in MapViewer.exe (KERNEL32.DLL): 0xE06D7363:
Microsoft C++ Exception.
First-chance exception in MapViewer.exe (KERNEL32.DLL): 0xE06D7363:
Microsoft C++ Exception.
First-chance exception in MapViewer.exe (KERNEL32.DLL): 0xE06D7363:
Microsoft C++ Exception.
First-chance exception in MapViewer.exe (KERNEL32.DLL): 0xE06D7363:
Microsoft C++ Exception.
First-chance exception in MapViewer.exe (KERNEL32.DLL): 0xE06D7363:
Microsoft C++ Exception.
First-chance exception in MapViewer.exe (KERNEL32.DLL): 0xE06D7363:
Microsoft C++ Exception.
Loaded 'C:\WINDOWS\system32\clbcatq.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\oleaut32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\comres.dll', no matching symbolic information
found.
Loaded 'C:\Sep\Software\Exe\DynDtm.dll', no matching symbolic information
found.
Loaded 'C:\Sep\Software\Exe\Coordinates.dll', no matching symbolic
information found.
Loaded 'C:\Sep\Software\Exe\GeoTrans.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\comdlg32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\winspool.drv', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\oledlg.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\olepro32.dll', no matching symbolic information
found.
Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MFCD42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MFCN42D.DLL'
Loaded 'C:\Program Files\Common Files\ESRI\Mo20.ocx', no matching symbolic
information found.
Loaded 'C:\Program Files\Common Files\ESRI\AF20.dll', no matching symbolic
information found.
Loaded 'C:\Program Files\Common Files\ESRI\Pe81.dll', no matching symbolic
information found.
Loaded 'C:\Program Files\Common Files\ESRI\mtch.dll', no matching symbolic
information found.
Loaded 'C:\Program Files\Common Files\ESRI\Sg81.dll', no matching symbolic
information found.
Loaded 'C:\WINDOWS\system32\mfc42.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\msvcp60.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\msvcirt.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\wsock32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\sxs.dll', no matching symbolic information found.
Loaded symbols for 'C:\Sep\Software\Exe\GisMoCustom.dll'
Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\Accessibility\eadcab4c4ae788469faf265570a3808b\Accessibility.ni.dll',
no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Microsoft Shared\DAO\DAO350.DLL', no
matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt40.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\system32\mslbui.dll', no matching symbolic information
found.
The thread 0x14AC has exited with code 0 (0x0).

> OK, can you compile a debuggable version of the ActiveX, attach the debugger
> to the client app and step through the code in debugger to see what fails
[quoted text clipped - 67 lines]
> >> > What can I do?
> >> > Kind regards
Valentino Ricci - 28 Aug 2006 13:42 GMT
Still here after holidays...

I also see that the TreeView aspect is different if I run the activeX from
An MFC application and a C# application.....

> I made this check.
> I saw that the attributes m_ShowLayer and so on contained a valid value for
[quoted text clipped - 275 lines]
> > >> resource
> > >> in the ActiveX DLL?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.