R
Rainer
Hello NG,
in a win32 UML Tool I can add a "expert" by providing a (windows32) dll.
I used to write these experts with Delphi (see code below).
Is it possible to write a similar "expert" usable from this win32 tool
with .Net and C# and if yes, where can I get hints and guids on how to
do that?
Thanks for any help!
Regards
Rainer
-------------------------------------------
library QMMEOpen;
uses
SysUtils,
Windows,
Forms,
Classes,
Dialogs,
QutronicExpertClasses in 'QutronicExpertClasses.PAS',
PrjNotify in 'PrjNotify.pas',
QutronicBaseExpert in 'QutronicBaseExpert.pas',
ExpertInterface in 'ExpertInterface.PAS',
InfoForm in 'InfoForm.pas' {QutronicInfoFrm},
QmmeMain in 'QmmeMain.pas' {FrmMain},
DiagramGrouping in 'DiagramGrouping.PAS',
Autodiagramming in 'Autodiagramming.PAS',
RQClasses in 'RQClasses.PAS',
MailBoxRq in 'MailBoxRq.pas',
TypeStream in 'TypeStream.PAS',
MMToolsApi in 'MMApi\MMToolsApi.PAS',
MMDiagramAPI in 'MMApi\MMDiagramAPI.PAS',
MMEngineDefs in 'MMApi\MMEngineDefs.pas',
ClassLocatorFrm in 'ClassLocatorFrm.pas' {ClassLocatorDlg},
QutronicDM in 'QutronicDM.pas' {DMQutronic: TDataModule},
MMVersioning in 'MMVersioning.pas';
{$R *.RES}
procedure InitializeExpert(const Srv: IMMToolServices); stdcall;
begin
// Copy interface pointer to initialize global var in MMToolsApi.pas
MMToolServices := Srv;
// Register the expert
Srv.AddExpert(TQutronicExpertInterface.Create);
// Adding a Project Notifier is not neccesary for most Experts, it's
included here for
// Demo purposes only
// Create a project notifier
ProjectNotifier := TProjectNotifier.Create;
// And Register an interface pointer
Srv.AddProjectNotifier(ProjectNotifier);
// now sync with parent window, if we omit this, modal dialogs won't
be really modal and
// modeless forms will behave even worse.
Application.Handle := Srv.GetParentHandle;
end;
procedure FinalizeExpert; stdcall;
begin
// there's no need to export this function is there's nothing to clean up
// In this demo expert all the cleaning-up is done by the
Expert.Destroyed
end;
function ExpertVersion: LongInt; stdcall;
begin
// This funciton and it's implementation are mandatory, if this
function is not
// exported or the version mismatches the version in ModelMaker, the
expert is not
// loaded
Result := MMToolsApiVersion;
end;
exports
InitializeExpert name MMExpertEntryProcName,
FinalizeExpert name MMExpertExitProcName,
ExpertVersion name MMExpertVersionProcName;
end.
in a win32 UML Tool I can add a "expert" by providing a (windows32) dll.
I used to write these experts with Delphi (see code below).
Is it possible to write a similar "expert" usable from this win32 tool
with .Net and C# and if yes, where can I get hints and guids on how to
do that?
Thanks for any help!
Regards
Rainer
-------------------------------------------
library QMMEOpen;
uses
SysUtils,
Windows,
Forms,
Classes,
Dialogs,
QutronicExpertClasses in 'QutronicExpertClasses.PAS',
PrjNotify in 'PrjNotify.pas',
QutronicBaseExpert in 'QutronicBaseExpert.pas',
ExpertInterface in 'ExpertInterface.PAS',
InfoForm in 'InfoForm.pas' {QutronicInfoFrm},
QmmeMain in 'QmmeMain.pas' {FrmMain},
DiagramGrouping in 'DiagramGrouping.PAS',
Autodiagramming in 'Autodiagramming.PAS',
RQClasses in 'RQClasses.PAS',
MailBoxRq in 'MailBoxRq.pas',
TypeStream in 'TypeStream.PAS',
MMToolsApi in 'MMApi\MMToolsApi.PAS',
MMDiagramAPI in 'MMApi\MMDiagramAPI.PAS',
MMEngineDefs in 'MMApi\MMEngineDefs.pas',
ClassLocatorFrm in 'ClassLocatorFrm.pas' {ClassLocatorDlg},
QutronicDM in 'QutronicDM.pas' {DMQutronic: TDataModule},
MMVersioning in 'MMVersioning.pas';
{$R *.RES}
procedure InitializeExpert(const Srv: IMMToolServices); stdcall;
begin
// Copy interface pointer to initialize global var in MMToolsApi.pas
MMToolServices := Srv;
// Register the expert
Srv.AddExpert(TQutronicExpertInterface.Create);
// Adding a Project Notifier is not neccesary for most Experts, it's
included here for
// Demo purposes only
// Create a project notifier
ProjectNotifier := TProjectNotifier.Create;
// And Register an interface pointer
Srv.AddProjectNotifier(ProjectNotifier);
// now sync with parent window, if we omit this, modal dialogs won't
be really modal and
// modeless forms will behave even worse.
Application.Handle := Srv.GetParentHandle;
end;
procedure FinalizeExpert; stdcall;
begin
// there's no need to export this function is there's nothing to clean up
// In this demo expert all the cleaning-up is done by the
Expert.Destroyed
end;
function ExpertVersion: LongInt; stdcall;
begin
// This funciton and it's implementation are mandatory, if this
function is not
// exported or the version mismatches the version in ModelMaker, the
expert is not
// loaded
Result := MMToolsApiVersion;
end;
exports
InitializeExpert name MMExpertEntryProcName,
FinalizeExpert name MMExpertExitProcName,
ExpertVersion name MMExpertVersionProcName;
end.