BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

file association problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WinAPI
View previous topic :: View next topic  
Author Message
Volker Nabholz
Guest





PostPosted: Mon May 10, 2004 7:01 am    Post subject: file association problem Reply with quote



Hi Group,

we are programming with Delphi 6 + 7 and we have a problem with
"DDEServerConv". I don't know if it's a problem with this component
or if the error is somewhere else.

We want to start our application (proplan3.exe) and load a plan when
we doubleklick on a plan (*.ppl) in the explorer wich is related to our
program. Therefore we made the changes in the registry.

[HKEY_LOCAL_MACHINESoftwareCLASSES.ppl]
@="proplan3.Document"
[HKEY_LOCAL_MACHINESoftwareCLASSESproplan3.Document]
@="pro-Plan3 Document"
[HKEY_LOCAL_MACHINESoftwareCLASSESproplan3.Documentshell]
[HKEY_LOCAL_MACHINESoftwareCLASSESproplan3.Documentshellopen]
[HKEY_LOCAL_MACHINESoftwareCLASSESproplan3.Documentshellopenddeexec]
@="[FileOpen(%1)]"
[HKEY_LOCAL_MACHINESoftwareCLASSESproplan3.DocumentshellopenddeexecAp
plication]
@="PROPLAN3"
[HKEY_LOCAL_MACHINESoftwareCLASSESproplan3.DocumentshellopenddeexecTo
pic]
@="DDESystem"
[HKEY_LOCAL_MACHINESoftwareCLASSESproplan3.Documentshellopencommand]
@="C:\Programme\proPlan3\proplan3.exe"

We use "DDEServerConv" and this is what we do when ExecuteMacro will be
started.

procedure TfrmHaupt.DDESystemExecuteMacro(Sender: TObject; Msg: TStrings);
var
xFileName : string;
begin
if Pos('FileOpen', Msg.Strings[0]) > 0 then
begin
xFileName := Copy(Msg.Strings[0], Pos('(', Msg.Strings[0]) + 1,
Length(Msg.Strings[0]));
xFileName := Copy(xFileName, 1, Pos(')', xFileName) - 1);
if xFileName[1] = '"' then
xFileName := Copy(xFileName, 2, Length(xFileName));
if xFileName[Length(xFileName)] = '"' then
SetLength(xFileName, Length(xFileName) - 1);
WaitForInfoDlgClosed;

OpenFilename(xFileName);
end;
end;

The problem now is:
On W2k machines all will work fine.

On Win9x machines it will work only when proplan3.exe was started before.
It doesn't matter how it was started, via the Explorer oder Desktop-Icon.
I have a clean Win98 SE Image to try everytime with a new System.

That means when I reboot the machine and doubleclick a .ppl file,
proplan3.exe will start but NOT load the plan. It doesn't jump into the
DDESystemExecuteMacro. Long before the first screen of of proplan3.exe
will be shown, win9x shows a message:

---------------------------------------------------------------
C:ProgrammeproPlan3ProjekteTest.ppl
---------------------------------------------------------------
The file C:ProgrammeproPlan3ProjekteTest.ppl or one of it's
components is not found. Please confirm that all path- and
filenames are correct and all libraries are available.
---------------------------------------------------------------

If I try this then a second time all will work fine. So can you tell me
if we do something wrong.

Thanks in advance for your help!

Volker Nabholz
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WinAPI All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.