Problem with 3rd party RTF to HTML converter

M

Max Power

I'm having some trouble with an RTF converter called Logictran R2Net
when two users access my site simultaneously. My application simply
runs an SQL query (based on parameters typed by user) that returns a
string of RTF data from the database, somethign like: SELECT text_data
FROM table WHERE text_id = @param. The text_data that is returned is
RTF, so I need to convert it to HTML for displaying in the browser.
This functionality is provided by R2Net. The code to convert the string
is as follows:

dim objR2net=Server.CreateObject("r2netaxdll.r2netobj")
dim intRes as integer = objR2net.init("c:\program
files\logictran\r2net.exe")
intRes = objR2net.ConvertStrRTF(text_data)
finaltext = objr2net.GetString(0)

The first two lines create and initialize the activex dll
(r2netaxdll.dll). The third line passes the text_data RTF string to the
converter and initiates the conversion (I believe the actual conversion
is done by another DLL which is registered on the server called
R2netdll.dll). The ConvertStrRTF method returns an integer indicating
the number of HTML strings it has created. The fourth line grabs the
converted string and loads it into the finaltext variable.

The Problem: if two users are accessing my site at the same exact time,
and use this page to convert two different RTF strings, the displayed
HTML is sometimes swapped. For instance, if User A runs a query for
text_id=101 and User B runs a query for text_id=202, the application
may display User B's results in User A's browser. I believe this is
happeneing because each user is sharing the same instance of the
converter program, and if one user executes the GetString method right
after another executes the ConvertStrRTF method, he will pull the other
user's data. Is this a problem with my code or is it a limitation of
the third-party object? Is there anything I can do (somehow queue up
the conversions) so that only one user can access the converter at the
same time? Thanks for your help.

PS I'm very new to .net and programming in general. sorry if I haven't
expalined the situtation well enough.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top