Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Nov 12, 2019 4:54 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Evaluating Real Studio - dll issue
PostPosted: Tue Aug 16, 2011 3:26 pm 
Offline

Joined: Tue Aug 16, 2011 3:17 pm
Posts: 11
Hello, I'm new to Real Studio and not too experienced with dll's. :mrgreen: We have a network of kiosks that currently run a flash app through a proprietary runtime. I'm looking at RS to see if I can replicate the runtime functionality. So far I registered my dll in windows. I can import it into RS. I try to use it's methods and get errors. Is there a good info source or tutorial on how to do this? Or can someone please explain the steps to me? Thank you.


Top
 Profile  
Reply with quote  
 Post subject: Re: Evaluating Real Studio - dll issue
PostPosted: Tue Aug 16, 2011 4:17 pm 
Offline

Joined: Tue Aug 16, 2011 3:17 pm
Posts: 11
Do I put the Object control on the screen and assign it to my dll by selecting the dll in the dropdown? Then should I be able to set the properties?


Top
 Profile  
Reply with quote  
 Post subject: Re: Evaluating Real Studio - dll issue
PostPosted: Tue Aug 16, 2011 4:29 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
Unless your dll exposes either an ActiveX control or an RB control I dont think that will work

If it does expose an ActiveX controls you might want to look at http://docs.realsoftware.com/index.php/OLEContainer

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Evaluating Real Studio - dll issue
PostPosted: Tue Aug 16, 2011 4:46 pm 
Offline
Real Software Engineer

Joined: Fri Sep 30, 2005 8:28 am
Posts: 242
Location: Unfortunately not Canada
What specific errors are you getting?
It sounds like your DLL is really an ActiveX/COM component. What program/language did you use before to automate this component? Perhaps if you posted the code we can help translate that to RB.


Top
 Profile  
Reply with quote  
 Post subject: Re: Evaluating Real Studio - dll issue
PostPosted: Wed Aug 17, 2011 7:56 am 
Offline

Joined: Tue Aug 16, 2011 3:17 pm
Posts: 11
Thanks William
This dll was supplied to us from a vendor, so it is somewhat of a black box to me. I can add it to RB from the project tab>add to project>Activex Component . When I select this, the window titled "COM Components" opens. My dll does not appear in the "Controls" tab but it does appear in the "Reference" tab. I select it there and it imports into RB. I can see PRICECHECKERCOMlib in the project tab. Under this tree heading I see PCT and IPCT. Also, under Help I see PRICECHECKERCOMlib and it shows properties and methods. From here I am not clear how to proceed. Do I use OLE control or Object?


Top
 Profile  
Reply with quote  
 Post subject: Re: Evaluating Real Studio - dll issue
PostPosted: Wed Aug 17, 2011 9:18 am 
Offline

Joined: Tue Aug 16, 2011 3:17 pm
Posts: 11
Here's it use on an html page:
<HTML>
<HEAD>
<TITLE>PCT test page</TITLE>
</HEAD>
<BODY>
<input id="upc" />
<input type="submit" id="Text1" value="Check Price" onclick="doQuery();"/><br>
<span id="test"></span>
<OBJECT ID="PCT" CLASSID="CLSID:73F90CB6-4875-4701-89E3-D3F4EC86DECE">COM object not found!</OBJECT>
<script type="text/javascript">
//PCT.server_ip = "172.17.62.2"; //PCT server ip
PCT.server_ip = "172.17.96.2"; //PCT server ip
PCT.server_port = 4050; //PCT port
PCT.query_timeout = 5000; //5 second query timeout

function doQuery()
{
var element = document.getElementById("test");

retval = PCT.queryBarcode(upc.value);
if(retval == 0)
{
price = PCT.price;
price = price.split('>BC>').join('<br>bonus_price: ');
element.innerHTML = "description: "+PCT.description+"<br>price "+price;
}
else if(retval == -1)
element.innerHTML = "Item Not Found!";
else if(retval == 1)
element.innerHTML = "PCT Communication Error!";
else if(retval == 2)
element.innerHTML = "PCT Error!";
else
element.innerHTML = "Unknown Error (should never happen)!";
}
</script>
</BODY>
</HTML>


Top
 Profile  
Reply with quote  
 Post subject: Re: Evaluating Real Studio - dll issue
PostPosted: Wed Aug 17, 2011 10:00 am 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
I'd almost try using it without the DLL and just using an TCP or HTTPSocket directly :)

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Evaluating Real Studio - dll issue
PostPosted: Wed Aug 17, 2011 3:06 pm 
Offline
Real Software Engineer

Joined: Fri Sep 30, 2005 8:28 am
Posts: 242
Location: Unfortunately not Canada
orgreeno wrote:
Thanks William
This dll was supplied to us from a vendor, so it is somewhat of a black box to me. I can add it to RB from the project tab>add to project>Activex Component . When I select this, the window titled "COM Components" opens. My dll does not appear in the "Controls" tab but it does appear in the "Reference" tab. I select it there and it imports into RB. I can see PRICECHECKERCOMlib in the project tab. Under this tree heading I see PCT and IPCT. Also, under Help I see PRICECHECKERCOMlib and it shows properties and methods. From here I am not clear how to proceed. Do I use OLE control or Object?


Try something like this:
Dim pct As New PRICECHECKERCOMlib.PCT
pct.server_ip = "172.17.96.2"; //PCT server ip
pct.server_port = 4050; //PCT port
pct.query_timeout = 5000; //5 second query timeout


Top
 Profile  
Reply with quote  
 Post subject: Re: Evaluating Real Studio - dll issue
PostPosted: Thu Aug 18, 2011 3:55 pm 
Offline

Joined: Tue Aug 16, 2011 3:17 pm
Posts: 11
This works :D
-------------------------------------------------------------------------
Dim pct As New OLEObject("{73F90CB6-4875-4701-89E3-D3F4EC86DECE}")
Dim params(1) as Variant

params(1) = UPCinput.text
pct.Value("server_ip") =IPinput.text
pct.Value("server_port") = pctport
pct.Value("query_timeout") = qt

pct.invoke("queryBarcode", params)

pctOutput.text = pct.Value("description")+" "+pct.Value("price")
-------------------------------------------------------------------------

Thanks William - I tried to use what you wrote but couldn't get the method call to work.

how should this be written?

pct.invoke("queryBarcode", params)

Like this?

pct.queryBarcode(params)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group