Icon not showing up

Post Reply
kronos911
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Icon not showing up

Post by kronos911 »

I'm haveing a problem with the icon in the title bar of my MDI window.
I'm using DLL resources and buring a RC file inthe the exe with one icon (so windows shows the exe with that icon). The icon that I'm calling is in the DLL, resname WIFTLOGO1, and in the RC file, resname 1.
In the main app I have this code

Code: Select all

SET RESOURCES TO "WIFTSRN.DLL"

// Do some checking for error files (????.ERR) If any are found round
// them up and send them by email using blat.exe to programer
// It there are err files then delete all CDX files and logout any users
// Check EXE rights to run on this system (burnt HD serial and vol id to 
// the end of the exe after the rc script has added the icon)

  DEFINE ICON oFolderICO NAME "WIFTLOGO1
  DEFINE WINDOW oMainWin;
   TITLE "IFT for Windows";
   MDI MENU BuildMNU1();
   ICON oFolderICO
  ACTIVATE WINDOW oMainWin MAXIMIZED ON INIT (Main2(cLineCmd))
  lError := .F.
RETURN
The rc files has one line that reads

Code: Select all

1 ICON .\RCS\FOLDER02.ICO
My rmk script at the end has the following

Code: Select all

BLINKER @$(LnkFile)
RC -k WIFT.RC WIFT.EXE
BURN WIFT.EXE NOVERBOSE
Am I doing something wrong? The only icon that is displayed is that window box with the blue line on top insted of my icon. When I look at the exe through windows explorer I see the RC icon fine but when I run the app I don't.
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Icon not showing up

Post by Enrico Maria Giordano »

Try

Code: Select all

//  DEFINE ICON oFolderICO NAME "WIFTLOGO1
  DEFINE WINDOW oMainWin;
   TITLE "IFT for Windows";
   MDI MENU BuildMNU1();
   ICON "WIFTLOGO1"
EMG
kronos911
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Post by kronos911 »

No still no show
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Icon not showing up

Post by StefanHaupt »

Dont´t use the ICON-clause, you can directliy call the method.

Code: Select all

SET RESOURCES TO "WIFTSRN.DLL"

  DEFINE ICON oFolderICO NAME "WIFTLOGO1
  DEFINE WINDOW oMainWin;
   TITLE "IFT for Windows";
   MDI MENU BuildMNU1();
//   ICON oFolderICO
  oMainWin:SetIcon (oFolderICO)  // <----
  ACTIVATE WINDOW oMainWin MAXIMIZED ON INIT (Main2(cLineCmd))
  lError := .F.
RETURN
Stefan
kronos911
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Post by kronos911 »

No dice the @@@ thing is still a no show.
I can see it fine in workshop. I renamed it, I deleted and reinserted it from the same ICO file that the RC script uses.
I'm now only using one DLL (merged them together) there are no double names or odd things in there. Can FW handle the VERSION tag that is in the DLL?

[EDIT]
Here is the ppo file if it helps. I don't see any thing wrong

Code: Select all

