|
|
Home » Community » Newbie corner » Creating a form inside a DLL
Creating a form inside a DLL [message #33825] |
Fri, 16 September 2011 20:04 |
tcler
Messages: 4 Registered: September 2011
|
Junior Member |
|
|
i write plugin for Download Master and have one question: how can i correctly initialize a form without a WinMain? my code:
StatDialog.h:
#include <CtrlLib/CtrlLib.h>
#include "StatPlugin.h"
using namespace Upp;
#define LAYOUTFILE "StatPlugin.lay"
#include <CtrlCore/lay.h>
class CStatDialog : public WithStatDialog<TopWindow> {
public:
void setLnk (CStats &ptr);
void Cal_CallBack ();
void CBtn_CallBack();
CStatDialog ();
typedef CStatDialog CLASSNAME;
private:
CStats _statslnk;
};
the form is created and then deleted when it calls (in other class):
UPP::Ctrl::InitWin32(0);
UPP::AppInitEnvironment__();
CStatDialog dform = CStatDialog();
dform.setPtr(stats_obj);
dform.RunAppModal();
UPP::DeleteUsrLog();
UPP::AppExit__();
it works but when app closes (dll detach) i get message "heap leaks detected" (debug build).
|
|
|
|
|
|
|
Re: Creating a form inside a DLL [message #33969 is a reply to message #33908] |
Sun, 02 October 2011 10:12 |
tcler
Messages: 4 Registered: September 2011
|
Junior Member |
|
|
question still relevant.
upd.: solved. sorting class from ArrayCtrl.cpp:
struct sAC_ColumnSort : public ValueOrder {
bool descending;
const ValueOrder *order;
int (*cmp)(const Value& a, const Value& b);
virtual bool operator()(const Value& a, const Value& b) const {
return descending ? cmp ? (*cmp)(b, a) < 0 : (*order)(b, a)
: cmp ? (*cmp)(a, b) < 0 : (*order)(a, b);
}
};
cmp function must return a negative value if value1 > value2 and positive if value1 < value2. why not true/false??
[Updated on: Tue, 04 October 2011 17:51] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 04 11:33:33 CEST 2024
Total time taken to generate the page: 0.01885 seconds
|
|
|