CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Thread: c# applet

  1. #1

    c# applet

    Hi All,
    I have to create a tree in the browser that will act as a wizard. This tree will be dynamic and the nodes of the tree will change images at the run time. Number of nodes will be defined by the xml file.
    I was planning to create java applet but on the click of tree node I have to call our native code that is in C and C++. SO to do so I have to use JNI. Then I found that JNI and applet don't mix.
    1) Is it possible to use C# applet to create a dynamic tree ?
    2) Will this applet it be platform dependent because my application works on number of platforms ?
    3) Will C# applet works on NetScape ?

    Please let me know if I can use c# applet or if there is some way to mix JNI and java applet.

    regards,
    Amit

  2. #2
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    if you are creating Tree then look at samples. there are plenty of them. adding a node to a tree isn't a big deal ...

    yes it is possible to create a C# applet for XML nodes.

    make an applet with C#
    on the server side u must have IIS 5.0 later. 6.0 is better.
    then install .NET redistributable.

    I have tested the following attachments on IIS /windows/IE.

    NetScape doesn't like it. I am sure on linux version of IE u will be able to run it .

    C#Applet.zip contains
    1) CSharpApplet.html
    2) template.dll
    3) template.cs

    copy first 2 in

    folder => C:\InetPub\wwwRoot

    3'rd is the source file for C#Applet

    if you make changes complile template.cs and place template.dll in the above folder.

    compile template.cs with following options


    csc /t:library /out:c:\inetpub\wwwroot\template.dll template.cs

    make your logic and add tree in control list.

    Best Luck,
    Paresh Gheewala
    Attached Files Attached Files

  3. #3
    Paresh,
    Thanks for the reply. Java applets work on client side that is we dont need to have webserver to run them. What if we dont have web server for our application to run ?
    Our application is not web based but it is based on CLient-server technology with complete code in C,C++ with embedded IE/netscape browser to browse the net. Also, I understand that you are saying that c# applet will not work with NetScape. Correct me if I am wrong.
    Do you still think that I can use C# applet or I have to use Java applets with JNI to call our native C,C++ code.

    regards,
    Amit

  4. #4
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    Amit,
    I think your idea using Java,C++,JNI would be so long and u won't even know where u will be stuck up.

    instead dig properly in C# Applets. .NET is the way to go...

    I am also searching for ur question and as i will get some more info i will pass it to u.

    thanx
    Paresh

  5. #5
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890

    Red face

    Amit,

    I'm sure you have been mistaken on .NET, how a program could run
    without
    kernel32.dll ? a java applet without the java runtime ? a
    program without
    its library ?
    .NET, ultimately is nothing mysterious but a set of library your
    .NET
    program link against and which are obviuosly unavoidably needed
    to run it.
    I wonder what you had imagined ?.....



    You DO need
    to host you C# applet on IIS in a (web shared) directory with
    script
    enabled", there is nothing about it and no microsoft
    representativ or,
    better, developper, had the knidnes to enlight me more on the
    topic, Worst,
    lot of them seem to even ignore about such possibility....


  6. #6
    Paresh,
    Thanks for the reply. I agree I am new in .NET. Our Client(NT /Unix/....) will have Java run time environment. What they will not have is a web server. We don't need a web server for our application to run till now.
    Now I can run java applets without a webserver by embedding them in a html page and opening the page. I am not sure if i can do the same in C# and I want to know if C# will work across platforms/browsers.

    Thanks in adv
    Amit

  7. #7
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    I am not sure if i can do the same in C# and I want to know if C# will work across platforms/browsers.

    >> It works cross platform provided that its hosted by .NET Servers/IIS


    soon on Linux.net is going to release so it will be able to run independtly..

    no more java

    Paresh

  8. #8
    Paresh,
    I found this
    "C# code runs in a managed execution environment, which is the most important technological step to making C# run on different operating systems. However, some of the .NET libraries are based on Windows, particularly the WinForms library which depends on the nitty gritty details of the Windows API. There is a project to port the Windows API to Unix systems, but this isn't here now and Microsoft have not given any firm indication of their intentions in this area"
    It seems that at present I can't use applets to work on multi platforms like HP Unix, Unix, Solaris, NT,Win2000 etc.
    Also I need to have IE6.0 to run C# applets so what will happen to our NetScape browsers.

    It seems that I can't use C#. DO you any technology like MFC(Microsoft Foundation Classes) that can be used to display GUI on browser and that is platform independent.

    Amit

  9. #9
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    hi,
    obviously C# code has to run in managed code environment because it runs on CLR layer where Metafiles are generated using FCL. Technically yes it does.
    (incase java runs on JRE )

    as java uses the platform based libraries every architecture has to know its platform specific bits and bytes. since Sun Solaris,HPUX etc has its own OS architecture so they have there own library namely .so and .dso so hence in .NET its known as Assembley with a strong name.


    "When you use window function then what does java do ? " technically it goes to jre and jre picks the os library to draw window etc. " same as .NET does. but in case .NET is very fast and uses direct draw etc.. (we could make useof DirectX also for faster rendering) .
    Linux.NET will use Linux based libraries... so its the CLR who will talk to hardware and CLR will use typesafe conversions. coriecon will be done safely. this is Managed compared to MFC and previous native things....

    Microsoft is soon going to launch the powerfull .NET on other OS also so in my opinion .NET 's graph is definetely going to rise very high as C/C++ did. C++ is still ever green on any platform.

    Netscape I don't know. what they are doing. initially i felt after netscape 6 that it will close building new version. but netscape doesn't like .NET may be it will come with its patch.

    Paresh.

  10. #10
    Paresh,
    Thanks for reply again. I think I am getting convinced for C#. I was having 3 issues using C#
    1) As you said we need to have IIS or other Web server to run C# applets.
    Now since we just open browser from our application and we don't have any website or web server I am limited to client side coding only. How can I run C# applet in the browser without web server .only as I run Jave applets.

    2) I don't think we can move to MSDEV 7.0 as all of our projects in 43 countries use MSDEV 6.0 and we can't move alone. It may break the build. Can I simply have .NET complier

    3) I take your words for the third problem and lets assume that pretty soon C# will be platform independent i.e. after Linux.NET is available.

    My first 2 issues are still open...

    Amit

  11. #11
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    Hi,

    1) I am not sure. But you could check in your network. for example. install .NET redistributable (free) on the client and put the code that i ziped to you as a test program. so plz. check that out. installing that on server and invoking html file on diff. machine and testing as a web situation.

    2) I know your company. (PTC as my brother works for same :-) )
    good to know that. I am glad. yes you could test .NET SDK which is available on mkft site. its for free. if you want VS.NET its available for 100 $ (as I have a friend in MKFT , ha ha ha - )

    3) yes .NET on any platform is going to release soon. in fact .NET server 2003 is going to release by the end of the April or near to that.

    you have to convience that for speed , optimizm, versality, flexibility, interoperatibility etc... you have to go for .NET and that's the solution.

    thanx
    Paresh

  12. #12
    Hey,
    Nice to hear you have brother in PTC. Is he in US?? Anyways, lets see what we decide... Thanks for your suggestions.
    Amit

  13. #13
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    he is in Pune branch but came US 2-3 times. (formerly known as Computer Vision)

    Paresh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured