I try to get access to the Win32ComponentPeer class from a test application but the compiler complain.
When i look at the juce static library with LibDump getOwnerOfWindow is defined.
getOwnerOfWindow@Win32ComponentPeer@juce@@SAPAV12@PAUHWND__@@@Z
2>Main.obj : error LNK2019: unresolved external symbol “public: static class Win32ComponentPeer * cdecl Win32ComponentPeer::getOwnerOfWindow(struct HWND *)” (?getOwnerOfWindow@Win32ComponentPeer@@SAPAV1@PAUHWND__@@@Z) referenced in function “public: __thiscall HelloWorldWindow::HelloWorldWindow(void)” (??0HelloWorldWindow@@QAE@XZ)
2>.\Debug/juce_application.exe : fatal error LNK1120: 1 unresolved externals
2>Build log was saved at “file://C:…\juce\projects\example_project_for_Win32\Debug\BuildLog.htm”
#include “…/…/build/win32/platform_specific_code/win32_headers.h”
#include “…/…/build/win32/platform_specific_code/juce_win32_Windowing.h”
//==============================================================================
/** This is the top-level window that we’ll pop up. Inside it, we’ll create and
show a HelloWorldContentComponent component.
*/
class HelloWorldWindow : public DocumentWindow
{
public:
//==============================================================================
HelloWorldWindow()
: DocumentWindow (T(“Hello World”),
Colours::lightgrey,
DocumentWindow::allButtons,
true)
{
setContentComponent (new HelloWorldContentComponent());
setVisible (true);
centreWithSize (400, 200);
//Win32ComponentPeer* peer = reinterpret_cast <Win32ComponentPeer*> (m_parentComponent->getPeer());
Win32ComponentPeer* peer = NULL;
peer = Win32ComponentPeer::getOwnerOfWindow ((HWND)this->getPeer()->getNativeHandle());
}
~HelloWorldWindow()
{
// (the content component will be deleted automatically, so no need to do it here)
}
//==============================================================================
void closeButtonPressed()
{
// When the user presses the close button, we'll tell the app to quit. This
// window will be deleted by the app object as it closes down.
JUCEApplication::quit();
}
};