Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Image Library

Image Library

Scheduled Pinned Locked Moved ASP.NET
csharpc++tutorialquestionasp-net
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    achimera
    wrote on last edited by
    #1

    Okay, this is probably a dumb question... but here it is... I need to do a bunch of processing on an image after it is uploaded to a web site. I looked around for a NET 2.0 solution, and Atalasoft DotImage looks great -- but I can't afford it. I didn't see anything else which would do what I wanted. However, I already have an existing image library I created, that took years of work, written in C++ -- and it could accomplish everything I need. So here is my dumb question... From an ASP.NET class, written in C#, can I call a function in a native VC6 C++ type DLL, and have it do the work for me? For example, if the DLL simply has a function like: void ProcessTheImage( LPCSTR lpcstrFileName ); Can I call this from ASP.NET? And if so, how? I already figured out that I can create a command line app, written in C++, put it in the (WebSite)/Bin directory, and call it passing the filename as a parameter ... but I figured that a DLL call would be more efficient (???) ... and I haven't figured how to do the DLL call yet. I assume P/Invoke must be involved somehow (but I've never used that feature before). Thanks for any assistance or guidance you can offer. BTW, I'm using Windows Server 2003, NET 2.0, ASP.NET 2.0, SQL Server 2005, C#, etc. on a dedicated server.

    C 1 Reply Last reply
    0
    • A achimera

      Okay, this is probably a dumb question... but here it is... I need to do a bunch of processing on an image after it is uploaded to a web site. I looked around for a NET 2.0 solution, and Atalasoft DotImage looks great -- but I can't afford it. I didn't see anything else which would do what I wanted. However, I already have an existing image library I created, that took years of work, written in C++ -- and it could accomplish everything I need. So here is my dumb question... From an ASP.NET class, written in C#, can I call a function in a native VC6 C++ type DLL, and have it do the work for me? For example, if the DLL simply has a function like: void ProcessTheImage( LPCSTR lpcstrFileName ); Can I call this from ASP.NET? And if so, how? I already figured out that I can create a command line app, written in C++, put it in the (WebSite)/Bin directory, and call it passing the filename as a parameter ... but I figured that a DLL call would be more efficient (???) ... and I haven't figured how to do the DLL call yet. I assume P/Invoke must be involved somehow (but I've never used that feature before). Thanks for any assistance or guidance you can offer. BTW, I'm using Windows Server 2003, NET 2.0, ASP.NET 2.0, SQL Server 2005, C#, etc. on a dedicated server.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      DotImage rocks. I use it. Yes, you can call a native dll, p/invoke is the name of the technology you use to do this. www.pinvoke.net[^] has lots of examples

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      A 1 Reply Last reply
      0
      • C Christian Graus

        DotImage rocks. I use it. Yes, you can call a native dll, p/invoke is the name of the technology you use to do this. www.pinvoke.net[^] has lots of examples

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        A Offline
        A Offline
        achimera
        wrote on last edited by
        #3

        I agree, DotImage looks great, but unless I'm missing something ... I have to pay $499 for the most basic SDK, then another $329 to use it on a server ... which is $828 ... for 1 person ... as the cheapest option. And when I look in my pants pockets, I can't find $828 in them. Telerik and CodeJock already got it. The stuff that DotImage does though, I already have created, and have used for the last decade in MFC/C++ type code... including writing my own convolution filters, of different matrix sizes, by experimenting with Adobe Photoshop (as it has a feature to play around with that), etc. In any case, thanks for the link to pinvoke.net. I'll check it out. Although my most basic question is how to get from something like this: (WebSite)/App_Code/MyClass.cs

        public class MyClass
        {
        public static void ProcessImage( String ImageFileName )
        {
        // I want to call a static linked VC6/MFC/C++ DLL here,
        // named perhaps ImageProc.dll, located in the Bin directory,
        // in a manner such as this:
        //
        // void ProcessImage( LPCSTR lpstrImageFileName );
        }
        }

        And assuming ImageProc.dll exists as: (WebSite)/Bin/ImageProc.dll To do something that works. I assume there is some simple trick or technique for using P/Invoke to do this? Obviously there is going to be some sort of conversion problem between the C# String type and the Win32 LPCSTR type. Is there some sort of super easy bit of wisdom you can provide? And also, as to how I can call the function in the first place? If not, thank you. I will check out pinvoke.net further. Your help is appreciated greatly however. Regards.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups