|
-
Jan 24th, 2007, 10:46 AM
#1
Thread Starter
Addicted Member
using J/Direct for API
I want to get into using the win32 API with java but I can't find any good tutorials on how to use it.
I'm familiar with using the API because I've used it a lot in VB .NET... Basically what I need to know is the following:
1. Is J/Direct included in the regular sdk? If not where do I get it?
2. What do I have to import in order to use J/Direct?
3. What is the best way to convert a VB API function declaration into a Java function declaration? For example, How would I declare the FindWindow() function in Java? How does it know to look in user32.dll?
4. Any other info I may find useful.
-
Jan 24th, 2007, 12:50 PM
#2
Re: using J/Direct for API
Java is platform independent. Trying to use the API from it is misguided.
J/Direct was created by Microsoft specifically for Visual J++, their crippled JVM. This product is no longer under development - in fact, Sun's won some case against MS so they can't develop it any further. J/Direct is not available for any other JDK.
The only way to use the WinAPI from Java is to wrap it all in JNI classes written in C or C++. Such wrappers exist in SWT, the Standard Widget Toolkit, developed by the Eclipse project. However, they are part of the internal code and not meant to be used directly. (They also wrap only the minimal subset of the API they need, so you'll probably find a lot of stuff missing.)
Bottom line: don't use the WinAPI from Java. Use Swing or SWT for windowing, and use a different language if you want API access.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|