win32com.dll

is anybody know where to find win32com.dll filesits used with comm.jarTQ
[93 byte] By [Hairi.Mohda] at [2007-10-2 10:38:37]
# 1

You can find it in the following package

http://www.cs.uml.edu/~fredm/courses/91.305/software/JDK118-javaxcomm.zip

and if you succeed in detecting the serial port with javax.comm just tell me about your advancement

more information there

http://java.sun.com/developer/JDCTechTips/2002/tt0122.html

http://www.cs.uml.edu/~fredm/courses/91.305-fall04/javasetup.shtml

all the best

Yanosa at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 2
I would like to know whether you got the solution for detecting serial port with javax.comm API. If so, will you please help me in that?
Roopaa at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 3

I got it to work =). Thank god.

I had to put the .dll in the system32 directory. I put the properties file in the jre/lib (I also put the dll here, but it did not work on its own). I added the .jar file as an additional archived source (I'm using eclipse). And then was able to run a GPS connectionTest without fail.

Here is that source code which you may want to use as reference in terms of detecting the serial port.

http://gpslib4j.sourceforge.net/

nbauernfa at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 4
Thanks alot for that link, i have been searching like crazy befor looking in forum, :)
poppmea at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 5
I too was searching for hours, thank you so much for the link. It worked for me, what a relief!
MichaelTheMarvelousa at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 6

hey guys.....plzzz help me out....

1st of all i don't hv the properties file.....

secondly....i need to know how can i get modem inputs in my PC....

I m doin a project on takin alphanumeric input from modem which will b typed by the phone user and performing a search in my database and on that searched tuple i need to take that and convert to speech which again i need to read back to the phone via modem.

its a bit type of IVR project....

PLzzzzz help me out guys....

Nimesh4ua at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 7
guys i got the properties file...me too a nut....but can u plzz help me out on my project details wch i hv listed in my previous post...
Nimesh4ua at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 8
The above link did not work for me, so after some searching, I found win32comm.dll in this zip file ->ftp://www6.software.ibm.com/software/developer/library/i-barcode.zip
kf4oija at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 9
have you been succeded? ..me too need some advices - i just follow to simple example (from tutorial) and nothing happened - can not find any ports..
kloopa at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 10

Some things I've found out about using javax.comm (using JDK118-javaxcomm.zip; link in posting 2 by Yanos):

- comm.jar has to be on the classpath (for sure ;-))

- win32com.dll is allowed to be in any dir but you have to point to that dir using the system property java.library.path: e.g.

java -Djava.library.path=<the dir that contains win32com.dll> -classpath ...

The search strategy used to find javax.comm.properties:

- first: searching for: System.getProperty("java.home") + File.separator + "lib" + File.separator + "javax.comm.properties"

- if not found: javax.comm.properties is searched in the same dir comm.jar is stored; that's done by tokenizing System.getProperty("java.class.path") using a StreamTokenizer using File.pathSeparatorChar (";" on Win32) as token delimiter;

