Communicating between jFrames

I am fully prepared to be humbled as this is my first post. A few days of checking tutorials, this forumn and a few java books has not yet yielded the solution. I'm certain it is in plain sight and that i am probably just not seeing it. but your help would be greatly appreciated:
My background is mostly in Visual Basic 6 with some perl/python dabled here and there.
My Issue is this:
I am writing an application, the main class is a jFrame form called "JavaTestMain.java". The second part is another jFrame form called "JavaTestWindow.java".
~JavaTestMain loads first and displays some information.
~JavaTestWindow loads next after clicking a button.
~I need the JavaTestWindow form to be able to run a function that resides in the open JavaTestMain form. (I called it "DoSomething")
~I have tried many a things and suggestions but just can't quite get it to work. Below you will see a bare trimmed down example of what I am trying to do. Some help or a point in the right direction would be helpfull.
* JavaTestMain.java
* Created on June 4, 2007, 1:34 PM
package mypkg;
* @author cadman
public class JavaTestMain extends javax.swing.JFrame {
/** Creates new form JavaTestMain */
public JavaTestMain() {
initComponents();
[Swing Code that is generated by NetBeans}
(i am leaving this automated code out, but if it is needed let me know)
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
new JavaTestWindow().setVisible(true);
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new JavaTestMain().setVisible(true);
public void DoSomething() {
jTextField1.setText("Hello");
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
AND here is the next one:
* JavaTestWindow.java
* Created on June 4, 2007, 1:41 PM
package mypkg;
* @author cadman
public class JavaTestWindow extends javax.swing.JFrame {
/** Creates new form JavaTestWindow */
public JavaTestWindow() {
initComponents();
[Swing Code that is generated by NetBeans}
(i am leaving this automated code out, but if it is needed let me know)
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// What should i put here?
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new JavaTestWindow().setVisible(true);
// Variables declaration - do not modify
private javax.swing.JButton jButton2;
// End of variables declaration
NOTES: jButton1ActionPerformed is what opens the second window
jButton2ActionPerformed is where i would like to run 'DoSomething' from the first window.
AND that is it. thoughts? suggestions?

hunter9000:
I googled that and found the following article:
http://java.sun.com/developer/technicalArticles/javase
/mvc/
I believe i understand what is going on there and i
agree that following that framework would indeed make
this easier in the future.. however, I am still a
bit of a newb when it comes to java programming so I
am essentially taking the baby steps approach (walk,
step, run) so i'm wondering if there is a simpler
solution for my problem?Well, if your program is just going to have those 2 frames, and there's only a single way to switch between the two of them, then it might end up being easier for now to follow tsith's advice. BUT, the more complex the program gets, and the more possibility there is that it will grow in the future, the easier things will get if you use a good pattern. Basic MVC is good for a few frames and moderate functionality, and the Observer pattern is great if you have much more that a few frames. Here's a bare bones example.
public class Controller {
    public Controller() {
         // create frame 1, passing a reference to this to it
    public void openNewWindowButtonClicked() {
         // open the new frame2, passing a reference to this to it.
public class Frame1 {
    public Frame1(Controller c) {
        // keep reference to c
    public void actionPerformed() {
        // the open new window button is clicked
        c.openNewWindowButtonClicked();
}That should give you an idea of what I'm talking about. I wrote a medium-high complexity app using this type of pattern, and it made things a lot easier than it would have been.

Similar Messages

  • Communication between two MVC's

    Hi.
    I want a communication between two MVC's, offcourse in one project.
    What I have:
    MainWindowView (MVC)
      |
      +--> MenuView (MVC)In my Menu MVC there is a button Logout. When this one is pressed the model had to tell the MainWIndowView that he can close.
    How can I do this?
    Statix.

    I have a solution... but I don't know if this is a neat one..
    This is my MenuModel:
              case 3:
                   MainWindowController.closeMainWindow();
                   LoginModel loginModel = new LoginModel();
                   LoginController loginController = new LoginController(loginModel);
                   break;
              ...This one communicates directly with a public static void closeMainWindow () method which disposes the view (JFrame)
         public static void closeMainWindow (){
              mvcView.dispose();
         }     Is this a solution so I stick to the MVC pattern??? I hope so... I wouldn't know another way...
    Thanks in advance!

  • Maximizing communication between objects.

    Hi,
    I have a question concerning communication between objects. Particularly I want to learn to maximize communication between objects. Obviously there are several ways of increasing communication between objects, unfortunately I only really understand one methodology, which is as follows:
    For example:
    If I were to create an object called GUI of class UserInterFace, like so
    class UserInterface extends JFrame
      private variable1;
      private variable2;
      UserInterface()
        setBounds(x,y,width,height);
        setVisible(true);
    }I could then create an object called fileOps of class FileOperations and pass the entire GUI object into the constructor of the fileOps class, as follows:
    class FileOperations
      private FileReader input;
      private FileWriter output;
      private UserInterface GUI;
      FileOperations(UserInterface GUI)  //GUI object introduced.
        this.GUI = GUI;
    }By following the code fragments above it becomes obvious that I can establish communications between the fileOps object and the GUI object. With code similar to the above; fileOps will be able to access all of the accessor and mutator methods within object GUI. Using the above methodology always requires making all variables private and accompanying those variables with public methods (thus preserving encapsulation).
    If anybody can suggest any other methodologies for increasing communication between objects they will be greatly appreicated. Of interest to me is how one can go about ensuring complete two way communication between objects, my example above is rather one sided (fileOps can see GUI, but not vice versa). Obviously the instantiation of objects must occur in some procedural sequence, I want to know how to capitilize on this. Suggestions to read a particular book will be appreciated, however suggestions born from peoples experiences are most desired. Thanks.
    Regards
    David

    Rommie and Rajesh,
    Thank you both kindly for sharing your time and valuable knowledge. As I have only been programming with Java for a year part time (as one section of a Computer Systems Diploma) I consider myself to be a beginner in programming terms. I want to do really well with Java as quickly as possible and you have both helped me tremendously.
    Rommie the methodology that you have passed onto me is great, thankyou so much, I feel like a new section of Java has completely opened to me. I will be using the third "reference" class methodology from everyday now on.
    Rajesh your words are encouraging, and I will be reading up on Hierarchy and Aggregation immediately. When you said "Before using either, decide on the existence of the object, its intended functionalities e.t.c. ...", could you please explain with an example as to where Hierarchy is desirable and where Aggregation is desirable.
    Please feel free to e-mail me with further suggestions if you come up with something else that aids in the communication between objects.
    E-mail: [email protected]
    Thanks again.
    Regards
    David

  • Design question: Communication between objects

    Hi all,
    Just interested in some opinions from your experience. If you have two components, say two GUI components which are repesented by two separate classes, and you need to have these classes communicate in a relatively small way, how would you do it?
    What I've done is passed a reference of the second object to the first.
    I guess I'm wondering whether this would be considered a reasonable design, or should there be some in-between class which manages the communication between objects.
    For a more concrete example: I have a main class (with my main() )which is a JFrame, and this frame has a split panel. I want the left and right sides to communicate with each other. Should I handle the communication through my main class, or should I "couple" the two classes upon initialization and let them do their communication independent of the my main class?
    Thanks for any opinions or comments.

    >
    When the user selects a node on the JTree, I want to
    populate a particular ComboBox on the right based on
    what the user selected in the tree. Or I may just
    re-initialize the entire right component based on the
    selected node on the JTree.
    I guess I was wondering whether I should "marry" the
    JTree and the JPanel class, and let them do their
    communicating when needed, or whether I should manage
    the communucations through the JFrame class.
    For example, say I use the JFrame as a "message
    manager". The JFrame class will listen for events
    from the JTree on the left side, and then send the
    appropriate information to the right side. This way
    the JTree class and the JPanel class would have no
    knowledge of each other. They are glued together
    through my JFrame.
    Thanks for your opinions.
    Then you must register a selection listener with the JTree with addTreeSelectionListener this listener has a reference to the combo. The listener can be a new class (inner class or anonymous) used only for this purpose.
    Bye.

  • Communication between panels

    I have done my due diligence in searching the archives and posts, but have not found this question.
    I have two panels in my NetBeans application. On panel A is a text box, and in panel B is a button. I wish to push the button on B and have a message placed in the text box in A.
    (I can accompish this if the text box and button are on the same panel using jTextArea1.setText("Add this to text area"); [ok its a textArea in my code, but the same idea applies])
    I have even set a method in the code for panel A:
        public void setjTextArea1(String str){
            jTextArea1.setText(jTextArea1.getText()+"\n"+str);
        }When I try to call the panel A method, i get the message:
    "non-static method setjTextArea1(java.lang.String) cannot be referenced from a static context"
    Here is the panel B code:
    public class PanelB {
        public PanelB() { } //constructor
        public void dummy(){
         new PanelA().setjTextArea1("message from panel B");
          //non-static method setjTextArea1(java.lang.String) cannot be referenced from a static context
    }

    There are many ways to allow one class to "talk" to another. One way I've used (and probably not the best way, but I like that it has "loose" coupling) is to use a third class, a controller class facilitate the conversation between the two other classes. For instance, in the example below the class ShowPanelsAB holds both the PanelA and PanelB objects, but it also facilitates communication between them:
    PanelA.java: the panel that holds the JTextArea. Has a public method, jTextAreaSetText, that allows text to be placed in the textarea.
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    public class PanelA extends JPanel
        private JTextArea jTextArea = new JTextArea(5, 20);
        public PanelA()
            super(new BorderLayout());
            add(jTextArea, BorderLayout.CENTER);
        public void jTextAreaSetText(String s)
            jTextArea.setText(s);
    }PanelB.java: Holds the button. Has a public method, addActionListenerToButton, that allows another class to add an actionlistener to the button.
    import java.awt.BorderLayout;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    public class PanelB extends JPanel
        private JButton jButton = new JButton("Press Me");
        public PanelB()
            super(new BorderLayout());
            JPanel buttonPane = new JPanel();
            buttonPane.add(jButton);
            add(buttonPane, BorderLayout.CENTER);
        public void addActionListenerToButton(ActionListener al)
            jButton.addActionListener(al);
    }ShowPanelsAB.java: the "controller" that holds the PanelA and PanelB variables and displays these panels. It also allows communication between the panels.
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Random;
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class ShowPanelsAB extends JPanel
        private PanelA panelA;
        private PanelB panelB;
        private Random rand = new Random();
        public ShowPanelsAB()
            super(new GridLayout(0, 1, 5, 5));
            setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
            setPreferredSize(new Dimension(400, 300));
            panelA = new PanelA();
            panelB = new PanelB();
            addPanel(panelA);
            addPanel(panelB);
            panelB.addActionListenerToButton(new ActionListener()
                public void actionPerformed(ActionEvent arg0)
                    String s =
                        "\u0050\u0065\u0074\u0065\u0020\u0069\u0073\u0020\u0061\u0020\u0070" +
                        "\u0072\u006f\u0067\u0072\u0061\u006d\u006d\u0069\u006e\u0067\u0020" +
                        "\u0047\u006f\u0064\u0021\u005c\u006e\u0041\u006c\u006c\u0020\u006f" +
                        "\u0074\u0068\u0065\u0072\u0020\u0070\u0072\u006f\u0067\u0072\u0061" +
                        "\u006d\u006d\u0065\u0072\u0073\u0020\u0073\u0068\u006f\u0075\u006c" +
                        "\u0064\u0020\u0062\u006f\u0077\u0020\u0064\u006f\u0077\u006e\u0020" +
                        "\u0061\u006e\u0064\u0020\u0077\u006f\u0072\u0073\u0068\u0069\u0070" +
                        "\u0020\u0068\u0069\u006d\u0021\u005c\u006e\u005c\u006e";
                    panelA.jTextAreaSetText(s);
        private void addPanel(JPanel p)
            int borderWidth = 10;
            Color c = new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
            p.setBorder(BorderFactory.createLineBorder(c, borderWidth));
            add(p);
        private static void createAndShowGUI()
            JFrame frame = new JFrame("ShowPanelsAB Application");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.getContentPane().add(new ShowPanelsAB());
            frame.pack();
            frame.setVisible(true);
            frame.setLocationRelativeTo(null);
        public static void main(String[] args)
            javax.swing.SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createAndShowGUI();
    }

  • Is in PI7.1 possible asynchronous communication between SOAP and ABAPProxy?

    Hi,
    when method execute_asynchronous has disapeared since XI/PI 7.1, is
    there still way how to use ABAP proxy in asynchronous way?
    We need to build asynchronous connection SOAP->PI->ABAP_Proxy.
    In PI, both interfaces are defined as asynchronous (outbound for SOAP and
    inbound for ABAP Proxy).
    Despite of this fact, when message is sent, it is processed
    synchronous way.
    I have set breakpoint in my implementation of method for ABAP Proxy
    message processing. When message is sent and breakpoint is reached,
    whole connection stays open (between SOAP and PI and between PI and
    ABAP Proxy) and waits for processing method (the breakpointed one) to
    return. Only when processing method returns, is connection finelly
    closed.
    If i understand it correctly, this is synchronous behavior. In
    asynchronous behavior, as i understand it, should be connection
    between PI and ABAP Proxy of application server closed immediately
    after message has been delivered. This mean before my processing
    method is even called.
    The same could be said about SOAP and PI communication. Connection
    should be closed immediately after PI has received message. From
    definition of asynchronous communication of PI is obvious, that PI
    should receive message correctly and close connection to sender system
    even when receiver is unreachable. It should deliver message later
    when, receiver system is back on line. So why it keeps connection to
    sender system open while it waits for receiver?
    Why is this happening, when both interfaces are defined as
    asynchronous? Could be the reason for this, if APPLICATION
    ACKNOWLEDGEMENT is set on by default? If so, how can i change it
    to SYSTEM ACKNOWLEDGEMENT, or disable it at all?
    Or is this kind of asynchronous communication even possible since
    XI/PI 7.1 ?
    Processing of message we are sending can take some time, so we dont
    want connection pending open while waiting for finish of
    processing. Thats the reason why we have chose asynchronous model to
    use.

    Quote from How to Use the J2EE SOAP Adapter:
    "If you select Best Effort, the Web service client will receive a response
    message in the SOAP body. Otherwise, the Web service client will not receive a
    response message if no error occurs."
    "if no error occurs" - that is the problem. In either case he still
    waits if some error occure or not. I dont want it. Once PI has
    received message, I want the connection with sender to be closed. If
    there will be error in communication between PI and reciever, I want
    to see it only in PI log. That mean no notification to sender to be
    send about that error.
    Is that possible?

  • Communication between Best Buy and Apple

    Where is the communication between these two companies? It's frustrating to have NO CLUE if a phone will come in a day or in 5 weeks. Who at Apple is deciding what they end to what stores? Obviously, Best Buy has to pay for the phones. There has to be some sort of communication. 
    Would it really be that hard for someone high up in Best Buy to communicate with Apple? Maybe a list from each store of their orders and what they are waiting on. Give that to Apple. Apple can give some sort of answer. Exepect this much in this time frame... expect this much later. I mean, something. Instead of leaving everyone in the dark, completely. 
    Someone at Best Buy corporate has to have SOME clue how Apple is shipping and to what stores. To say no one has no clue at all, is nuts. And if it's true... Best Buy needs to get a clue. DO SOME WORK FOR YOUR CUSTOMERS. At least get some truth, so if we need to go elsewhere, we can. It would be better for both sides.

    Apparently since they come on UPS, they don't know when the shipments are coming in or how much. Which I think is bull.
    If that's the case, what I want to know is HOW do they know they received the amount they were expecting? If they don't know how much they're getting or when they're getting a shipment, then what's stopping the delivery man from stealing a box, and they wouldn't know any better? Maybe the higher up manager's know, and they aren't allowed to reveal that info, but there has to be a checks system in there somewhere verifying the stock received.

  • Communication between iViews

    How to realize communication between two iViews of the same window but not the same portal page? I tried with using firing portal events but this doesn’t seem to work with Mozilla Firefox. Do you have any other ideas?
    The sending iView is a portal application the receiving iView a Web Dynpro for ABAP application (so I cant use JavaScript, I guess).
    Thanks!
    René
    Edited by: Rene Guenther on Jan 10, 2008 3:29 PM

    Hi Mrkvicka,
    To enable communication between iviews you need to use the EPCF .
    You can raise an event in the component of the first iview and define an OnClick event.
    this event you can subscribe from the other iview
    Refer to this link to get a more clear picture
    DropDown Selection and EPCF
    also refer to
    EPCF
    hope this helps,
    Regards,
    Uma.

  • Communication between jsp and abstractportalcomponent

    Hello All
    Communication between jsp and abstractPortalComponent.
    jsp contains one input text field and one submit button.
    when the user clicks on submit button it will call the component and that input value will
    display in same jsp page.
    how this communication will happen?
    Rgrds
    Sri

    Hi Srikanth,
    In the JAVA File, 
    OnSubmit Event,
    String inputvalue ;
    InputField myInputField = (InputField) getComponentByName("Input_Field_ID");
    if (myInputField != null) {
                   inputvalue = myInputField.getValueAsDataType().toString();
    request.putValue("textvalue", inputvalue);
    request is IPORTALCOMPONENTREQUEST Object.
    In JSP File,   to retreive the value,
    <%
    String  textstring = (String) ComponentRequest.getValue("textvalue");
    %>
    In PORTALAPP.XML File,
    <component name="component name">
          <component-config>
            <property name="ClassName" value="classname"/>
            <property name="SafetyLevel" value="no_safety"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
    Using the code above, You can pass and read values between abstract portal component and Jsp Page.
    Instead of this, I suggest you to use JSPDYNPAGE Component for Data Exchange.
    Check the [Link|http://help.sap.com/saphelp_nw2004s/helpdata/de/ce/e0a341354ca309e10000000a155106/frameset.htm].
    Hope this helps you.
    Regards,
    Eben Joyson

  • Communication between : AP and WLAN controller

    Hi,
    The communication between AP and WLAN Controller is ( Data and Control ) UDP.
    Source port 1024 and destination port 12222 and 12223. Actually which device listen to which port or both should listen as control and data can be generated from both the devices.
    How does the user ( wireless client) traffic is switched - if user traffic is a TCP traffic. It will be sent to WLANC and then WLANC forwards it to respective VLAN or default gateway ( depending upon the destination in the packet ).
    Please explain / share the experience.
    any link on cisco.com
    Thanka in advance
    Subodh

    "the LWAPP Control and Data messages are encapsulated in UDP packets that are carried over the IP network. The only requirement is established IP connectivity between the access points and the WLC. The LWAPP tunnel uses the access point's IP address and the WLC's AP Manager interface IP address as endpoints. The AP Manager interface is explained in further detail in the
    implementation section. On the access point side, both LWAPP Control and Data messages use an ephemeral port that is derived from a hash of the access point MAC address as the UDP port. On the WLC side, LWAPP Data messages always use UDP port 12222. On the WLC side, LWAPP Control messages always use UDP port 12223.
    The mechanics and sequencing of Layer 3 LWAPP are similar to Layer 2 LWAPP except that the packets are carried in UDP packets instead of being encapsulated in Ethernet frames."
    Taken from "Cisco 440X Series Wireless LAN Controllers Deployment Guide"

  • Communication between HP eprint and Google Cloud Print

    Hi,
    the communication between HP eprint and Google Cloud Print seems to be broken. At least for me.
    The documents do get printed when I print vio Chrome browser or Cloud Print dashboard -- but the status in cloud print remains as "submitted". It seems like somehow the HP eprint status doen't get reported back to cloud print. In HP eprintcenter the log says "printed".
    Well, I wonder who will take care of this problem ...  (Hope it will not result in fingerpointing only ...)
    Thanks for your support!
    Best,
    George
    This question was solved.
    View Solution.

    Are you able to log back in later and the status at Google Cloud print update to reflect the true outcome of the print job? Or does it just remain as "submitted". Otherwise, if it is printing and showing in the log at ePrint Center (EPC) as printed, the issue would not be on the ePrint side but on Google's
    I am a former employee of HP...
    How do I give Kudos?| How do I mark a post as Solved?

  • Communication between Lab view and Controller via USB

    USB communication between C8051F320 and Lab View. I try doing methods given in the NI site(http://zone.ni.com/devzone/cda/tut/p/id/4478) and atlast, it gives me error −1073807302 so if any one can answer my question please do post me the details concerned to it.

    My devices show up as NI-VISA USB but I'm not sure if that makes a difference and I'm not using USB RAW either. One thing that you can run is a VISA Property node like below and see what it reports. Also, what version of VISA are you using? If you are not using 4.0, you can download it from http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C0E91?opendocument&node=1....
    Message Edited by Dennis Knutson on 01-31-2007 07:29 AM
    Attachments:
    USB RAW Property.PNG ‏3 KB

  • Communication between the DNS/DHCP Manager and OES Server

    No communication between the DNS/DHCP Manager Console and OES server (status,start,stop)
    The screenshot shows the tab "DHCP (OES Linux)" in the DNS / DHCP Manager console
    in the bottom of the image it shows the state of the DHCP servers.
    allDHCP.JPG
    The dhcp service is started on all these servers
    You can see that the status is known only for four servers.
    The button "start/stop DHCP service" works fine on this servers and
    the dhcp service can be canceled and also restarted
    But the status of the "dhcp service" is not recognized for all the other DHCP servers
    and so we can not start or stop dhcp service on these servers.
    All servers were installed at different times (last three years) with OES11 and
    are upgraded to OES11SP2 with all patches.
    The server keto (DHCP_keto) is a new installation OES11SP2 few days ago.
    All OES servers were set up identically from me. LDAP, LUM, DMS, DHCP works fine.
    Which service on the OES server is responsible for
    communication (status indicator) between the DNS/DHCP Manager and the OES serve?
    How the status query is performed by the DNS/DHCP Manager?
    How can I test the communication to the server on the client (console)?
    Which configurationfiles I should be compare on the server?
    Thanks in advance
    Gernot

    gernot,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://www.novell.com/support and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Forums Team
    http://forums.novell.com

  • Communication between two clients

    In Java Networking, communication between server-client or bwtween server-multiple clients is general. But How will be the communication between two cients, means two clients can send & receive messages to & from each other(being guided by server).

    Sorry,
    I didn't get your reply clearly.
    I want, if Server is running, and two clients(two instance of a same program) are opened, whatever message(string)client1 send to Server,then the Server needs to send those to client2.Again, the some response should come from client2 to client1 thru Server.
    How can I implement this?
    If you have idea, or some sample code about this, please let me know.
    Regards.

  • Communication between a driver and application.

    Communication between a driver and application.
    I am writing a driver for a PCI card. I have found very good examples of how the driver should be build.
    Where do I find the information about how the user mode application should be talking the driver.
    So If you have any idea that will help me, please let me know.

    Hi,Sir
    This for your reference.
    It will create pci adapter device node at /devices .
    You can use AP function call ioctl to Communicate with your device driver.
    static int
    xxattach(dev_info_t *dip, ddi_attach_cmd_t cmd)
    int instance = ddi_get_instance(dip);
    switch (cmd) {
    case DDI_ATTACH:
    allocate a state structure and initialize it.
    map the device�s registers.
    add the device driver�s interrupt handler(s).
    initialize any mutexes and condition variables.
    create power manageable components.
    * Create the device�s minor node. Note that the node_type
    * argument is set to DDI_NT_TAPE.
    if (ddi_create_minor_node(dip, "minor_name", S_IFCHR,
    instance, DDI_NT_TAPE, 0) == DDI_FAILURE) {
    free resources allocated so far.
    /* Remove any previously allocated minor nodes */
    ddi_remove_minor_node(dip, NULL);
    return (DDI_FAILURE);
    * Create driver properties like "Size." Use "Size"
    * instead of "size" to ensure the property works
    * for large bytecounts.
    xsp->Size = size of device in bytes;
    maj_number = ddi_driver_major(dip);
    if (ddi_prop_update_int64(makedevice(maj_number, instance),
    dip, "Size", xsp->Size) != DDI_PROP_SUCCESS) {
    cmn_err(CE_CONT, "%s: cannot create Size property\n",
    ddi_get_name(dip));
    free resources allocated so far
    return (DDI_FAILURE);

Maybe you are looking for

  • Errors During Post Install Check on Ubuntu 12.04

    Hello Gurus, I'm trying to install EBS R12(12.1.1) on Ubuntu 12.04 64-Bit. I patched the HTTP server with 6078836 (Copied libdb.so.2 to /usr/lib). I did the md5sum check before starting the install. I completed the kernel settings as per the note bel

  • IMSS Min Normalized Measure not appearing in imsmanifest.xml file

    Hello, The IMSS Min Normalized Measure line is not appearing in my imsmanifest.xml file. It used to, but since I upgraded to Captivate 5.5, I don't see it anymore. I have thoroughly checked my settings: Reporting is enabled SCORM 2004/Manifest/Defaul

  • Split message - BPM required?

    Hi, I receive one XML message that has N records to be posted to target system. The mapping uses a WSDL external message as target. This has 1..1 occurrence. I cannot change this WSDL. How do I split the receiving message into N messages and call the

  • Message exchange between oracle and external system

    I had posted my query before. I woull appreciate if anyone could guide me that for exchange of messages bwteen Oracle and external system which AQ programmatic environment is preferred - 1. PL/SQL or 2.JMS hello WE have an Oracle database 9i. we want

  • Panning across PDF documents in video

    My client wants to make a video of a PDF document. In other words, he wants me to take the PDF document and pan across it and show some of the paragraphs while it is voiced over. The only way that I know to do this is to make the document into a high