RTF to HTML using irun.dll but there is error

Just starting out? Need help? Post your questions and find answers here.
Mahmoud
New User
New User
Posts: 6
Joined: Fri Mar 13, 2009 12:36 am
Location: Cairo, Egypt

RTF to HTML using irun.dll but there is error

Post 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
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post 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:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post 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
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

actually all you need to do is click on the button at the bottom, no need to register at all.
User avatar
Peace
User
User
Posts: 14
Joined: Sun Aug 10, 2008 12:14 pm
Location: Then
Contact:

Post 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
Mahmoud
New User
New User
Posts: 6
Joined: Fri Mar 13, 2009 12:36 am
Location: Cairo, Egypt

Post 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...
Last edited by Mahmoud on Thu Apr 23, 2009 4:02 pm, edited 1 time in total.
User avatar
Peace
User
User
Posts: 14
Joined: Sun Aug 10, 2008 12:14 pm
Location: Then
Contact:

Post 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
Mahmoud
New User
New User
Posts: 6
Joined: Fri Mar 13, 2009 12:36 am
Location: Cairo, Egypt

Post 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...
Post Reply