Ветеран
Группа: Модератор
Сообщений: 2412
|
вот сорец:
CODE |
#include <vcl.h>
#include <time.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("..\Forms\FormAbout.cpp", fmAbout);
USEFORM("..\Forms\FormDocEditPDB.cpp", fmDocEditor);
USEFORM("..\Forms\FormLoginPDB.cpp", fmLoginPDB);
USEFORM("..\Forms\FormMain.cpp", fm);
USEFORM("..\Forms\FormNewUnitWizard.cpp", fmNewUnitWizard);
USEFORM("..\Forms\FormProgress.cpp", fmProgress);
USEFORM("..\Forms\FormPropertiesPDB.cpp", fmPropPDB);
USEFORM("..\Forms\FormSplash.cpp", fmSplash);
USEFORM("..\Forms\FormUnitsEditorList.cpp", fmUnitsEditorList);
USEFORM("..\DataModules\DataModuleMain.cpp", dm); /* TDataModule: File Type */
USEFORM("..\Forms\FormDocFieldsPDB.cpp", fmDocFields);
USEFORM("..\Forms\FormRoutesEditor.cpp", fmRoutesEditor);
USEFORM("..\Forms\FormRouteFields.cpp", fmRouteFields);
USEFORM("..\Forms\FormUnitsEditor.cpp", fmUnitsEditor);
USEFORM("..\Forms\FormUnitFields.cpp", fmUnitFields);
USEFORM("..\Forms\FormJoinFields.cpp", fmJoinFields);
USEFORM("..\Forms\FormDescriptionList.cpp", fmDescriptionList);
USEFORM("..\Forms\FormSignSpecPosFields.cpp", fmSignPos);
USEFORM("..\Forms\FormUnitsList.cpp", fmUnitsList);
USEFORM("..\Forms\FormPCDSynchro.cpp", fmPCDSynchro);
USEFORM("..\Forms\FormDescriptionFields.cpp", fmDescriptionFields);
USEFORM("..\Forms\FormUnitSelect.cpp", fmUnitSelect);
//---------------------------------------------------------------------------
#include "..\Forms\FormMain.h"
#include "..\Forms\FormSplash.h"
const char *lpszClassName = "TAppBuilder";
HINSTANCE hInst;
HWND hWnd;
WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASS wndClass;
int nRegisteredClass;
MSG msg;
hInst = hInstance;
wndClass.style = 0;
wndClass.lpfnWndProc = DefWindowProc;
wndClass.cbClsExtra = wndClass.cbWndExtra = 0;
wndClass.hInstance = hInstance;
wndClass.hIcon = 0;
wndClass.hCursor = 0;
wndClass.hbrBackground = 0;
wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = lpszClassName;
if ( ! ( nRegisteredClass = RegisterClass(&wndClass) ) ) return false;
hWnd = CreateWindow(lpszClassName, NULL, WS_POPUP, -1, -1, 0, 0,
NULL, NULL, hInstance, NULL );
try
{
clock_t s, e;
s = clock();
fmSplash = new TfmSplash(Application);
fmSplash->Show();
fmSplash->Update();
Application->Initialize();
Application->Title = "ÏÁÄ";
Application->CreateForm(__classid(Tfm), &fm);
Application->CreateForm(__classid(Tdm), &dm);
e = clock();
while (e — s < 3000)
{
Application->ProcessMessages();
e = clock();
}
fmSplash->Hide();
delete fmSplash;
SendMessage(fm->Handle, CM_INIT_COMPLETE, 0, 0);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------
|
однако, почему-то код, идущий в самом начале, реально выполняется далеко не первым... (снаяала библиотеки инициализируются). так вот вопрос: как же сделать так, чтобы код, идущий в начале WinMain выполнялся дкйствительно В САМОМ НАЧАЛЕ.
|