|
hi.
char buf[100];
I want to save the buffer on the file.
say, first 87 array has a character but left over has NULL.
so when I save it, also save NULL value into the file.
fputs(buf,fp);
How can I save just 87 character into the file??
thanks
|
|
|
|
|
Tomohiro wrote:
How can I save just 87 character into the file??
By using C++ instead of C. If you used an ofstream, even if you use a C style string instead of std::string, it will stream only the 87 characters you are after.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
fprintf
-c
I'm not the droid you're looking for.
|
|
|
|
|
|
Tomohiro wrote:
for(int i=0;i fprintf(fp,"%c",buf[i]);
}
wouldn't it be easier to do: fprintf(fp,"%s",buf) ?
cheers,
-B
|
|
|
|
|
You can also try fwrite, and specify that you want 87 elements each of size 1.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Hi.
I am working with HTTP 1.1. I would like to know what other characters such as alpha and punctuactions are allowed for a given URL?
For example:
// Valid
http://www.oiahsdifh.com/aoihsdofhad_jalsdif-joihasdf/theFile.file
// Is this valid?
www.oiahsdifh.com/aoihsdofhad!jalsdif{joihasdf/theFile|file
The project deals with HTTP and websites links. Thus, I need to know the standard and pattern to which servers and clients communicate.
Thanks,
Kuphryn
|
|
|
|
|
Check http://www.ietf.org/rfc/rfc2616.txt[^]
"You can stand all night at a redlight anywhere in town, hailing Marys left and right but none of them slow down. I've seen the best of men go past. I don't wanna be the last..."
|
|
|
|
|
|
I added a template class to one of my projects and none of the methods that I defined are showing up in the class view. Everything compiles cleanly with no errors and I've included all of the proper header files but only data members show up. I know I'm missing something simple. Any suggestions?
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
Are they public ? Why are you exposing your data members ? Does the code compile, even though class wizard is broken ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
|
If you are using VC++ 6, yes, that is the case. For any template classes, only member data and inline methods will show up in class-view or auto-completion menus, and no, there is no solution, a future patch from Microsoft is our only hope.
|
|
|
|
|
Thanks for your reply.
Maybe I'll just make all of hte functions inline so that I can see the auto-complete.
I did have some limited success with two of my methods showing up. Neither of them were inline, but one of htem had default parameters and the other was an overload. As long as I left one of them with a default parameter both would show up in the auto-complete menu.
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
|
Hi all..
I cerate an application that stores some user-specific data in the registry..
So I use a registry path like this:
HKEY_CURRENT_USER\SOFTWARE\MyCompanyName\Myproduct\UserInfo
So every user logs in can have his pesonalized settings..
The Problem:
When a user uninstalles the application I will be able to remove only that user's data only .. but How can I have access to other users data to remove it as well ?
|
|
|
|
|
Being able to change another user's registry would be a securitybreach.
So unless the user uninstalling the software is an administrator, no can do.
Otherwise, iterate through all instances under HKEY_USERS and remove the entries.
"You can stand all night at a redlight anywhere in town, hailing Marys left and right but none of them slow down. I've seen the best of men go past. I don't wanna be the last..."
|
|
|
|
|
you could set up all users under the key, like:-
HKEY_LOCAL_MACHINE\SOFTWARE\MyCompanyName\Myproduct\UserInfo\User1
HKEY_LOCAL_MACHINE\SOFTWARE\MyCompanyName\Myproduct\UserInfo\User2
etc.
Then when uninstalling delete the key:-
HKEY_LOCAL_MACHINE\SOFTWARE\MyCompanyName\Myproduct\UserInfo
and all subkeys.
it may mean a bit more work to identify the user settings for the program for each user but its a quick way to clear up when uninstalling
|
|
|
|
|
Hi
I'm learning VC and I'm thinking it seems logical that at
ShowWindow(SW_SHOW)
the OnPaint function should be called.Can someone pls confirm with me if it is true?
a zillion thks
|
|
|
|
|
raner wrote:
ShowWindow(SW_SHOW)
I don't think so.Its only for VISIBILITY of window.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
InvalidateRect() caused that.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I have an text box in my dialog.I use this line of code to set it its string in OnInitDialog:
m_strNotify = "aaaa";
m_strNotify += "\n";
m_strNotify += "ddddd";
AfxMessageBox(m_strNotify);
m_edit.SetWindowText(m_strNotify);
In messagebox NEW LINE works fine but in text box it shows all the texts in one line.I set multiline property to true but it doesn't work.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
|
Thanks.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Here is my problem.
My code reveives a ADO recordset. I have no control over the cursor types etc on this recordset. I need to copy this recordset to another Recordset. The new recordset is not connected to any database or any source.
Then I am to do stuff to the data in the new recordset, delete some of the rows and then pass the recordset on to a module that expects a Recordset as input.
How do I create a recordset, and then copy data from an existing recordset to this one. Each time I try some code it blows up. Is it even possible?
I tried something like:
while not eof
localRecordset.AddNew //It blows up here if the recordset is not open.
If I do recordset.Open //Then I do not know what parameters to open it with
Thanks
|
|
|
|