Newsgroup: it.comp.lang.vo-clipper
Titolo: problema con i ptr in un metodo che lancia word

Salve a tutti Voi,
Ho un problema che mi leva il sonno stamani !!!
Cerco di usare un metodo che deve lanciare word e procedere a stampare una
lettera in cui sostituisco dei meta-dati con il contenuto delle variabili
che passo mediante il metodo che descrivo qui sotto.
Il problema è che in fase di compilazione mi restituisce il seguente errore:
"Conversion not possible str<->ptr not possible error 51901"
alla riga di lancio di Word '97  come si può osservare di seguito:
qualcuno può aiutarmi a capire dove devo intervenire per risolvere il
problema ???
n.b.: l'errore rimane anche se si tramuta la variabile da stringa in intero
METHOD DDE2Word() CLASS STANDARDSHELLWINDOW
    LOCAL oip AS IPCClient
    LOCAL cNull, cTopic, cName, cReplaceName, cReplaceAddress, cReplaceCity,
cReplaceSubject  AS STRING
 LOCAL cAddress, cCity, cSubject, cWordPath, cTelnr, cReplaceTelnr,
cWordLaunch, cFilename AS STRING
 LOCAL oErr AS ErrorBox
    LOCAL oTB AS TextBox
 oTB := TextBox{ SELF, "DDE2Word example","Launch Word with standard letter
?" }
 oTB:Type := BUTTONYESNO + BOXICONQUESTIONMARK
 IF ( oTB:Show() == BOXREPLYYES )
  cNull:=NULL_STRING
     cTopic:="System"
  cWordPath := 'c:\msoffice\winword\'  // location of winword executable
  // set up the information which should be put into letter :
  cFileName := 'start.doc' // give name of word 'document'
  // determine here the Word executable and Word document you want to launch
:
  cWordLaunch := cWordPath + 'winword ' + cWordPath + cFilename // pls.
change cFilename location as required
  // set up what name, address etc info you want to put in :
     cName := 'Greg Kendall [DataPro]'
  cAddress := 'P.O. Box 6663'
  cCity := 'Warner Robins, GA 31095-6663'
  cSubject := 'Purchase of ReportPro 2.0'
     cTelnr := '
(912)923-3793
'
  IF WinExec((cWordLaunch),SW_SHOW) < 32  <Questa riga da errore>
      ErrorBox{SELF,"Sorry unable to launch MS Word !"}
  ELSE
      oip:=IpcClient{"WINWORD"}
      oip:Init("WINWORD")
   cNull:=NULL_STRING
   cTopic:="System"
   // set up the WordBasic commands to be carried out.  (see WordBasic help
file)
   cReplaceName := '[EditReplace .Find = "@Name", .Replace = "'+cName+'",
.Format = 1, .ReplaceAll, .Wrap = 1]'
         cReplaceAddress := '[EditReplace .Find = "@Address", .Replace =
"'+cAddress+'", .Format = 1, .ReplaceAll, .Wrap = 1]'
   cReplaceCity:= '[EditReplace .Find = "@City", .Replace = "'+cCity+'",
.Format = 1, .ReplaceAll, .Wrap = 1]'
   cReplaceSubject := '[EditReplace .Find = "@Subject", .Replace =
"'+cSubject+'", .Format = 1, .ReplaceAll, .Wrap = 1]'
   cReplaceTelnr := '[EditReplace .Find = "@Telnr", .Replace = "'+cTelnr+'",
.Format = 1, .ReplaceAll, .Wrap = 1]'
         // excecute the DDE communication with WinWord :
   oip:Execute(cTopic,cNull, "'"+cReplaceName+"'")
   oip:Execute(cTopic,cNull, "'"+cReplaceAddress+"'")
   oip:Execute(cTopic,cNull, "'"+cReplaceCity+"'")
   oip:Execute(cTopic,cNull, "'"+cReplaceSubject+"'")
   oip:Execute(cTopic,cNull, "'"+cReplaceTelnr+"'")
      oip:Destroy()
     ENDIF
   ENDIF
RETURN SELF

  IF WinExec((cWordLaunch),SW_SHOW) < 32  <Questa riga da errore>
prova con 
WinExec(string2psz(cWordLaunch),SW_SHOW)
Antonello.