Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Doesn' t anyone know??! ActiveX dll........

Status
Not open for further replies.

cturland

Programmer
Sep 25, 2000
66
GB
I've posted this a few times before but never had a reply, its still causing me problems!

I'm trying to access the available printers in an ActiveX dll on a web interface. This is a bit of sample code:

Function AvailPrinters() as String

dim PrintData as Printers
dim sPrinters$

For Each PrintData in Printers
sPrinters$ = Printdata.DeviceName & " " & Printdata.driverName & ","
Next

AvailPrinters = sPrinters$

End Function

When I call this function from a VB app it returns a comma separated string of all the printers available. I then tried to include this dll in a Cold Fusion page and it returns an error saying that it can't access the printers.

Not sure if this is important but when I call the API function 'GetUserName' in my VB app it returns my username but when I call it in Internet Explorer through my dll I get 'SYSTEM'.

I'm really stuck, I've also tried launching an exe that used the dll through an ASP page but still no luck.

Any help would be really appreciated,
Rgds,
Carl
 
maybe you could try asking in the vb forum, as it's not really a coldfusion problem, but rather a "how to access a vb function "?
hope you'll find someone to solve your problem there
 
<CFOBJECT name=&quot;objPrint&quot; action=&quot;CREATE&quot; class=&quot;Test.TestPrint&quot; type=&quot;COM&quot;>

<CFSET sPinters = objTest.AvailPrinters()>
 
Sorry I meant :

<CFSET sPrinters = obPrint.AvailPrinters()>
 
I haven't done these in years but I seem to remember that functions and variables you access must be defined as public. You might try putting the &quot;Public&quot; keyword in front of &quot;Function AvailPrinters() as String&quot;.

Hope this helps,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top