PROCEDURE Main(cLineCmd)

  LOCAL oFolderICO, oBrush, hFile1, cLgTxt, cLgFl, aFiles, nCounter1

  cLineCmd := If( cLineCmd == nil, "NORMAL", cLineCmd ) ;
  SetVarsUp()
  Settings()
  Set3DLook( Upper("ON") == "ON" )
  SetMultiple( Upper("OFF") == "ON" )

  SetWin95Look(.T.)
  RDDSETDEFAULT("SIXCDX")
  Sx_SetMemoBlock(16)

  IF !FILE(".\WIFTSRN.DLL")
    MSGStop(OemToAnsi("Ç âéâëéïèÞêç WIFTSRN.DLL äåí âñÝèéêå" + Chr(13)+Chr(10) + "Eîïäïò áðï ôï ðñüãñáììá."), OemToAnsi("Ðáñáêïëïõèçóç Åéóåñ÷ïìåíùí Öáêåëùí"))
    __Quit()
  ENDIF

  SetResources( "WIFTSRN.DLL" )

  IF !FILE("C:\IFT.LGT")
    hFile1:=FCREATE("C:\IFT.LGT")
    FWRITE(hFile1,"IFT ON LINE")
    FCLOSE(hFile1)
  ELSE
    cLgTxt := MEMOREAD("C:\IFT.LGT")
    cLgFl := SUBSTR(cLgtxt, AT("|", cLgTxt) + 1)
    cLgFl := SUBSTR(cLgFl, 1, AT("|", cLgFl) -1)
  ENDIF

  IF lIsDir(".\LOGS")
    lMkDir(".\LOGS")
  ENDIF

  IF LEN(DIRECTORY(".\*.ERR")) <> 0
    IF FILE(".\BLAT.EXE")
      IF !FILE(".\ERRSNT.TXT")

      ENDIF
    ENDIF
  ENDIF  

  IF FILE(".\ERRSNT.TXT")
    FERASE(".\ERRSNT.TXT")
    aFiles:=DIRECTORY(".\*.ERR")
    FOR nCounter1:=1 TO LEN(aFiles) STEP 1
      FERASE(".\"+aFiles[nCounter1,1])
    next
  ENDIF

  IF .F. // EXE security check here. Until final relese it is off
    MSGStop(OemToAnsi("Ï õðïëïãéóôÞò äåí åßíáé åîïõóéïäïôçìÝíïò ãéá íá åêôåëåß ôï wIFT." + Chr(13)+Chr(10) + "Ðáñáêáëþ åðéêïéíùíÞóôå ìå ôïí Ðïëõ÷ñüíç Ðïñöýñç" + Chr(13)+Chr(10) + "¸îïäïò áðü ôï ðñüãñáììá!"), OemToAnsi("Ðáñáêïëïýèçóç Åéóåñ÷üìåíùí ÖáêÝëùí Ðñïóâáóéìüôçôá"))
    __Quit()
  ELSE
    oFolderICO := TIcon():New( ,, "WIFTLOGO",, )
    oBrush := TBrush():New(, nRGB(   0,   79, 149 ),, )

    oMainWin := TMdiFrame():New(,,,, OemToAnsi("Ðáñáêïëïõèçóç Åéóåñ÷ïìåíùí Öáêåëùí"),, BuildMnu(), oBrush,,,,,,,,, )

      oMainWin:oMsgBar := TMsgBar():New( oMainWin, OemToAnsi("ÁñéèìçôéêÞ ðñïâïëÞ ìå âÜóç ôï ðëáúíü áñéèìü ôïõ öáêÝëïõ"), .F., .F., .F., .T.,,,,!.T. )

      oMainWin:SetFont(oMainFont)
      oMainWin:SetIcon(oFolderICO)
    oMainWin:Activate( Upper("MAXIMIZED"), oMainWin:bLClicked, oMainWin:bRClicked, oMainWin:bMoved, oMainWin:bResized, oMainWin:bPainted, oMainWin:bKeyDown, oMainWin:bInit := { | Self | (Main2(cLineCmd)) },,,,,,,,,,, oMainWin:bLButtonUp )
    lError:=.F.
  ENDIF
RETURN NIL

STATIC PROCEDURE Main2(cLineCmd)

  IF Int_logs("IFT",IIF(UPPER(cLineCmd)="LOG_MAKE",.T.,.F.),IIF(UPPER(cLineCmd)="LOG_RESET",.T.,.F.), cIFTPwd)
    aUsrData := LogIn(oMainWin)
    IF aUsrData[1] <> NIL
      hFile1:=FOPEN("C:\wIFT.LGT", 1)
      FSEEK(hFile1, 0, 2)
      FWRITE(hFile1,"|"+aUsrData[4,5]+"|")
      FCLOSE(hFile1)
      HLogMove(aUsrData, "Åéóïäïò óôï ðñïãñáììá")
      IF OpenDbfs()
        oMainWin:oMenu():aItems[1]:Enable()
        oMainWin:bValid := {|| (IIF(MsgYesNo(OemToAnsi("Åîïäïò áðï ôï ðñïãñáììá;"),OemToAnsi("Ðáñáêïëïõèçóç Åéóåñ÷ïìåíùí Öáêåëùí")), ( lMDIClose := .T.,.T.),.F.)) }
        IFTBrws()
      ELSE
        oMainWin:bValid := {||.T.}
        oMainWin:End()
      ENDIF
    ELSE 
      MSGStop(OemToAnsi("Ç ðñüóâáóç óôï ðñüãñáììá áðÝôõ÷å!"), OemToAnsi("Ðñïóâáóéìüôçôá"))
      oMainWin:bValid := {||.T.}
      oMainWin:End()
    ENDIF
  ELSE
    oMainWin:bValid := {||.T.}
    oMainWin:End()
  ENDIF
RETURN

STATIC PROCEDURE SetVarsUp()

  PUBLIC oMainWin, oBrwsWin, oMainFont, oLstBx1, lMDIClose, aUsrData, aFltLst1, lHreFlt:=.F., cIFTPwd, cVersion, oBrwsBar, oMsg1 := NIL, oMsg2 := NIL, oMsg3 := NIL, lError := .T., lPrgExit := .F.

  cVersion := "2,00,000"

  aFltLst1:=ARRAY(7,4)
  aUsrData:=ARRAY(1)
  aUsrData[1] := NIL

  oMainFont := TFont():New( "Arial Greek", 0, -12,,,,,,,,,,,,,, )

  lMDIClose := .F.
RETURN

EXIT PROCEDURE Exit_IFT()
  LOCAL hFile

  IF !lError
    FERASE("C:\wIFT.LGT")
  ENDIF
  IF aUsrData[1]<>NIL
    LogOut(aUsrData)
    MSGBeep()
  ENDIF
  IF lPrgExit
    MSGWait(OemToAnsi("Ôï ðñïããñáìå äéåêïøå ôçí ëåéôïõñãéá ôïõ."),OemToAnsi("Ðáñáêïëïýèçóç Åéóåñ÷üìåíùí ÖáêÝëùí Time lockdown system"),5)
  ENDIF

RETURN

PROCEDURE TimeChk()
  IF !((TIME() >= "06:59:59") .AND. (TIME() <= "14:00:00"))
    lPrgExit := .T.
    lError := .F.
    IF LEN(aUsrData) <> 1
      HLogMove(aUsrData, "Ôï ðñïããñáìå äéåêïøå ôçí ëåéôïõñãéá ôïõ. Time lockdown system")
    ENDIF
    __Quit()
  ENDIF

RETURN

kronos911
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Post by kronos911 »

Ok now this is great. I moved all the IF checks that are between SetResource() and the IF statement for the security chexk into Main2 and now I get the icon back. What gives?
Post Reply