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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. greeneka

    Embedded Visual C++ Bluetooth Discovery Problems

    Hi IonelBurtan, I don't think there is a WSAInitialize function, perhaps you were thinking of WSAStartup? This was the simplest app I could think of - AFAIK i need to obtain the address of the device before I can connect to the device, and to find the address I need to be able to see the...
  2. greeneka

    Embedded Visual C++ Bluetooth Discovery Problems

    Hi All, I've posted this here since there doesn't seem to be an embedded development section. I am trying to code up a simple Bluetooth device discovery application - all it does it try to list the devices currently available. I have followed sample code from a book (Prog. MS WinCe.NET by D...
  3. greeneka

    Hot can I access the serial port?

    check out: http://java.sun.com/products/javacomm/
  4. greeneka

    Passing variable arguments to another function

    PerFnurt - true, but I have to call a previously defined function that uses the ellipsis, so I have to work with it!
  5. greeneka

    Passing variable arguments to another function

    P.S. Apologies - I meant to post the solution I'm using: I vsprintf'ed the data into a buffer and used that: void debugLog(int debuglevel, char *msg, ...){ if(debuglevel < maxlevel){ char buffer[500]; va_list argptr; va_start(argptr,msg); vsprintf( buffer, msg, argptr )...
  6. greeneka

    Passing variable arguments to another function

    Thanks for the replies. Salem - The example I gave was contrived, it's not printf I'm calling but a different function that takes variable arguments that does more than just print to the console (I just thought printf would be the easiest example). So I was hoping to be able to modify my...
  7. greeneka

    Passing variable arguments to another function

    Hi All, I'm writing a debug logging function and was wondering if there's any way to pass variable arguments straight to another function without touching them. For example I want to do something like this: #include <stdio.h> const int maxlevel = 3; void debugLog(int debuglevel, char *msg...
  8. greeneka

    File Filters

    If you're using a JFileChooser you'd have to implement it differently (like hologram said above) but if you just need to sort files you could try this: import java.io.*; import java.util.*; public class ListFilesInSizeOrder{ private static File[] files; public static void main(String[]...
  9. greeneka

    want to check whether JDialog is in background or not

    if you use the isFocused() that JDialog inherits from Window you'll be able to see whether it's the active window (which'll mean it's in front). If you need to be able to tell whether it's in view of the user use the getX and getY calls and check to see if it's directly behind the JFrame...
  10. greeneka

    looking for txt file in a directory

    Hi Nathan, you can use a FileFilter to do just that, here's an example: C:\test>more ListFiles.java import java.io.*; import java.util.*; public class ListFiles { public static void main(String[] args){ File f = new File(args[0]); if(f.exists()){...
  11. greeneka

    Java Program send data to MySQL database

    Hi erebus, To access databases from java you need to use JDBC. If you look at the MySQL website there's a driver that you have to download to access their databases: http://www.mysql.com/products/connector-j/index.html There's also some documentation there aswell that should help you get...
  12. greeneka

    How to implement program flow control?

    Hi Volcano, if you hold on to the reference of the Process object that the exec() function returns you can call the waitFor() function on that process to suspend execution until it finishes - for example: import java.io.*; public class testexec{ public static void main(String[] args){ try{...
  13. greeneka

    Reading a config file

    Hi Nathan, you should try using java.util.Properties to load your config file: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html If you create a new Properties object and then use the load() function to load in the file from the FileInputStream, you can then use the...
  14. greeneka

    Problems with IOException

    The problem is that the function action that your overriding doesn't throw an exception, so you can't make the function you're writing change that (i.e. you can't just add &quot;throws IOException&quot; to your version of action) to fix this you're going to have to catch the exception in the...
  15. greeneka

    Problem to convert string to integer

    Mad2, are you sure that parseInt() is deprecated? http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Integer.html AFAIK it's a perfectly valid alternative to valueOf()... Anyway, doesn't matter, either one will work fine:-)
  16. greeneka

    Cookie handling

    Are you writing a desktop application to check cookies coming from a site or a servlet(or JSP page) to check cookies coming from a web browser? If you're writing a desktop app heres a chunk of code I've used before: import java.net.*; import java.io.*; import java.util.*; public class...
  17. greeneka

    Semi-Complex Inheritance Question- URGENT

    At runtime if you need to check to see if the instance of BaseClass you're working with implements the interface, why not do something like public void func(BaseClass obj){ if(obj instanceof InterfaceClass){ // now safe to cast as an interface InterfaceClass ic = (InterfaceClass)obj; } }...

Part and Inventory Search

Back
Top