Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Calling WPF pages in VC++

Calling WPF pages in VC++

Scheduled Pinned Locked Moved .NET (Core and Framework)
c++csharpwpfcomhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kDevloper
    wrote on last edited by
    #1

    Hi, I am working on an application, which calls a WPF page in MFC exe and loads it too, but the backgound for the WPF is coming black. here is code snippet Declaration using namespace System; using namespace System::Windows; using namespace System::Windows::Controls; using namespace System::Windows::Media; ref class Globals { public: static System::Windows::Interop::HwndSource^ gHwndSource; static WpfApplication1::Window1^ gwcContainer; }; i have added in oninitdialog, System::Windows::Interop::HwndSourceParameters^ sourceParams = gcnew System::Windows::Interop::HwndSourceParameters("MyWindowName"); sourceParams->PositionX = 20; sourceParams->PositionY = 30; sourceParams->ParentWindow = System::IntPtr(this->GetSafeHwnd()); sourceParams->WindowStyle = WS_VISIBLE | WS_CHILD; System::Windows::Interop::HwndSource^ source = gcnew System::Windows::Interop::HwndSource(*sourceParams); source->SizeToContent = System::Windows::SizeToContent::WidthAndHeight; Globals::gwcContainer = gcnew WpfApplication1::Window1(); FrameworkElement^ myPage = Globals::gwcContainer; source->RootVisual = myPage; I dont want the black color around. Any help is highly appriciated. Thanks&Regards, KDevloper

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups