Recent

Author Topic: Problem with cmFileOpen and StdDlg  (Read 7696 times)

vitaly_t

  • Newbie
  • Posts: 3
Problem with cmFileOpen and StdDlg
« on: December 13, 2016, 11:01:10 pm »
There is procedure


uses ... StdDlg ... ;

Procedure FileOpen;
var
 PF: PFileDialog;                     
 Control: Word;
 s: PathStr;
begin
 New(PF, Init('*.dat','Select file:','File name',fdOpenButton,0));
 Control:= DeskTop^.ExecView(PF);                                         
 case Control of                                                               
  StdDlg.cmFileOpen, cmOk:
   begin                                       
    PF^.GetFileName(s) ;             
   end;
 end;
 Dispose (PF, Done)
end;

So I have error message
...
lab1.pas(24,10) Error: Identifier not found "cmFileOpen"
...

In TV it is work.
Anybody can help me solve the problem?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Problem with cmFileOpen and StdDlg
« Reply #1 on: December 13, 2016, 11:18:51 pm »
In FV it is in "fvconsts"

vitaly_t

  • Newbie
  • Posts: 3
Re: Problem with cmFileOpen and StdDlg
« Reply #2 on: December 14, 2016, 07:19:58 am »
In FV it is in "fvconsts"
Could you please explain some more. Do you mean add FVConsts in uses ?
I add the module but error doesn't disappear.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Problem with cmFileOpen and StdDlg
« Reply #3 on: December 14, 2016, 07:34:25 am »
I add the module but error doesn't disappear.
Well, that isn't too strange considering that you explicitly reference it to be part of unit StdDlg

  StdDlg.cmFileOpen, cmOk:
Remove that part or replace it with unit name FVConsts instead.

vitaly_t

  • Newbie
  • Posts: 3
Re: Problem with cmFileOpen and StdDlg
« Reply #4 on: December 14, 2016, 07:46:00 am »
I add the module but error doesn't disappear.
Well, that isn't too strange considering that you explicitly reference it to be part of unit StdDlg

  StdDlg.cmFileOpen, cmOk:
Remove that part or replace it with unit name FVConsts instead.

Yes. It's strange. In source I can see cmFileOpen is StdDlg unit.

But you advice about FVConsts instead StdDlg is helpfull.  Thank you very much.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Problem with cmFileOpen and StdDlg
« Reply #5 on: December 14, 2016, 08:04:12 am »
Yes. It's strange. In source I can see cmFileOpen is StdDlg unit.
Free Pascal's Free Vision has that identifier declared inside unit FVConsts, so you would need that unit in order to be able to use the cmFileOpen constant.

I don't understand what is strange about that ... please elaborate in case you still have questions

 

TinyPortal © 2005-2018