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...
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...
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 )...
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...
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...
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[]...
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...
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()){...
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...
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{...
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...
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 "throws IOException" to your version of action)
to fix this you're going to have to catch the exception in the...
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:-)
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...
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;
}
}...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.