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

Thread: Using web services from MFC

  1. #1
    Join Date
    Jan 2009
    Posts
    239

    Using web services from MFC

    Hi all of you. Is there a possible to adapt a MFC app (a GDI viewer who render standard images, jpg, bmp, etc.) to run on a server and render images in browser, using web services ?

    Of course that I have seeked this on internet, but I haven't found something that fit my needs ... Can you point me how to achieve this ? This is a request from someone, and I have to do some researches regarding this topic.

    Thank you for any response and for your time.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,225

    Re: Using web services from MFC

    Well, using the CHtmlView would be a good start.
    See also this thread.
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2009
    Posts
    239

    Re: Using web services from MFC

    And what part of my app could I run on a server in such a wat that client could see the images in any browser ?

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,225

    Re: Using web services from MFC

    You could use a kind of Terminal Server (Remote Desktop) for example...
    Victor Nijegorodov

  5. #5
    Join Date
    Jan 2009
    Posts
    239

    Re: Using web services from MFC

    I this case I don't need the browser anymore ...

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,225

    Re: Using web services from MFC

    Then sorry!
    Victor Nijegorodov

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,730

    Re: Using web services from MFC

    Quote Originally Posted by mesajflaviu View Post
    Hi all of you. Is there a possible to adapt a MFC app (a GDI viewer who render standard images, jpg, bmp, etc.) to run on a server and render images in browser, using web services ?

    Of course that I have seeked this on internet, but I haven't found something that fit my needs ... Can you point me how to achieve this ? This is a request from someone, and I have to do some researches regarding this topic.

    Thank you for any response and for your time.
    The simple answer is "no." The complex answer is, "sure, anything is possible."

    The practical answer is there are are a host of issues running a native app from a web service. Security is one, streaming the image from the native app to the service is another.

    You don't mention what technology you are using to write the webservice. If it is something like .net, the you would be better of converting the native code into managed c++ that can be consumed by the .net service.

    If the MFC app rendered the images originally, then that rendering would be done on the client and supplied by a web server (which calls the web service to get the image data).

    Since the paradigm between rendering an image is so different that rendering the same in a browser, you are better off rewriting the functionality into the web service rather than trying to call the native app from the web service. Of course, that's just my opinion, and I have been surprised at the hacks that folks come up with.

  8. #8
    Join Date
    Jan 2009
    Posts
    239

    Re: Using web services from MFC

    Quote Originally Posted by VictorN View Post
    Then sorry!
    What I meant there is that was the request, there was not my idea ... I really don't want to be not polite or rude ... I am really sorry if you understand that !
    Last edited by mesajflaviu; September 11th, 2018 at 03:15 AM.

  9. #9
    Join Date
    Jan 2009
    Posts
    239

    Re: Using web services from MFC

    The one who request me this told me that the communication will be done by VPN.

    "You don't mention what technology you are using to write the webservice. If it is something like .net, the you would be better of converting the native code into managed c++ that can be consumed by the .net service."

    I know only C++/MFC ... this is not enough to complete the task ?

    "If the MFC app rendered the images originally, then that rendering would be done on the client and supplied by a web server (which calls the web service to get the image data)."

    Sound interesting ... can you elaborate a little bit ?

  10. #10
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,730

    Re: Using web services from MFC

    I suppose while theoretically possible, it really isn't practical to write a modern web application in c++. Even if you did, you would either have to spend a ton of time writing it in c++ or end up with something that is the equivalent of a 20 year old web framework.

    C++ is great for many things, but writing web applications isn't one of them. If you want a web app that is current, you'll need to write it in a modern framework.

    I do Microsoft technologies, so I would write the web app and web service in .Net Core 2.x, but there are other languages that offer web frameworks, such java and python.

    You need to read up on web application development because the subject is too broad for me to give you even a start of what it is all about.

    For .NET Core 2.x web development, search bing or google for "how to write a web application in .net core 2". Plenty of info and tutorials out there. Btw, if you go this route, you'll want to use the lastest Visual Studio 2017 Community edition to develop with.

  11. #11
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,592

    Re: Using web services from MFC

    Quote Originally Posted by mesajflaviu View Post
    Hi all of you. Is there a possible to adapt a MFC app (a GDI viewer who render standard images, jpg, bmp, etc.) to run on a server and render images in browser, using web services ?
    I have a strong suspicion that you have no idea what web service is. Web services have nothing to do with browsers. As to browsers, those are capable of rendering "images, jpg, bmp, etc." with no help from server-side renderers. Unless your images are created on the fly, of course. You just specify a proper href to the image, and browser does the trick. The href may point at a special web page that reads image bytes from file, or database, or other sort of source and outputs those bytes accompanied with proper HTTP headers.

    I know only C++/MFC ... this is not enough to complete the task ?
    I have bad news for you. As long as it is about web server, you need to know about programming web servers.
    Best regards,
    Igor

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)