Page 1 of 1

RTF to HTML using irun.dll but there is error

Posted: Wed Apr 22, 2009 11:21 pm
by Mahmoud
Dear all,

I'm trying to convert RTF file to HTML file, and after s long search i found a useful library that may help me; which is (irun.dll: http://www.pilotltd.com/index_en.jsp?pagenum=221), then i tested the below code, and it build the HTML file but there is an error, i couldn't understand the error (invalid memory access), can any one help me solve this problem.

Code: Select all

Enumeration
  #EXO_RESULTS       = $01
  #EXO_INLINECSS     = $02
  #EXO_WMF2GIF       = $04
  #EXO_XML           = $08
  #EXO_HTML          = $10
  #EXO_MEMORY        = $20
  #EXO_NOHEADER      = $40 
EndEnumeration

Prototype.i ProtoConvertRTF2HTML(source.s, destination.s, options.i, bgcolor.s, title.s, dpi.i)

LibraryN = OpenLibrary(#PB_Any, "irun.dll")

If LibraryN
  source.s = "IRun RTF Converter.rtf"
  destination.s = "IRun RTF Converter.html"
  bgcolor.s = ""
  title.s = ""
  RTF2HTML.ProtoConvertRTF2HTML = GetFunction(LibraryN, "EXRTF2WEB")
  EXRTF2WEB(source.s, destination.s, #EXO_HTML, bgcolor.s, title.s, 96)
  
  CloseLibrary(LibraryN)
Else
  Debug GetLastError_()
EndIf
You can download the library and an example of using it in C i the following link: http://www.pilotltd.com/index_en.jsp?pagenum=221

Posted: Wed Apr 22, 2009 11:32 pm
by ts-soft
Can you deliver the DLL with your application? Then send, a link which
requires no registration. With registration i will not download it :wink:

Posted: Wed Apr 22, 2009 11:59 pm
by rsts
Yeah - was doing fine til I got to this page - maybe provide the zip file or something.

cheers


Programı sitemizden indirmek için lütfen aşağıdaki formu doldurup gönder tuşuna tıklayınız. Formda vereceğiniz bilgiler sizinle en verimli şekilde iletişim kurabilmemizi sağlayacaktır. Bilgilerin spam amaçlı kullanımı söz konusu değildir.

GÖNDERENE AİT BİLGİLER:
Adınız, Soyadınız
Kurum
Pozisyon
E-Posta
Programın kurulumu ve şifre girişiyle ilgili detaylar yukarıda yazdığınız email adresinize gönderilecektir.

KURUMA AİT BİLGİLER:
Telefon Faks
-- Lütfen bir şehir seçiniz --- --Yurtdışı--ADANA ADIYAMAN AFYON AĞRI AKSARAY AMASYA ANKARA ANTALYA ARDAHAN ARTVİN AYDIN BALIKESİR BARTIN BATMAN BAYBURT BİLECİK BİNGÖL BİTLİS BOLU BURDUR BURSA ÇANAKKALE ÇANKIRI ÇORUM DENİZLİ DİYARBAKIR DÜZCE EDİRNE ELAZIĞ ERZİNCAN ERZURUM ESKİŞEHİR GAZİANTEP GİRESUN GÜMÜŞHANE HAKKARİ HATAY IĞDIR ISPARTA İÇEL İSTANBUL İZMİR K.MARAŞ KARABÜK KARAMAN KARS KASTAMONU KAYSERİ KİLİS KIRIKKALE KIRKLARELI KIRSEHİR KOCAELİ KONYA KÜTAHYA MALATYA MANİSA MARDİN MUĞLA MUŞ NEVŞEHIR NİĞDE ORDU OSMANİYE RİZE SAKARYA SAMSUN ŞANLIURFA SİİRT SİNOP ŞIRNAK SIVAS TEKİRDAĞ TOKAT TRABZON TUNCELİ UŞAK VAN YALOVA YOZGAT ZONGULDAK

SINAVMATİK® İLE İLGİLİ:
İlgilendiğiniz Programlar: Sınavmatik® Soru Bankası programı

Sınavmatik® Ölçme Değerlendirme programı

Sınavmatik® Online Test Otomasyonu

Posted: Thu Apr 23, 2009 12:13 am
by jack
actually all you need to do is click on the button at the bottom, no need to register at all.

Posted: Thu Apr 23, 2009 12:25 am
by Peace
Hi Mahmoud, this should work...

Code: Select all

Enumeration
  #EXO_RESULTS       = $01
  #EXO_INLINECSS     = $02
  #EXO_WMF2GIF       = $04
  #EXO_XML           = $08
  #EXO_HTML          = $10
  #EXO_MEMORY        = $20
  #EXO_NOHEADER      = $40
EndEnumeration

PrototypeC.i ProtoConvertRTF2HTML(source.s, destination.s, options.i, bgcolor.s, title.s, dpi.i)

LibraryN = OpenLibrary(#PB_Any, "irun.dll")

If LibraryN
  source.s = #DQUOTE$+"IRun RTF Converter.rtf"+#DQUOTE$
  destination.s = #DQUOTE$+"IRun RTF Converter.html"+#DQUOTE$
  bgcolor.s = "FF00FF"
  title.s = "Hello"
  RTF2HTML.ProtoConvertRTF2HTML = GetFunction(LibraryN, "EXRTF2WEB")
  RTF2HTML(source.s, destination.s, #EXO_HTML, bgcolor.s, title.s, 96)
  CloseLibrary(LibraryN)
Else
  Debug GetLastError_()
EndIf

Posted: Thu Apr 23, 2009 3:47 pm
by Mahmoud
Dear Peace,,

Thanks for your replay, i tested ur code, but seems to hav the same error if i remove the #DQUOTE$ before and after the source and destination, and if i keep the #DQUOTE$ it doesn't build the desired HTML file, so i still trying to catch the error...


============
============

Later i tried another rtf file and it worked fine with no problems, so it turned to be an error with the source file..

Thanks to every one...

Posted: Thu Apr 23, 2009 3:57 pm
by Peace
Hi Mahmoud

#DQUOTE$ = Chr(34)

If you use spaces " " in filenames you should always add Chr(34)
before and at end of the string! :wink:

File$ = Chr(34) + " Name Of File" + Chr(34)

Hope it will help you Mahmoud...


_______________________
http://www.testaware.de.tp

Posted: Thu Apr 23, 2009 4:05 pm
by Mahmoud
Dear Peace,,,

You right, very thanks for your quick and brilliant replay, Later i tried another rtf file and it worked fine with no problems, so it turned to be an error with the source file name (contains spaces)..

really thanks to you...