Because "_" and ":" are not defined for that StreamTokenizer as "normal" characters that are allowed inside a filename it won't work if you have a "_" inside the path to your comm.jar and it won't work if comm.jar is located on another drive than the current!!!!! ;-(((

Remember that for parsing / tokenizing any path always the system dependend File.pathSeparatorChar / File.separatorChar is used

GadAla at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 11

Initialization of CommPortIdentifier is really bad. The attached class does (for me) a better job. It removes the restrictions (no "_", ":" in classpath) as described in my previous posting. See JavaDoc on how to use. Please reply if it works for you too.

import java.io.File;

import java.io.IOException;

import java.io.StreamTokenizer;

import java.io.StringReader;

import java.lang.reflect.Field;

import java.lang.reflect.Method;

import javax.comm.CommPortIdentifier;

/**

* This class tries to do a better initialization of javax.comm than

* javax.comm.CommPortIdentifier (date: 15th Nov 1998) does because

* the original implementation does not tokenize the classpath on Win32 systems

* in a correct way.

* <P/>

* Just force the loading of that class does the job:

* <pre>

* Class.forName( "JavaXCommInitializer" );

* </pre>

* or

* <pre>

* Class c = JavaXCommInitializer.class;

* </pre>

* If not already done this class first forces the initialization of the original

* javax.comm.CommPortIdentifier (by calling getPortIdentifiers()) and runs the own initialization

* only if no ports were returned.

* <P/>

* Therefore access to private methods of javax.comm.CommPortIdentifier using the reflection

* API is necessary ;-). This will not be possible if you have a SecurityManager installed and not granted

* the necessary permissions.

* <P/>

* Most of the code is based on a decompiled version of javax.comm.CommPortIdentifier downloaded from

* http://www.cs.uml.edu/~fredm/courses/91.305/software/JDK118-javaxcomm.zip

*/

public class JavaXCommInitializer {

private JavaXCommInitializer() {}

private static String findPropFile() {

String s = System.getProperty("java.class.path");

StreamTokenizer streamtokenizer = new StreamTokenizer(((java.io.Reader) (new StringReader(s))));

streamtokenizer.whitespaceChars(((int) (File.pathSeparatorChar)), ((int) (File.pathSeparatorChar)));

streamtokenizer.wordChars(((int) (File.separatorChar)), ((int) (File.separatorChar)));

// characters allowed in a path (as long as they're not conflicting with File.pathSeparatorChar

char[] normalChars = { '.', ':', '_' };

for( int i = 0; i < normalChars.length; i++ ) {

char c = normalChars[i];

if( c != File.pathSeparatorChar ) {

streamtokenizer.ordinaryChar(c);

streamtokenizer.wordChars(c, c);

}

}

try {

while(streamtokenizer.nextToken() != -1) {

int i = -1;

if(streamtokenizer.ttype == -3 && (i = streamtokenizer.sval.indexOf("comm.jar")) != -1) {

String s1 = streamtokenizer.sval;

File file = new File(s1);

if(file.exists()) {

String s2 = s1.substring(0, i);

if(s2 != null)

s2 = s2 + "." + File.separator + "javax.comm.properties";

else

s2 = "." + File.separator + "javax.comm.properties";

File file1 = new File(s2);

if(file1.exists())

return file1.getCanonicalPath();

else

return null;

}

}

}

}

catch(IOException _ex) { }

return null;

}

private static void callPrivateMethod( Class clazz, String methodName, Class[] argTypes, Object[] args )

throws

Exception {

Method m = clazz.getDeclaredMethod( methodName, argTypes );

m.setAccessible( true );

m.invoke( null, args );

}

private static void setPrivateAttribute( Class clazz, String attrName, Object value )

throws

Exception {

Field f = clazz.getDeclaredField( attrName );

f.setAccessible( true );

f.set( null, value );

}

static {

// call the default initialization of javax.comm ...

if( !CommPortIdentifier.getPortIdentifiers().hasMoreElements() ) {

// ... if no ports found try to do it better ;-)

// no need for loading javax.comm.properties from <JAVA_HOME>/lib/javax.comm.properties

// as this is done very well by default init in CommPortIdentifier

// search propFile

String myPropfilename = findPropFile();

try {

if( myPropfilename != null ) {

// loadDriver(propfilename);

callPrivateMethod( CommPortIdentifier.class, "loadDriver", new Class[]{ String.class }, new Object[]{ myPropfilename } );

// propfilename = myPropfilename;

setPrivateAttribute( CommPortIdentifier.class, "propfilename", myPropfilename );

}

}

catch(Exception e) {

System.err.println(((Object) e));

}

}

}

}

GadAla at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 12
Hi people , grretings for all .I just want to know if the win32com.dll file is actually being supported by Sun . I think that it has been replaced by rxtx project . I don't know actually . Thanks .
eldelosforosa at 2007-7-13 2:43:57 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...