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. General Programming
  3. ATL / WTL / STL
  4. How to use "fprintf" and "sprintf" in ATL dll creation.

How to use "fprintf" and "sprintf" in ATL dll creation.

Scheduled Pinned Locked Moved ATL / WTL / STL
tutorialcsharpc++sysadmindebugging
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
    agarunk
    wrote on last edited by
    #1

    Hi all, I'm developing ATL dll which will be used in C#. But I have done many things so far now I have to use either file operation (say fprintf) or string operations ("sprintf"). I have tried to do it as in the usuall fashion(like in normal exe) but when I'm calling the methods containing "fprintf or sprintf" in C# project it'll start throwing following error. ........................................ Debug Assertion Failed! "location\system32\inetsrv\w3wp.exe" File:sprintf.c Line:55 Expression: (str != NU.LL) ............................................ when I hit retry i'll get the following messege The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) ................................................... As per me its not the right way to use fprintf/sprintf in ATL dlls I guess. You can test it by creating simple ATL dll project and placing file operation including fprintf/sprintf, and calling the method in C#. plzzzzz guide me to come over it. Thanks, Arun

    J 1 Reply Last reply
    0
    • A agarunk

      Hi all, I'm developing ATL dll which will be used in C#. But I have done many things so far now I have to use either file operation (say fprintf) or string operations ("sprintf"). I have tried to do it as in the usuall fashion(like in normal exe) but when I'm calling the methods containing "fprintf or sprintf" in C# project it'll start throwing following error. ........................................ Debug Assertion Failed! "location\system32\inetsrv\w3wp.exe" File:sprintf.c Line:55 Expression: (str != NU.LL) ............................................ when I hit retry i'll get the following messege The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) ................................................... As per me its not the right way to use fprintf/sprintf in ATL dlls I guess. You can test it by creating simple ATL dll project and placing file operation including fprintf/sprintf, and calling the method in C#. plzzzzz guide me to come over it. Thanks, Arun

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      I'd say you're passing garbage to the functions, because there is no difference in calling them from an .exe or a .dll.

      -- Coming Soon to an Illegal DVD

      A 1 Reply Last reply
      0
      • J Jorgen Sigvardsson

        I'd say you're passing garbage to the functions, because there is no difference in calling them from an .exe or a .dll.

        -- Coming Soon to an Illegal DVD

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

        I don't think so because I experimented with the fresh ATL project, by adding only 3 lines of extra code of file operation consists of "fopen, fprintf and fclose". Here also I have found that "fprintf" is posing same problem. Please you can easily check it by creating simple ATL dll with a method consists of these file operation lines. And we should use that method in C#. It 'll definately throw the same error. Regards, Arun

        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