Open Multiple Port through Socket Programming

Hi,
Actually I want to connect to three diff. ports on a Server from clinet, the port should be identified by a particular number.... and multiple users can access the server a the same time.... how do I program it....
I need to program Client side....
Thanks
Sharad

The client will need to be multithreaded if you want to connect to more then one port at a time from the client.
public class Client {
int port;
String addr;
... openConnection(addr,port);
the openConnection(String, int) method will actaully need to open a new thread where all the actual code goes. This will allow the Client class to call openConnection() again and use a new server/port. And you can keep calling this until you don't have any more local ports to bind to, or the server runs out of ports, or both.
The book Core Java 2, volumes 1 and 2 have good examples of this and I also suggest Java Network Programming and Distributed Computing.

Similar Messages

  • How to open multiple forms through differnt responsiblity

    I have a 11.5.10.2 system on Linux red hat.
    Business pepole want to open multiple forms through different responsiblities from multiple web brower sessions.
    However when I opened 2 IE brower sessions, log into responsiblity and open one oracle form in one IE session and log into another responsiblity through second IE session. The first opened form disappear and replaced by the second oracle form opened from another IE session. That means only one Oracle form can be open at the same time for this case.
    The current walkaround solution is to open 2 browser sessions using 2 different browsers ( one is IE another is Firefox) to fix this issue. Apparently this is not a good solution.
    Can you please give me some suggestion to fix this issue?

    Thank you very much for the information.
    The note mention:
    The new forms launcher does not support opening multiple forms applets for the same database across different responsibilities. Opening a form in another responsibility will cause any forms currently open to close. This behaviour is standard.
    However it is possible to enable users to open multiple forms sessions for the same database for the same responsibility when using MS Internet Explorer as the client browser. This is made possible with Patch 3293241. This patch is included in Oracle Applications release 11.5.10 as standard.
    My current system is 11.5.10.2. I verified that patch 3293241 has been applied. I have no problem to open mutiple forms with in SINGLE web brower session, within same responsibility. I am aware that you can not open multiple forms through SINGLE web brower session through multiple responsiblity. What I tried to do is to open mutiple forms through multiple web browers sessions. Open one brower session, log into system and open a form, then open another web brower session, log into the sytem and open a form through different responsiblity. The system does not allow me to open multiple forms through multiple web brower sessions. Only the latest form can be displayed. Is this standard design for 11.5.10?
    Can Form Servlet architecture solve this limitation?
    Actually afterI changed some form funcation paramter in Oracle Application Developer responsiblity, I can open 2 form session from 2 different responsiblities through 2 web brower sessions. I can open one form session as Application Developer and another form session through another responsiblity. Then I can switch to other responsiblity through Application Developer responsiblity to open forms.
    Is there any other way I can open multiple form sessions to the same database through multiple web brower sessions?
    Thanks a lot for your help
    Edited by: wcxtao on Nov 3, 2008 9:47 AM
    Edited by: wcxtao on Nov 3, 2008 9:57 AM
    Edited by: wcxtao on Nov 3, 2008 10:08 AM

  • Transfering a file through Socket programming

    Hi all,
    I want to return a file from server to client through a socket. I tried using ObjectOutput Stream where in I returned a java.io.File from server. But at client side when I say file.getLeangth() it comes as 0 and if I try to assign FileInputStream on the object it throws an exception as the file not found as the path associated with the file will be of Server.
    So can anyone help as to how to transfer a file through socket programming???
    thx in advance
    MK

    java.io.File is NOT the contents of the file. It really just represents the path.
    If you want to transfer the file's contents, you'll have to use a FileInputStream or FileReader, read from it, and then write the bytes or chars on the wire.

  • Opening multiple ports on Airport Extreme

    I need to open multiple ports on an Airport Extreme to allow for ftps service (about 500 ports). In port forwarding, it appears that I would have to enter 500 entries to do that (e.g. port 4001, 4002, 4003 etc.) Sounds wacky. In other routers (or linux sortware), multiple entries can be entered like "400, 4000-4500". Apple docs don't address this (from what I could find). Is there a syntax for multiple port forwarding?

