Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2005

Tip: Looking for answers? Try searching our database.

writing to text file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jigi - 19 Oct 2005 20:21 GMT
i have a compiled dll, and i want to see what values ar in certain methods
during run time. i have built the release build . is there a way to write to
a text file on my desktop or qa desktop?
William DePalo [MVP VC++] - 19 Oct 2005 21:20 GMT
>i have a compiled dll, and i want to see what values ar in certain methods
> during run time. i have built the release build . is there a way to write
> to
> a text file on my desktop or qa desktop?

Check the docs for SHGetFolderPath() with CSIDL_DESKTOPDIRECTORY. That will
get you the fully qualified path to the desktop folder. Use that to create a
file name.

You have a number of options to create a file name. For example, can use
SetCurrentDirectory() and then GetTempFileName() or _splitpath() and
_makepath().

Once you have a file name, you can create it however you like -
CreateFile(), fopen(), CFile class etc.

Regards.
Will
jigi - 19 Oct 2005 21:30 GMT
i keep getting error when using vc++.net with fopen

>>i have a compiled dll, and i want to see what values ar in certain methods
>> during run time. i have built the release build . is there a way to write
[quoted text clipped - 14 lines]
>Regards.
>Will
Tom Serface - 19 Oct 2005 21:44 GMT
For the most part if you are writing Windows programs I'd use CreateFile,
ReadFile, and WriteFile (or the Ex versions).  I just wrote this routine
yesterday (uses MFC sorry) to create a temp file name:

CString GetTempFilePath(LPCTSTR strPattern)
{
   CString csPath;
   if(GetTempPath(_MAX_PATH,csPath.GetBuffer(_MAX_PATH+1)) != 0) {
       csPath.ReleaseBuffer();
       CString csTempFile;
       if(GetTempFileName(csPath,strPattern,0,csTempFile.GetBuffer(_MAX_PATH+1))
!= 0) {
           csTempFile.ReleaseBuffer();
           return csTempFile;
       }
   }
   return CString();
}

Using the functions that Will is referring to.  It works pretty well
actually.

Tom

>i keep getting error when using vc++.net with fopen
>
[quoted text clipped - 20 lines]
>>Regards.
>>Will
William DePalo [MVP VC++] - 19 Oct 2005 22:25 GMT
>i keep getting error when using vc++.net with fopen

Which one?

Did you try to diagnose the problem looking at errno or strerror()?

Regards,
Will

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.