How to load project in IDEEngine From DB?

Hello,

I have managed to save all the project files to DB.

Now I have a need to load the project in IDEEngine and run it.

Currently I am trying to pass the ProjectFile to the IDE Engine with the hope that it will fire the LaodFile Event and the code in the LaodFile event will load rest of the files associated with the project.

But nothing is happening... meaning it gives Error.

How to do this?

Regards,

Yogesh

Hello,

 That's the idea, if you call TIDEEngine.LoadProject, it would fire the OnLoadFile events. But we can only guess, can you provide more info, code, error messages, etc.?
Wagner
Hello,

Calling TIDEEngine.LoadProject fires the LoadFile event but it only firest event to load the module files (.psc). It does fire the event to load associated Form files (.sfm).

Here is the code:
In Button Click event:
  ProjectFileCnt := 0;    //This is Module level variable used in LoadFile event
  RecID := GetCurrRecID();

  //Attach LoadFile event
  IDEEngine1.OnLoadFile := IDEEngine1LoadFile;

  IDEEngine1.LoadProject;

  //Detach LoadFile event
  IDEEngine1.OnLoadFile := nil;

Code for IDEEngine1LoadFile event:
ProjectFileCnt := ProjectFileCnt + 1;

if ProjectFileCnt = 1 then
begin
  PrjName := GetProjectFileNameFromDB(RecID, PrjFileName);
  FileNameToRead := PrjName + '.ssproj';
  AFileName := FileNameToRead;
end
else
begin
  FileNameToRead := ExtractFileName(AFileName) ;
end;

AContent := GetFileContentFromDB(PrjName, FileNameToRead );

Handled := True;

What mistake am I making here?

Regards,

Yogesh


Sorry....
Calling TIDEEngine.LoadProject fires the LoadFile event but it only fires event to load the Module files (.psc). It does NOT fire the event to
load associated Form files (.sfm).

The IDE Engine decides if a form must be loaded or not by checking if the form file exists. When you are using events, you must set OnCheckValidFile event, and return a valid flag for the passed file if it should load a form. 


Reference in documentation: http://www.tmssoftware.biz/business/scripter/doc/web/checkingifafilenameisval.html
Hello Wagner,
Finally I got this working.
Phew!! Thanks for your help.

But now I am facing come other problems which I will post separately.

Regards,

Yogesh