General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 10th, 2002, 02:03 AM
Uniquex Uniquex is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 5 Uniquex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation HELP!!! Programmers Unite.

Hi fellow programmers,

I desperately need advice regarding the following, sorry if it is a bit lengthy :

In short, currently I have a program written in Visual Basic for windows that does the following :
- Get and holds detailed printer information and stores it in a pre-defined Structure
- Gets and holds print jobs¡¯ detailed information in the window printer queue in a pre-defined Structure
- Sends a print job from one printer queue to another
- Allows the above to be done on a local network

Note: the above program uses A LOT of pre-defined win32 APIS and the structures and most of the functions used are already defined by the language itself.

Now, I am given the task to transfer this program to PHP language and the program must be able to work on Windows & Linux platforms.

I¡¯ve did a bit of reading on PHP myself, but I can¡¯t seem to be able to find comprehensive functions for interacting between the platform & printer. Or maybe I missed it!

Does PHP has extensive pre-defined functions/classes/librabries/whatever-you-call-it for interacting with the printer ? e.g.
Libraries in JAVA, Win32 APIs in VB

I¡¯m completely new to Linux, any advice would be appreciated.
If PHP isn¡¯t suitable for this task, can you guys recommend a language to me? The language must be able to get detailed print job/printer information on Windows & linux platform.

Thanks a zillion in advance!!

Druda

Reply With Quote
  #2  
Old December 10th, 2002, 02:11 AM
ZaireWeb ZaireWeb is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Hamburg, NY
Posts: 37 ZaireWeb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to ZaireWeb Send a message via AIM to ZaireWeb
There is a JAVA extension, as well as W32API and Printer

http://php.net/java
http://php.net/printer
http://php.net/w32api

Also, what you could do is just use system()/exec() in PHP and port your other code to say c, or C++
__________________
Eric Coleman - Co-Owner ZaireWeb Solutions
eric.coleman@zaireweb.com
http://sitemod.net - sitemodCMS Coming Soon!

Reply With Quote
  #3  
Old December 10th, 2002, 10:55 PM
Uniquex Uniquex is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 5 Uniquex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by ZaireWeb
There is a JAVA extension, as well as W32API and Printer

http://php.net/java
http://php.net/printer
http://php.net/w32api

Also, what you could do is just use system()/exec() in PHP and port your other code to say c, or C++


Hi Zaireweb, thanks for your reply!

i heard the w32APIS and all that only work for Windows based OS. but my program needs to be able to commnuicate with both.

currently, i am not sure how the system()/exec() in PHP part works, but i was wondering that could achieve a cross platform program without having to write 2 different set of codes?

Reply With Quote
  #4  
Old December 10th, 2002, 11:02 PM
ZaireWeb ZaireWeb is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Hamburg, NY
Posts: 37 ZaireWeb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to ZaireWeb Send a message via AIM to ZaireWeb
Write your code in Java, and use PHP to interface with it

Reply With Quote
  #5  
Old December 10th, 2002, 11:09 PM
Uniquex Uniquex is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 5 Uniquex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by ZaireWeb
Write your code in Java, and use PHP to interface with it


wow.. you reply REAL fast

hmm.. if i do that, would i be able to make the program communicate with the workstations' printer installed on both windows & linux ?

Reply With Quote
  #6  
Old December 10th, 2002, 11:11 PM
ZaireWeb ZaireWeb is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Hamburg, NY
Posts: 37 ZaireWeb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to ZaireWeb Send a message via AIM to ZaireWeb
Im pretty sure Java has printer API built in, so I don't see the problem with it..

And yes you can use it on either one.. just make sure you have the Java Extension setup for PHP on both systems.. and it will be perfectly portable

Reply With Quote
  #7  
Old December 11th, 2002, 04:29 AM
Uniquex Uniquex is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 5 Uniquex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Eric,

saw your name from your signature.. thanks for replying again..
hmm.. frankly i am totally alien about what you are saying because i havent touch the PHP langauge itself, just doing preparation work..

i heard from some that PHP is a server langauge..

i suspect this would make my task more difficult.

hmm.. can i just compile the program to a .exe file & just run it on a central PC networked to the other PCs..? meaning this program would be a local program.

or else how do i go about it?

sorry, i am asking such silly questions, but i am really new to this PHP thingy..

thanks x infinity ~

Reply With Quote
  #8  
Old December 12th, 2002, 07:32 AM
ZaireWeb ZaireWeb is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Hamburg, NY
Posts: 37 ZaireWeb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to ZaireWeb Send a message via AIM to ZaireWeb
Oh, so you want just a stand-alone executable that works on either system?

Deffinitly just use Java then. After compiling it into a class, you can just create a shell script to execute 'java YourClassName'

Reply With Quote
  #9  
Old December 12th, 2002, 10:57 PM
Uniquex Uniquex is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 5 Uniquex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking

Hi Eric,

thanks for your advice!

i will try it out and post here again.
thanks again.. really thanks

btw, Merry Christmas~~~ HohOhohOho

Reply With Quote
  #10  
Old December 16th, 2002, 04:03 PM
hal_smith hal_smith is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 1 hal_smith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
A somewhat united alternative, maybe..

Druda
You might want to take a look at Borland's Delphi/Kylix solution. The Object Pascal used, with the CLX cross platform libraries allow fairly portable code between W32 and Linux, as long as you don't get too hairy with funky system calls (in either o/s).
I haven't done any production type cross platform work here, you must understand, but just noodling around, my ports have been ok, not dead simple, but ok. I generally do the rough program methodology validation in W32, then the port.
BTW, Kylix 3 comes with a C++ compiler, according to the last propaganda I got from Borland. Also, Borland has personal or open versions ....

-hal

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > HELP!!! Programmers Unite.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT