Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error loading printer driver
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Error loading printer driver
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01044455
Message ID:
01044455
Vues:
54
Hi all,

I've written a windows service in VFP9 which was built on XP SP2 and it works fine when I run it as a service. I get the desired result back which is printing bills to JPG images.
But when I test on our target machine, when I run as a service I get an error noted in the title of this thread. However, if I run it interactively (by double clicking the exe through explorer) then everything works as it should. What's the diference? Why is it failing?

Below is my OS version info.
OS(1)= Windows 5.00------ Description: the name and version number 
OS(5)= 2195-------------- Description: build number 
OS(6)= 2----------------- Description: the operating system platform.
OS(7)= Service Pack 4---- Description: Service Pack 
Here is my code:
PUBLIC oService as CIAEA OF MAIN.PRG

m.oService=CREATEOBJECT("CIAEA", ;
	IIF(_vfp.StartMode>0,ADDBS(JUSTPATH(_vfp.ServerName)),FULLPATH("")), ;
	IIF(_vfp.StartMode>0,ADDBS(JUSTPATH(_vfp.ServerName))+"data\",FULLPATH("")+"data\") ;
	)

READ EVENTS

DEFINE CLASS CIAEA as Form 
  FUNCTION DeliverService(lpnWhich as Integer)
    LOCAL llReturn as Logical 
    m.llReturn = .t.
    DO CASE 
      CASE m.lpnWhich = 1 && Print bills
        * Code omited 
        TRY 
          this.poJPGListener.targetfilename = m.lcFileName
          this.poJPGListener.ListenerType=2
          REPORT FORM rptbill1.frx OBJECT this.poJPGListener && It goes wrong here
          IF FILE(m.lcFileName) ;
          THEN 
            && do something
          ELSE 
            THROW "Bill not created"
          ENDIF 
        CATCH TO loE
          this.LogError()
          m.llReturn = .f.
        ENDTRY         
    ENDCASE 
    RETURN m.llReturn
  ENDFUNC && DeliverService
ENDDEFINE && CIAEA 
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform