Java holiday calculation

This must be Global Crossposting Day.

If you're a good little crossposter, Majinda will come on his eight chickens and leave something for you.

Similar Messages

  • Java Mortgage Calculator

    Im having trouble making my GUI look the way I want it. Obviously I dont know enough about Gridlayout And I think I need to use GridBagLayout instead. I need the amortization schedule to print all the way out and everything to line up. If anyone has some suggestions I would love to hear it, and yes, this is my homework. see the code below:
    Main java file: implements MyFrame4 java file
    import java.awt.*; //imports awt
    public class MortgageCalculator4 {   // main MortgageCalculator class constuctor
    public static void main(String args[]) {  //implements MyFrame4
    Frame f = new MyFrame4();
    } //end of MortgageCalculator4 class
    Adapter java file: implements WindowAdapter
    import java.awt.*; //imports awt
    import java.awt.event.*;
    class MyAdapter extends WindowAdapter {   //creates window adapter
    Frame myFrame;
    MyAdapter(Frame f) {
    super();
    myFrame = f;
    public void windowClosing(WindowEvent e) {
    myFrame.dispose();
    } //end of MyAdapter class
    Frame java file: main body of program implemented by MortgageCalculator file
    import java.awt.*; //imports awt's
    import java.awt.event.*;
    import java.text.DecimalFormat;
    import javax.swing.*;
    class MyFrame4 extends Frame implements TextListener, ActionListener {    //class constructs the frame and layout
    Button loanButton1 = new Button("Loan 1"), //creates and labels buttons
    loanButton2 = new Button("Loan 2"),
    loanButton3 = new Button("Loan 3"),
    clearButton = new Button("clear/New");
    TextField principalField = new TextField("0.00", 15), //sets TextField properties
    rateField = new TextField("0.00", 3), //adds field lenghts and initial properties
    yearsField = new TextField("0", 3),
    paymentField = new TextField("0.00", 15),
    intpaymentTextArea = new TextField("0.00", 40);
    double principal, rate, ratePercent; //assigns variables
    int years, n;
    final int paymentsPerYear = 12;
    final int timesPerYearCalculated = 12;
    double effectiveAnnualRate;
    double payment;      
    public MyFrame4() { //beginnig of frame constructor
    setTitle("Mortgage Payment Calculator");
    setLayout(new GridLayout(14, 2));
    Label title1Label = new Label("Enter loan amount then select a loan option");
    Label title2Label = new Label("or enter an interest rate and years");
    Label principalLabel = new Label("Loan Amount $"), // constructs labels
    rateLabel = new Label("Rate (%)"),
    yearsLabel = new Label("Years"),
    loan1Label = new Label("7 years at 5.35%"), //asigns labels
    loan2Label = new Label("15 years at 5.5%"),
    loan3Label = new Label("30 years at 5.75%%"),
    paymentLabel = new Label("Payment $"),
    intpaymentLabel = new Label("Ammortization Schedule");
    Panel title1LabelPanel = new Panel (new FlowLayout(FlowLayout.RIGHT));
    Panel title2LabelPanel = new Panel (new FlowLayout(FlowLayout.RIGHT));
    Panel principalLabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)), // places label positions and button panels
    loan1LabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
    loan2LabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
    loan3LabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
    rateLabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
    yearsLabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
    paymentLabelPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
    intpaymentLabelPanel = new Panel(new FlowLayout(FlowLayout.CENTER));
    Panel principalFieldPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
    loan1ButtonPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
    loan2ButtonPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
    loan3ButtonPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
    rateFieldPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
    yearsFieldPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
    paymentFieldPanel = new Panel(new FlowLayout(FlowLayout.LEFT)),
    clearButtonPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
    blankPanel = new Panel(new FlowLayout(FlowLayout.RIGHT)),
    intpaymentTextAreaPanel = new Panel(new FlowLayout(FlowLayout.RIGHT));
    title1LabelPanel.add(title1Label);
    title1LabelPanel.add(title2Label);
    principalLabelPanel.add(principalLabel); //adds labels buttons and fields
    principalFieldPanel.add(principalField);
    loan1LabelPanel.add(loan1Label);
    loan1ButtonPanel.add(loanButton1);
    loan2LabelPanel.add(loan2Label);
    loan2ButtonPanel.add(loanButton2);
    loan3LabelPanel.add(loan3Label);
    loan3ButtonPanel.add(loanButton3);
    clearButtonPanel.add(clearButton);
    rateLabelPanel.add(rateLabel);
    rateFieldPanel.add(rateField);
    rateField.setEditable(true);
    yearsLabelPanel.add(yearsLabel);
    yearsFieldPanel.add(yearsField);
    yearsField.setEditable(true);
    paymentLabelPanel.add(paymentLabel);
    paymentFieldPanel.add(paymentField);
    paymentField.setEditable(false);
    intpaymentLabelPanel.add(intpaymentLabel);
    intpaymentTextAreaPanel.add(intpaymentTextArea);
    intpaymentTextArea.setEditable(false);
    add(title1LabelPanel);
    add(title2LabelPanel);
    add(principalLabelPanel);
    add(principalFieldPanel);
    add(loan1LabelPanel);
    add(loan1ButtonPanel);
    add(loan2LabelPanel);
    add(loan2ButtonPanel);
    add(loan3LabelPanel);
    add(loan3ButtonPanel);
    add(rateLabelPanel);
    add(rateFieldPanel);
    add(yearsLabelPanel);
    add(yearsFieldPanel);
    add(paymentLabelPanel);
    add(paymentFieldPanel);
    add(clearButtonPanel);
    add(intpaymentLabelPanel);
    add(blankPanel);
    add(intpaymentTextAreaPanel);
    loanButton1.addActionListener(this); //assigns ActionListener to buttons
    loanButton2.addActionListener(this);
    loanButton3.addActionListener(this);
    clearButton.addActionListener(this);
    principalField.addTextListener(this); //adds TextListener to fields
    rateField.addTextListener(this);
    yearsField.addTextListener(this);
    addWindowListener(new MyAdapter(this));
    pack(); //resizes window to fit components
    setVisible(true);
    DecimalFormat currency = new DecimalFormat("####0.00"); //sets currency format
    public void actionPerformed(ActionEvent e){ //checks for buttons clicked and sets variables to fields
         //wanted to get data from array but couldnt make it work
              if(e.getSource() == loanButton1){
                   rateField.setText("5.85");
                   yearsField.setText("7");
         if(e.getSource() == loanButton2){
                   rateField.setText("5.5");
              yearsField.setText("20");           
              if(e.getSource() == loanButton3){
                   rateField.setText("5.75");
              yearsField.setText("30");     
              if(e.getSource() == clearButton){
                   rateField.setText("0.00");
              yearsField.setText("0");
              principalField.setText("0.00");           
    public void textValueChanged(TextEvent e) {  //checks field variables and sends to calculations
    Object source = e.getSource();
    if (source == principalField
    || source == rateField
    || source == yearsField) {
    try {
    principal = Double.parseDouble(principalField.getText()); //perform calculations for payment
    ratePercent = Double.parseDouble(rateField.getText());
    rate = ratePercent / 100.0;
    years = Integer.parseInt(yearsField.getText());
    n = paymentsPerYear * years;
    effectiveAnnualRate = rate / paymentsPerYear;
    payment =
    principal
    * (effectiveAnnualRate
    / (1 - Math.pow(1 + effectiveAnnualRate, -n)));
    DecimalFormat payForm = new DecimalFormat("####.##"); //performs calculations for Ammortization text area
    int num_Months = years*12;     
    double i = ratePercent/1200;
    payment = principal*((i*(Math.pow((1+i),num_Months)))/((Math.pow((1+i),num_Months))-1));               
    int num_Payments = num_Months-1;
    int month_counter = 0;
    double intPaid = 0;
    double balance = principal;
    intpaymentTextArea.setText("");
    while (month_counter <= num_Months){
    intPaid = balance * i;
    balance = balance - (payment - intPaid);
    intpaymentTextArea.setText(("Month ")+month_counter+( " - Payment: $")
    payForm.format(payment)" Balance: "
    payForm.format(balance)(" Interest Paid: $")
    payForm.format(intPaid)"\n");
    month_counter++;
    paymentField.setText(currency.format(payment)); //display payment
    } catch (NumberFormatException ex) {  //catch exceptions
    } //end of MyFrame4 Class

    Another suggestion is post only the necessary code that exemplifies the unexpected behavior, and don't forget to use code tags when you're posting code. Look for CODE button when writing the post! This way your code will be well formatted and more readable. It also increases the chance of someone reading it and help you.

  • Java number calculation.

    hi, i am doing java encryption/decryption and my key is 128 bits. i need to times multiple keys and thus, the value is far exceed the integer and long value.
    thus i decide to use math.biginteger.
    however, the calculation is weird.
    here is my code
    BigInteger biPdi = new BigInteger(bPdi); //bPdi is a bytearray
    BigInteger biKey = new BigInteger(groupKey);//group key is a bytearray
    BigInteger bicKey = new BigInteger(bicGroupKey));//bicgroupkey is a bytearray
    System.out.println("derivationkey: " + biPdi.toString(16));
    System.out.println("child group key: " + bicKey.toString(16));
    b = biPdi.add(bicKey).toByteArray();     
    BigInteger bit2 = new BigInteger(b);
    System.out.println("derivationkey: " + bit2.toString(16));
    this is the result i am getting back.
    derivationkey: 30
    child group key: 3938393951128f27c3da559f36ea62de
    derivationkey: 3938393951128f27c3da559f36ea630e
    i know the derivationkey has value "0" which is encode as "30" b/c it is based on 16. thus, the byte value is "48" which is the value of "0".
    when i add derviationkey with child group key, i expect to my new diviationkey is same as childgroup key b/c it is childgroup plus 0. however, i am getting a different value. i think the reason is because java byte array try to add 30 to childgroup.
    in this case, how can i do a large number calculation? can someone give me any advice??
    Thanks in advance.

    There's a button what says "code." Hit it and put your code inside the tags.
    i know the derivationkey has value "0" which is
    encode as "30" b/c it is based on 16. thus, the byte
    value is "48" which is the value of "0".0 is zero no matter what the base. And 48 != 0 no matter how much paint you sniff (though it can seem that way).
    when i add derviationkey with child group key, i
    expect to my new diviationkey is same as childgroup
    key b/c it is childgroup plus 0. however, i am
    getting a different value. i think the reason is
    because java byte array try to add 30 to childgroup.If it's 30 and you add it, the answer will come out as 30 more than the number you added to 30.
    in this case, how can i do a large number
    calculation? can someone give me any advice??BigInteger works like it should. derivationkey is 30.
    ~Cheers

  • Java variables calculation on change in JSP (Excel replica)

    I have a excel sheet that I need to replicate in JSP (using struts 1 framework). Now everything is done but I am stuck at the calculation part. As you might have seen in excel, some columns are calculations based on other columns.
    So if I change field 'a', 'd' field should change automatically based on its formula (let's say, d=a*1.1 +b*2.1).
    Now I tried to use the funstion in javascript where I read 'a' and 'b' values from JSP, then I calculate and everything works fine. But when I try to assign the calculation result for field 'd' in JSP throush javascript, 'd' does not change.
    function adjustCalcs ()
    var a = eval("document.form.al.value");
    var b = eval("document.form.b.value");
    var dCalc = ((a * 1.05) + (b * 1.1));
    document.form.d.value = dCalc ; (this is where it should change the value of field 'd' in JSP, but ti won't...donno why?)
    Or is there any better way to do these dynamic changes in JSP ? Would appreciate the insight.
    Thanks,

    Fine. What's your problem in JSP side then? Do you want to let Java take over the calculation and "dynamic stuff" ? Then you need to let Javascript submit the form to the server side during the change event so that JSP can then display the result using taglibs/EL. But this is less good for user experience as this costs effectively one HTTP request and the user would see a "flash of content". Alternatively you can use Ajax for this to do it all asynchronously.

  • Java Memory Calculation

    Dear all,
    I have class
    Student{
    private int id;
    And my program, init array 10000000 student object.
    size = 10000000;
    Student[] sts = new Student[size];
    for(int i = 0; i< size; i++){
    sts[i] = new Student();
    Learning from
    http://www.javamex.com/tutorials/memory/object_memory_usage.shtml
    and
    http://www.javamex.com/tutorials/memory/array_memory_usage.shtml
    I calculation the memory usage for my programe is
    - 8: house keeping
    - 4 leng
    - size * 4 (object reference)
    - Each Student object size take (8 byte house keeping + 4 byte for id) = 12, padding 4 => 16 byte
    So the total memory is 8 + 4 + 4*size + 16*size = 20*size + 12 ~ 190M
    But the momory usage for my program is 277MB. That is the large difference.
    Could you give me some advice?
    Thank a lot for support.

    Helo..
    Using Windows Task manager is not the proper way to measure a Java programs Memory usage.
    Reason:When you run a java program ,it also requires the underlying JRE to run ,so the memory used for a java process in this case would be the memory for the Java programs Objects and also for the entire JRE.
    The Best way to measure your application's performance is use either of the two free tools:
    1.JConsole-its comes along with JDK. JDK_HOME/bin/jconsole
    2.Any Profiler Programs:A profiler for Java is a program which allows you to trace a running java program and see the memory and CPU consumption for the Java application.Netbeans comes with its own profiler.you can chk this out.
    The other option is to measure free memory before and after execution of the program using System Util Class.
    Hope this clarifies your qn.
    Thanks.

  • Java Double calculations produce greater error than C++?

    I wrote PLU (A=PLU) decomposition program in Java to solve Ax=B. A, P,L and U are square arrays. x and B are vectors. The error was great for large matrices.My instructor suggested me to use C++. So, I wrote the same thing in C++. The error is much less now. The code is almost identical. I thought that both languages use the same IEEE standard.
    Is it possible that java handles double calculations worse than C++ does?

    tmirzoev wrote:
    matrix A and B are known. So, after my program computes x, I do Ax-B. Ideally, Ax-B=0. But that never happens because of the errors in floating point calculations. The problem that in Java that error Ax-b is much greater than in C++.Okay, but how do you know that Ax-b is greater in Java? Show your Java code and your C++ code.

  • Holiday Calculation

    Is it possible to take into consideration Holidays when doing a TimeStampDiff in reporting?

    Hi,
    No, you cannot take into consideration holidays unfortunately. You can do working/non-working days based on weekends. Run a search in the forum for working days and you'll find the threads.
    Thanks
    Oli @ Innoveer

  • Java simple calculation involving double

    *public static void main(String[] args) {*
    System.out.println("Output "+300.025d100.0);*
    The above code is returning me 30002.499999999996 though I was expecting 30002.5

    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    public class Test {
    NumberFormat f = new DecimalFormat("0.0");
    System.out.println("Output "+new Float(f.format(300.025d*100.0)));
    }

  • Java algorithm calculation

    At first, I want to get the distance calculation from Damansara and Punchong. Below is the x, y position in graph (map)
    /** Calculate the direct distance between 2 cities**/
    * @param from the first city*
         * @param to the second city*
         * @return the distance between them*
    *private double calculateDistance(City from, City to) {*
    double xDiffSqr = ( from.x - to.x ) * ( from.x - to.x );
    double yDiffSqr = ( from.y - to.y ) * ( from.y - to.y );
    return Math.sqrt(xDiffSqr + yDiffSqr);
    Base on the calculation I apply to this answer�
    Damansara� 288 - 39
    Puchong � 216 - 390
    Formula calculation
    xDiffSqr = (288 � 216) (288 � 216)*
    yDiffSqr = (39 � 390) (39 � 390)*
    return Math sqrt(5184 + 123201) = 358.31 //square root
    then�follow with this function to get the total short distance
    *     * To calculate this path total distance in KM*
    *     * @return*
    *     public String getDistance() {*
    *          String distance = totalDistance / 20 + "";*
    *          for (int i = 0; i < distance.length() ; i++) {*
    *               if(distance.charAt(i) == '.') {*
    *                    if(distance.length() - 1 - i > 2) {*
    *                         distance = distance.substring(0, i + 3);*
    *                         break;*
    *                    else*
    *                         break;*
    *          return distance + " Km";*
    I try to use 358.31 to divide 20 = 17.91km
    The system return 18.72km..why why why?

    First you calculate distance using double arithmetic.
    Then you follow with code (which is not a function and is all commented out) where suddenly distance is a String and you are doing some kind of string parsing...
    why why why?
    What you supply is NOT code. We can neither debug nor explain the results of, "I did some stuff that I don't explain to you and got a result that surprised me."

  • Acrobat Pro 9, why is it ignoring my java script calculations?

    I am using a PC with Windows XP on it. This has happened many times, and I cant figure it out. I have layed out all of my cells and have given one column the java script commmand to subtract two other columns. I saved it, tested it, closed it, opened it and tested it again. Everything worked fine. I have come back into work this morning to find that the java script is still there and there are still 0's in the column, but it will not calculate anything. What's wrong?
    thanks!

    What  extra work! two, three lines of extra code (may just one) to put a time limit in, that can be overridden with entering a bought serial number. Even shareware peopel do it.
    And I remeber when Acrobat only worked on Mac's. You see it was introduced to Mac's first. Microsoft wouldn't allow it until version 3 or 4.  If I still had my 7100/66 I might could prove was I one of the beta Testers. But that machine was traded in on the G4-500 (which I still own).
    Most major software companies will come out with a new application on the Mac first. Because Mac users tend tobe willing to try out something new on the cutting edge. Then when its prefected they come out with a PC version, and forget about the Mac community.
    Look I am 61. And I didn't just fall off the turnip truck yesterday. I've been around since before the days of the moden internet. I  started with Buliten Boards on 300 baud modem on an old fashion POTS line.  Cost me a fortune in Phonebills
    So don't discount my experiences so lightly. I've used appliactions such as ATM Aldus PageMaker (yes you heard right Aldus). I've use Word Perfect for Mac and PC back when it was owned by WordPefect, then Novell) I've use Microsoft works when it came out for the SE/30. Lotus 1-2-3 both on Mac and PC, FaxSTF, and other that are now none existent on the Mac. Chance are I was using Computers about the same as some of you and probabaly earlier than some. I lived it.

  • No idea about Java or calculating script

    My problem is most likely a pretty simple one (not for me however).   I have eight boxes with user entered numbers and one box at the bottom that needs to total the amounts from the other boxes.   This total needs to be calculated ONLY when the checkbox next to each user entered number is checked.   I am so lost when it comes to this stuff.  Any help, without the script-speak or computer elitest terms, would be greatly appreciated.   I made the document in word, created a PDF and have edited it entirely through LiveCycle.   Thanks for the help.

    Hi,
    Mind if I chime in?
    I would do this using formCalc and a loop with a test for each checkbox. Put the script on the Grand Total field Calculate event:
        $ = 0
        var total = 0
        for i = 0 upto 8 do
            if (RowItem[i].CheckBoxAccept == "1") then
                 total = RowItem[i].NumItemAmt + total
            endif
            continue
        endfor
        $ = total
    Then I would have a "Accept All" checkbox (instead of clicking 9 times if you want to accept everyhing). Put a checkbox in the total row and on the Change event using formCalc like this:
        if ($ == "1") then
            RowItem[*].CheckBoxAccept = "1"
        elseif ($ == "0") then
            RowItem[*].CheckBoxAccept = "0"
        endif
        xfa.form.execCalculate()
    These 2 scripts may be one of the shortest ways to fo it. You have to name all the like items the same. And, you can easily adapt this for having multiple instances.
    Good luck!
    Stephen

  • Java code calculating digits of PI

    Anyone have any links to code that does this quickly?
    More specifically, I'm looking to calculate the hexadecimal digits quickly. So either do that or calculate base 10 and convert them fast.
    [I don't need the Bailey-Borwein-Plouffe Algorithm as I don't want individual digits, I want the first 10,000]
    cheers for any help

    For some of the maths (and other links),
    http://www.cecm.sfu.ca/pi/piquest/
    In c++,
    http://pw1.netcom.com/~hjsmith/Pi/PiW.html
    http://sourceforge.net/snippet/detail.php?type=snippet&id=100622
    Converting number to hex string,
    http://sourceforge.net/snippet/detail.php?type=snippet&id=100683

  • Inserting Images into Acrobat Pro Form And using java script calculation to change it

    Hi,
    I am trying to create a form witch shows text results bassed of tick boxes and I have managed to be able to do that but I need to have icons shown along side them based upon the result and I am not even sure how to input images in the first place.
    I read somewhere that I have to use the content pane but I dont have it and it is not selectable in the view options.
    Also the image I am trying to insert is .ai will it need to be .jpg or .png?
    any help would be greatly aprectiated!
    Thanks,
    Bruce

    That works the only thing is that when another one is selected it stays visible i have tried this
    this.getField("Button1").display = event.target.value=="Off" ? display.hidden : display.visible;
    this.getField("Button2").display = event.target.value=="On" ? display.hidden : display.visible;
    this.getField("Button3").display = event.target.value=="On" ? display.hidden : display.visible;
    this.getField("Button4").display = event.target.value=="On" ? display.hidden : display.visible;
    and alternated them between which one needs to work but that didnt work either, any ideas?
    Thanks,
    Bruce

  • How to monitor progress of web-service calculation?  And abort it?

    Hello. We're thinking of converting an existing Java radar calculation program into a web-service, so that it can be used by various interested parties. However, calculations can take some time (several minutes) and so we would like the client to be able to both show calculation progress and allow the user to abort the calculation if necessary. It is not obvious to us how to do this with a web-service. Are there any standard approaches to this problem? What's the best way of a client asking the web-service how a calculation is progressing? What's the best way for a client to abort a calculation? Any advice most welcomed.
    Kind regards
    Paul Howland
    NATO C3 Agency
    The Hague

    You can't estimate the duration withour running the gather_database_stats. You can monitor it while it is running. (e.g. count the tables that have got updated statistics based on DBA_TABLES)
    And if you run gather_database_stats, the default behaviour might well be to exclude tables which aren't "stale" while in the imported database the expectation is to gather stats on all tables.
    (Similarly, the behaviour to gather column histograms (method_opt) may differ in an existing database from a newly imported database)
    Hemant K Chitale
    Edited by: Hemant K Chitale on May 14, 2013 10:13 AM

  • How to call function in included dll file through java application.

    Hi All,
    i am trying to create an java application which call c# functions using JNI. i am completed with the code and it is running fine when i tried to run from netbeans IDE. But when i tried from Calculator.jar file, first time it throws this error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no CSharpClient in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at calculator.CalculatorApp.<clinit>(CalculatorApp.java:20)
    After that i included that dll file in the cuurent directory. And compiled and tried to run, it throws an unexpected error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    *# An unexpected error has been detected by Java Runtime Environment:*
    *# Internal Error (0xe0434f4d), pid=2640, tid=3700*
    *# Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode, sharing)*
    *# Problematic frame:*
    *# C [kernel32.dll+0x12a5b]*
    *# An error report file with more information is saved as hs_err_pid2640.log*
    *# If you would like to submit a bug report, please visit:*
    *# http://java.sun.com/webapps/bugreport/crash.jsp*
    Anyone have idea how to solve this error.
    Thanks in advance.

    This error is created whenever things go sour on the native side. The first thing you can try, and I assume you are using a Java<->C++<->C# bridge which includes two dlls, one created by C++ and another by C#. Is to make sure that the C# dll is compiled using /t:module switch during compilation.
    If you are using VS2008, or VS2005, you can add a post build syntax like:
    csc /t:module /out:"$(ProjectDir)$(OutDir)YourModule.dll" "$(ProjectDir)YourCSfile.cs"
    Hope this helps! If not, ensure first that the native code works by creating a native test app for it.

Maybe you are looking for