wxMSW 3.1.2
I cannot find this header file "wx/msw/registry.h"
documented here https://docs.wxwidgets.org/trunk/classwx_reg_key.html
Where is registry.h?
Re: Where is registry.h?
But it is there
https://github.com/wxWidgets/wxWidgets/ ... registry.h
BTW, if usually works either way, but AFAIK one is supposed to include the header files not in the source tree with angle brackets (as shown in the docs you referred) instead of quotation marks.
This simple code shows that wxRegKey is properly working in the user code
https://github.com/wxWidgets/wxWidgets/ ... registry.h
BTW, if usually works either way, but AFAIK one is supposed to include the header files not in the source tree with angle brackets (as shown in the docs you referred) instead of quotation marks.
This simple code shows that wxRegKey is properly working in the user code
Code: Select all
#include <wx/wx.h>
#include <wx/msw/registry.h>
class MyFrame : public wxFrame
{
public:
MyFrame() : wxFrame(nullptr, wxID_ANY, "Test")
{
wxTextCtrl* logCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxTE_RICH2 | wxTE_READONLY);
wxLog::SetActiveTarget(new wxLogTextCtrl(logCtrl));
wxLog::DisableTimestamp();
wxRegKey key(wxRegKey::HKCU, "Software");
if ( key.Exists() )
{
wxString keyName;
long index = 0;
if ( key.GetFirstKey(keyName, index) )
{
do
{
wxLogMessage(keyName);
}
while ( key.GetNextKey(keyName, index) );
}
}
}
};
class MyApp : public wxApp
{
public:
bool OnInit() override
{
(new MyFrame())->Show();
return true;
}
}; wxIMPLEMENT_APP(MyApp);