How to use "fprintf" and "sprintf" in ATL dll creation.
-
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
-
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
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
-
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
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