    Are you using the round 802.11b/g AirPort Extreme base station (AEBS) or the square 802.11b/g/n AEBS?
    The round AEBS does not allow you to enter ranges. The only solution for a great number of ports is to use the default host option and send ALL the ports to the designated computer.
    I believe that the square AEBS allows you to enter ranges.

  • How to open specific port using java program

    Hello,
    I want to open ,close port using java comm.plz help me how can i do it.is it possible
    by using java program.later i want to use that specific port to accept the server socket connection .plz
    help me.

    i try this java program.*but it get block in accept method*.tht mean i m not able to make connection with port.
    import java.sql.SQLException;
    import java.io.IOException;
    import java.net.ServerSocket;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    class MakeConn
         public final static int PORT = 7788;
    public static java.net.Socket clientSocket = null;
    public static java.io.PrintWriter pw = null; // socket output stream
    public static java.io.BufferedReader br = null;
    public static ServerSocket server_socket;
         public static void main(String[] args) throws SQLException
         try {
              server_socket = new ServerSocket(PORT);
    clientSocket = server_socket.accept();
    System.out.println("CLIENT>>>" + clientSocket);
         br = new java.io.BufferedReader(new java.io.InputStreamReader(clientSocket.getInputStream()));
    pw = new java.io.PrintWriter(clientSocket.getOutputStream(), true);
    String message = br.readLine().trim();
    System.out.println("message is"+message);
    pw.close(); // close everything
    br.close();
    clientSocket.close();
         catch (Exception ex) {
    ex.printStackTrace();
    }

  • Printing through socket programming

    Hi,
    i have written a clent side socket program which connects to my printer.
    and print the byte[] input stream . I ran my prog and it didn't throw any exception/error. The connection was also made successfully however no page is being printed by the printer.
    Any suggestion over this issue?
    Code:-      public static void testPrint(byte[] b, InetAddress printerName, int port) throws IOException{          
              System.out.println("Inside Test method");
              System.out.println("PrinterName is" +printerName +"---"+"port is" +port +"----byte is " +b.toString());
              if (b!= null) {
                   Socket so = null;
                   OutputStream out = null;
                   try {
                        so = new Socket(printerName,port);               
                    if (!so.isConnected()) {
                       System.out.println(printerName + ": " + port + "Connect failed");
                    out = so.getOutputStream();                    
                        if(out != null) {
                             System.out.println("OutPut Stream is not null"+out);
                             out.write(b);
                             out.flush();
                        else {
                             System.out.println("OutPut Stream is null");
                   catch (UnknownHostException ue) {
                        System.out.println("Printer is not recognised" +ue);               
                   catch (IOException ioe) {
                        System.out.println("I/O error" +ioe);
                   finally {
                        try {
                             if (out != null) {                              
                                  out.close();
                        catch (IOException ioe) {
                             System.out.println("Unable to close output stream for connection : " + printerName + " : " + port);
                        try {
                             if (so != null) {
                                  System.out.println("Closing Socket Connection");
                                  so.close();
                        catch (IOException ioe) {
                             System.out.println("Unable to close socket connection : " + printerName + " : " + port);
              }

    Hi,
    i have written a clent side socket program which connects to my printer.
    and print the byte[] input stream . I ran my prog and it didn't throw any exception/error. The connection was also made successfully however no page is being printed by the printer.
    Any suggestion over this issue?
    Code:-      public static void testPrint(byte[] b, InetAddress printerName, int port) throws IOException{          
              System.out.println("Inside Test method");
              System.out.println("PrinterName is" +printerName +"---"+"port is" +port +"----byte is " +b.toString());
              if (b!= null) {
                   Socket so = null;
                   OutputStream out = null;
                   try {
                        so = new Socket(printerName,port);               
                    if (!so.isConnected()) {
                       System.out.println(printerName + ": " + port + "Connect failed");
                    out = so.getOutputStream();                    
                        if(out != null) {
                             System.out.println("OutPut Stream is not null"+out);
                             out.write(b);
                             out.flush();
                        else {
                             System.out.println("OutPut Stream is null");
                   catch (UnknownHostException ue) {
                        System.out.println("Printer is not recognised" +ue);               
                   catch (IOException ioe) {
                        System.out.println("I/O error" +ioe);
                   finally {
                        try {
                             if (out != null) {                              
                                  out.close();
                        catch (IOException ioe) {
                             System.out.println("Unable to close output stream for connection : " + printerName + " : " + port);
                        try {
                             if (so != null) {
                                  System.out.println("Closing Socket Connection");
                                  so.close();
                        catch (IOException ioe) {
                             System.out.println("Unable to close socket connection : " + printerName + " : " + port);
              }

  • Scripted movie won't run outside of firewall...open multiple ports?

    I'm new to Flash and AS3, but with the help of many examples I have managed to created a scripted movie using some time lapse photography.  I load the images from an XML file and use an event listener to add each image as a child of a movie clip.  As the number of children grew, it caused the frame rate to slow, so I figured out that I could remove them after they were viewed and just keep looping through the array.
    This works great on the local machine and when served up from the web server behind the firewall.  However,  if I try to access the file from outside the firewall, it loads the first image or two very slowly (if at all) then hangs.  I've performed a net stat from the server and noticed that it is opening an inordinate number of connections to the remote client on various client ports (from 6 to 60+).
    Any help would be greatly appreciated!  The code I'm using is below...
    // Input Parameters
    var ssxml:String = "myfile.xml"; // file containing images & dates
    // Stage settings
    var swfStage:Stage = this.stage;
    var swfFrameRate:int = 10;
    swfStage.scaleMode = StageScaleMode.NO_SCALE;
    //  Movie Clip
    var mc:MovieClip = new MovieClip();  // initiate movie clip
    mc.x      = 25;     // starting point X
    mc.y      = 50;     // starting point Y
    //  Text Field
    var tf:TextField = this.dtsText;
    // Cropping Rectangle
    var cr:Sprite = new Sprite();
    cr.graphics.beginFill(0x057072);
    cr.graphics.drawRect(25,50,550,7);
    cr.graphics.endFill();
    // Read Flash Variables
    try {
    var keyStr:String;
    var valueStr:String;
    var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
    for (keyStr in paramObj) {
      valueStr = String(paramObj[keyStr]);
      if (keyStr == "srcFile") {
       ssxml = valueStr;
      if (keyStr == "swfFrameRate") {
       swfFrameRate = int(valueStr);
       swfStage.frameRate = swfFrameRate;
    } catch (error:Error) {
    trace (error.message);
    *  Configure a loader to import the list of images and date
    *  time stamps from an XML file. The list of variables will
    *  be stored in arrays.
    var photos_xml:XML
    var xmlLdr:URLLoader = new URLLoader();
    xmlLdr.addEventListener(Event.COMPLETE, completeHandler);
    xmlLdr.load(new URLRequest(ssxml));
    var img_array:Array = new Array(); // images
    var dts_array:Array = new Array(); // date time stamps
    var img_count:int   = 0;
    function completeHandler(event:Event):void {
    try {
      photos_xml = new XML(event.target.data);
      var imgs:XMLList = photos_xml.img;  
      var dtss:XMLList = photos_xml.dts;    
      img_count = imgs.length();
      for (var i=0;i<img_count;i++) {
       img_array.push({src:imgs[i].text()});
       dts_array.push({src:dtss[i].text()});
    } catch(error:Error){
      trace(error.message);
    var nextImg:int = 0;
    var imgLdr:Loader = new Loader();
    imgLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoad);
    imgLdr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
    imgLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, updateInfo);
    stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
    function enterFrameHandler(event:Event):void {
    try {
             if (img_array.length > 0 ) {
       loadInitialImage();
    } catch(error:Error){
      trace(error.message);
    function loadInitialImage():void {
    imgLdr.load(new URLRequest(img_array[nextImg].src));
    function doneLoad(event:Event):void {
    var theImage:DisplayObject = event.target.content;
    imgLdr.unload();
    var bm:Bitmap = theImage as Bitmap;
    mc.addChild(bm);
    mc.scaleX = 550/640;
    mc.scaleY = mc.scaleX;
    addChild(mc);
    addChild(cr);
    tf.text = dts_array[nextImg].src;  
    if (mc.numChildren > 1){
      mc.removeChildAt(0);
    nextImg = (nextImg+1)%img_count;
    function loadError($event:IOErrorEvent):void {
    tf.text = "Loading Data.....Please Stand By..........."; 
    //  Loader Progress
    var swfTF:TextField = new TextField();
    swfTF.autoSize = TextFieldAutoSize.LEFT;
    swfTF.border = false;
    addChild(swfTF);
    //swfTF.text = "srcFile: " + ssxml + " FR: " + swfFrameRate;
    function updateInfo($event:ProgressEvent):void {
    swfTF.text =  "srcFile: " + ssxml + " FR: " + swfFrameRate
         + " Loading: " + img_array[nextImg].src + " "
         + Math.floor($event.bytesLoaded/1024)
         + " KB of "
         + Math.floor($event.bytesTotal/1024)
         + " KB.";

    OK I figured it out.  Apparently, the ENTER_FRAME event continues firing even as the image loader is processing.  Outside the firewall, where it was taking longer to load the images, this was causing loadInitialImage() to request the same image over and over again which resulted in the port behavior I was seeing on the server as well as the client "locking up".  The simple fix was to add a variable called currentImg (initialized to -1) which I set equal nextImg in loadInitialImage().  I then modified the if statement in enterFrameHandler() to only call loadInitialImage() if nextImg != currentImage.

  • How do I open multiple 'windows' in Entourage?

    I am using MS Entourage and would like to be able to open multiple windows within that program. For example, I would like to have both my calendar and address book opened at the same time in different windows. I have looked all over for a way to do this, but I have not had any luck. Any ideas? Please forgive me if this is an easy answer. I am still new to the Mac world, but love it so far. Thank you.

    At the Entourage menu bar, go to File > New and select Open New Main Window. You can open an additional two main windows and select the Address Book for one and the Calendar for the other.
    To navigate to a different window, at the menu bar go to Window and select Mail, Address Book or Calendar.
    The Mail.app does not incorporate all 3 applications. You can have the Mail.app, Address Book and iCal launched and running and select between each from the Dock along with other ways to do so. The Mail.app also includes an Address Book panel to view all Address Book contacts or to select from when addressing a message. You can't add to, delete or edit contacts from the Mail.app Address Book panel.

  • Can I open a port range in the firewall for one host?

    Can I open a port range in the firewall for one host?  In other words, I want to be able to open ports 54001 to 54050 to allow one remote host in my LAN to access that port range in my Mac Server.  Is this possible?  Currently, the only option I see is to open individual ports for all external hosts (eg http or https)
    Thanks in advance!

    Which version of OS X Server are you using?
    Server 2.2 and earlier includes an interface to a software firewall that can be configured to open specific ports very easily. Descriptions of how to configure the firewall can be found in the documentation for these versions.
    Server 3.x no longer has an interface to the software firewall - it is still there, but you need to use other methods do configure it.  A popular example of such a method is the icefloor utility.
    Apple suggest that for Server 3 you delegate firewall duties to an external router.  Server 3 includes the ability to configure the firewall component of Apple Airport routers 'automatically'
    if you connect a machine running Server 3 directly to an Airport Router the router appears in the LH pane in the Server.app window (usually second line, below the entry for the server itself), and you can control what services are 'enabled' through the firewall there.
    a more common solution perhaps is to use a non-apple router, and configure the firewall (and so open specific ports) through whatever control interface is provided for that router.  There are many many kinds of hardware router you could use, and the control interfaces used vary widely - so you will have to consulting the documentation for your own router to work out how to do this.
    If you post information about your software versions, and hardware configuration, it is possible that you can get more specific help with the tasks involved in opening the ports.
    Hope this helps.

  • Accessing Photos Through Other Programs

    Hopefully this is not a stupid question and that it actually makes sense. I recently updated my iphoto library. Yesterday a photo was sent to me through messenger on my iphone. I saved that photo to my phone and then imported it into my computer. Since it's a picture of my relatives and not of me, I don't feel comfortable uploading it to social media and wanted to just share it directly with a friend through skype. However, I find that when I try to locate a file within my mac so that I can upload it to sites and programs of my choosing, I can no longer access my photo library. Oh, I can find the photo library, but it's not accessible from other programs. I don't want to import the photo through iphoto into mail, messages, airdrop, twitter, facebook, linkedin, vimeo, flickr, 'add to photos', or add to aperture or any of the other options. It's my photo so I should be able to do whatever I want with it.
    So, my question is: how in the world do I access the file itself, and send it to somewhere not on the sharing list? And specifically, can I access that file and do anything with it from outside iphoto at all?

    The drag and drop portion of that does work.
    Although I will admit that the accessing them through the 'media' and 'photos' thing when you try to open a file through other programs 100% is no longer an option. The only thing you'll find in there is photo booth. Also the 'Select one of the affected photos in the iPhoto Window and go File -> Reveal in Finder -> Original. A Finder window will pop open with the file already selected.' is no longer an option. I don't know about the other options because I didn't try. But so far in order to just be able to access the file however I want to, dragging and dropping it to the desktop is the only thing I've found that works.

  • Tansfer files through socket

    Hi all
    Can anyone tell me that how can i send files from server to the client through socket programming.
    if u recommend to send file using
    int read(byte[] b, int offset, int blength)
    void write( byte[] b, int offset, int blength) then how plz tell me how can use these methods to send a receive files??? if u give a small example code then i will very greatful to u.
    Usman

    Thanks for ur help.
    but i have got it. i have designed a client and server. Client requests the server to send a specif file (Client takes the path of file from user). And server sends the file to the client.
    I have checked this program on many files. like *.exe, *.txt, *.dat, *.zip, *.mp3, *.jpg.
    it worked smoothly. I have test to trasfer a file of 700MB and it worked correctly.
    Ooops! i did not check it on Network. i run these program on my own computer. both client and server were running on same computer.
    but i am facing a little problem. that is: the speed of trasfering the files is very slow.
    any1 know how to increase the speed of data transfer over the sockets ???
    And plz tell me how can i trasfer a complete directory just as i trasfered file over the sockets. (Remember: a dircetory may or may not contains may other files and also other directories
    thanks in advance...!!!
    here is the code:
    *          CLIENT            *
    import java.net.*;
    import java.io.*;
    public class TransferClient
        public static void main(String[] args)
            try
                 int fileSize = 0;
                 int readBytes = 0;     
                 final int BUFFER_SIZE = 512;
                 byte[] buffer = new byte[BUFFER_SIZE];       
                   Socket sockClient = new Socket(InetAddress.getLocalHost(),2000);     
                   DataInputStream dataInputStream = new DataInputStream(sockClient.getInputStream());
                   BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream("filename.ext"));
                   BufferedReader inputUser   = new BufferedReader(new InputStreamReader(System.in)); //For User input
                   PrintWriter output = new PrintWriter (sockClient.getOutputStream(), true);     //To send the user input to the server
                   //get path from user
                   System.out.print("Enter the complete path of file: ");
                   String path = inputUser.readLine();
                   //send path to server
                   output.println(path);
                   readBytes = dataInputStream.readInt();
                   while(readBytes > 0)
                        readBytes = dataInputStream.read(buffer, 0, readBytes);
                        fileSize = fileSize + readBytes;
                        bufferedOutputStream.write(buffer, 0, readBytes);
                        readBytes = dataInputStream.readInt();
                   }//end while
                   bufferedOutputStream.flush();
                   System.out.println("Received Bytes:  " + fileSize);
                   dataInputStream.close();
                   bufferedOutputStream.close();                              
                   inputUser.close();
                   output.close();
                   sockClient.close();
            }//end try
            catch(IOException ioException)
                 ioException.printStackTrace();
            }//end catch
        }//end main()
    }//end class TransferClient
    *          SERVER            *
    import java.io.*;
    import java.net.*;
    public class TransferServer
        public static void main(String[] args)
             int fileSize = 0;         
             int readBytes = 0;
             final int BUFFER_SIZE = 512;
             byte[] buffer = new byte[BUFFER_SIZE];
             try
                  ServerSocket ss = new ServerSocket(2000);
                  System.out.println("Server Strarts...");
                  Socket sock = ss.accept();
                  BufferedReader clientInput = new BufferedReader(new InputStreamReader (sock.getInputStream()));
                   DataOutputStream dataOutputStream = new DataOutputStream(sock.getOutputStream());
                   PrintWriter output = new PrintWriter(sock.getOutputStream(), true);
                   System.out.println ("Connection Received");          
                   String path = clientInput.readLine();               
                   File f = new File(path);                    
                   if( f.exists() )
                        BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(path));               
                        while((readBytes = bufferedInputStream.read(buffer))!= -1)
                             fileSize = fileSize + readBytes;
                             dataOutputStream.writeInt(readBytes);
                             dataOutputStream.write(buffer, 0, readBytes); 
                        }//end while
                        dataOutputStream.writeInt(0);          
                        System.out.println("Sent Bytes:  " + fileSize);
                        bufferedInputStream.close();
                   }//end if
                   clientInput.close();
                   dataOutputStream.close();
             }//end try
             //catch(FileNotFoundException fileNotFoundException)
             //     output.println("Sorry! file does not exist.");
             catch(IOException ioException)
                  ioException.printStackTrace();
             }//end catch       
        }//end main()
    }//end class TransferServer

  • Problem: Socket connection is not creating in machine, through utility program (MFC Dll), on ListDisplay service port - 3334 (on separate machine), while we are able to telnet on same ListDisplay service port - 3334 from same issue machine on same time

    Problem: Socket
    connection is not creating in machine, through utility program (MFC Dll), on ListDisplay service port - 3334 (on separate machine), while we are able to telnet on same ListDisplay service port - 3334 from same issue machine on same time
    Environment: -
    OS:
    Windows XP SP2/7
    Code:
    VC 6.0
    Dll: MFC
    Problem Description: -
    We have written a utility program which create socket (Using windows standard method [MFC]), and then make connection with another service (List Display) running
    on port 3334 in different machine and retrieve the required list data. This program was working fine in almost all the machines.
    But, we have received a severe intermittent issue on two machines. Client is facing issue in displaying the list data from port 3334.
    Attempt: -
    First we tried to debug code, and we come to know that socket is not creating in utility program. So we tried to telnet on ListDisplay service port 3334 and we were surprised that we were able to telnet, then we opened some more
    telnet window on same port 3334 around (6 to 8) window, and each cmd connected properly. But we were not able to create socket from utility program.
    Problem is severe because issue is intermittent.
    We have tried all the way, but we are not able to figure it out, that what can be the exact problem and what are the conditions, when utility program will not
    connect with ListDisplay service on port 3334.
    Kindly assist to resolve this issue. For any help, we would be really thankful.

    Hi,
    According to your description, it seems that you have created an utility program which is making connection with another service port 3334, however, two clients are facing issue in display the data list from port 3334.
    Port: 3334/TCP
    3334/TCP - Known port assignments (1 record found)
    Service
    Details
    Source
    directv-web
    Direct TV Webcasting
    IANA
    Since the port 3334 is used by directv-web service, I'd like to suggest check this service it is working well on the problematic clients.
    1. The client can be resolved in DNS well? Please run "nslookup" in the prompt command.
    2. Is there any 3rd party application interrupting? Do test in clean boot.
    2. Strongly suggest you run process monitor tool to analysis it.
    I am looking forward to your reply if you have any updated on your side.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • While open socket,why JDK1.4.2 open additional port byt JDK 1.4.1 do not?

    Dear All:
    I am programming swing client project
    I found an interesting difference betwen JDK1.4.1 & JDK1.4.2
    While open socket to server ,jdk1.4.2 stub in server will open random port to the "request" client
    (see below)
    ==============================
    client ----------port:7001---------->ejb server JDK1.4.2
    <--------port : ? (random)--
    =================================
    but in jdk1.4.1 ,only
    ====================================
    client ----------port:7001---------->ejb server JDK1.4.1
    ======================================
    This phenomenon ,confuesed me these days.Have any parameter to fix the socket connection rule for the latter JDK version?
    Best Regards
    john

    There's not enough info there: there should be a local and a remote port number per connection; but it's not possible the way you describe it. It's probably another connection from the client to the server, maybe for DGC?

  • Report toolkit opening multiple spreadsheets after program runs

    I have a program that generates multiple spreadsheets through the Report Gen Toolkit. After I generate ~4-5 files if I go to open any of them up all of the files open up instead of just the one I clicked on. Is there anyway to prevent this from happening when I create the files?

    Is the reference to the excel sheets still open? I had a similar problem to the one you are seeing and I could get rid of it 2 different ways. The first is to make sure LabVIEW is entirely shut down. The second is to make sure you close the spreadsheets or dispose of the reference. These are workbooks that are essentially open in the background, so when you open excel they will show. Try either closing labview or the references to see if this helps your problem. Posting your code would also help.

  • Open multiple indd docs through SDK

    Hi guys
    How can I open multiple indesign documents found in a folder chosen
    through a folder chooser?
    I need to open each indesign doc in that folder and do some
    modification on each.
    Here is what I have already written. Now how do I proceed please
    SDKFolderChooser folderChooser;
    folderChooser.SetTitle("Select folder where Indesign Docs are");
    folderChooser.ShowDialog();
    if (!folderChooser.IsChosen())
    break; // cancelled
    IDFile inFolder = folderChooser.GetIDFile();
    PMString inFolderPath = folderChooser.GetPath();
    if (inFolderPath.IsEmpty())
    break;
    //Now open loop through each file and do some processing on each one at a time
    Logically I just have to loop through all the files in that folder,
    open them and do my processing but I just cant find the right snippets
    anywhere. I guess its pretty easy for u guys but am real new at that
    and just cant find any examples anywhere.
    Thanks for your help
    Alicia

    Hi Alicia!
    You can use the FileSystemIterator to go through all the files in a folder. See the paneltreeview sdk sample plug-in for example code for this.
    Basically you probably want something like this:
        PlatformFileSystemIterator iter;
        iter.SetStartingPath(inFolderPath);
        IDFile idFile;
        PMString filter("\\*.indd");
        bool16 hasNext = iter.FindFirstFile(idFile, filter);
        SDKLayoutHelper helper;
        if (FileUtils::DoesFileExist(idFile))
          do
              UIDRef docRef(helper.OpenDocument(idFile));
              ASSERT(docRef);
              helper.OpenLayoutWindow(docRef);
              hasNext = iter.FindNextFile(idFile);
          while (hasNext);
    Good luck!
    Oh, you need to include the actual implementations of PlatformFileSystemIterator and SDKLayoutHelper to your project so they are compiled into the plug-in, as they arent part of the InDesign runtime libs.
    /Andreas

Maybe you are looking for

  • Safari wont open after 8.0.2 update

    This is what I get when I try to launch Safari after the 8.0.2 update - has anyone else experienced this? Process:           Safari [901] Path:              /Applications/Safari.app/Contents/MacOS/Safari Identifier:        com.apple.Safari Version:  

  • HT1386 Sync'g up iPhone 5S for the first with iTunes library.  I plug in my phone, iTunes open but devise will not appear in iTunes.  Help?

    Would like to set up my new iPhone 5S to existing iTunes library.  However, when I plug the phone into my computer the phone doesn't appear as a device on iTunes.  Downloaded the latest iTunes version.  Any thoughts?

  • Doubt in pf status..its urgent

    hi all      Can anyone help me out in copying the selected and displaying it in next screen.In my PF status COPY button is not working but back is working..here is my code.. *& Report  ZSUB REPORT  ZSUB. tables : vbpa,vbrk,vbrp. type-pools : slis,ico

  • I have added a page to my document.

    and now I am trying to move it into the order I need it to be but no matter where I move it, Pages automatically adds another page that is linked to the one I created and I do not need it.  When I try and delete that extra page it deletes both. HELP!

  • Best Practice for mail connectors

    I am setting up connectors for exchange and groupwise and am testing auto-provisioning. I am running into an issue with groupwise where the GroupWise connector attempts to provision before the E-Directory account is established. Is there a best pract