locked
System::Windows::Controls::Primitives::TextBoxBase causes errors

    Question

  • Okey. I want to write a textbox control in c++ without XAML framework.

    Lets begin.

    I created a Visual C++ Windows Metro style Direct3D App.

    Created .h and .cpp files for my class.

    And started to write class.

    #pragma once
    
    #using <C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\PresentationFramework.dll>
    #using <C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\PresentationCore.dll>
    #using <C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\WindowsBase.dll>
    #using <C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll>
    
    using namespace System::Windows::Controls::Primitives;
    
    public ref class CMyTextBox : public System::Windows::Controls::Primitives::TextBoxBase
    {
    	internal:
    
    		CMyTextBox ();
    		~CMyTextBox ();
    };

    And got a lot of errors. There are my last errors below.

    Error 1 error C1001: An internal error has occurred in the compiler. c:\users\fgc\documents\visual studio 2012\projects\direct3dapp1\direct3dapp1\cmytextbox.h 11 1 Direct3DApp1
    Error 2 error C1001: An internal error has occurred in the compiler. c:\users\fgc\documents\visual studio 2012\projects\direct3dapp1\direct3dapp1\cmytextbox.h 11 1 Direct3DApp1
    Error 3 error D8040: error creating or communicating with child process C:\Users\fgc\Documents\Visual Studio 2012\Projects\Direct3DApp1\Direct3DApp1\cl Direct3DApp1

    Seems like I did something wrong.

    And now I have some specific questions:

    1. From what class I need to derive my CMyTextBox class? From this one System::Windows::Controls::Primitives::TextBoxBase?

    2. What .dll I need to include? And how to do this correct in C++ Metro Style project?

    That's it for begin.

    Your post was usefull for me, but it's not an answer yet.

    Tuesday, August 21, 2012 8:00 PM

Answers

  • Hello,

    Unfortunately there is no D3D text box base class. The text box base class you are trying to use is specific to XAML and requires the XAML framework to be included in your application to function correctly. In order to use XAML in your D3D application you need to use one of the many techniques to mix D3D and XAML. If you want to create your own text box in D3D you will have to do it from scratch or find some existing 3rd party code.

    Combining XAML and DirectX
    http://blogs.msdn.com/b/windowsappdev/archive/2012/03/15/combining-xaml-and-directx.aspx

    I hope this helps,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, August 22, 2012 11:10 PM
    Moderator