|
m_username and m_password are CString types.
|
|
|
|
|
If you use the debugger at that function to save the two files, I bet you get...
m_User = "user" and m_Pass = "pass" (I can't see your original code)
And then your text file will be....
userpass
with no way of know where one starts, and the other finishes...
Instead of CString, try using a fixed character array, and then saving that out. It will be much easier when you load it. It will have the restriction of only being able to have user names and passwords of a certain length, so don't make it too short!
Iain.
|
|
|
|
|
Try using GetBuffer() function for the CString objects in the fprintf statement?
|
|
|
|
|
No, don't do that at all. The GetBuffer() method should only be used when write access to the internal buffer is required. In this case, it is not. The LPCTSTR operator is all that's needed.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How are you verifying that only two characters (one from each variable) exist in the file? Is this a Unicode application?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Could you please post the code snippet ?
Regards,
Paresh.
|
|
|
|
|
I have given the code snippet where i can get the problem.
|
|
|
|
|
How to edit subitems in a list view , i tried LVS_EDITLABELS but it allows to edit first column only.
Thanks & Regards
|
|
|
|
|
Have you tried SetItemText ?
|
|
|
|
|
There is not provision in list control for doing this. U have to create your own edit control and manage it. You can find many samples in code project itself. Search.....
|
|
|
|
|
Hi All,
I have one requirement wherein the user does not want to install Winzip and use WinXP's in build de/compression utlity. Is there any way to call "Extract ALL" from Command line.Ealier i wan executing a simple winzip command from command line to achieve the same.
Thanks in Advance,
Abhi Lahare
|
|
|
|
|
type zip -? in command line to find out the commands available
|
|
|
|
|
i have a combo box which contains interger values and i have couple of files in my application. i have mapped this combo box to integer. i am getting the index of the value and i am using cstring to convert it to the original value. for ex. there are 2 values in my combo box. 100 and 200. if i select 100 i get the index as 0. and the CString variable will return the value(100). now my requirement is i need to pass the value(100) to another file. how do i do it?
|
|
|
|
|
You can write get/set function and then using class pointer access those values in another file.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
is there any other way other than that?
|
|
|
|
|
If your classes support parent/child relationship then you can use GetParent() from your child class to access the members of the parent.
(P.S. - Is there some problem in getting the values as per my previous suggestion.)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
there is no problem in doing so. but thought the other way where u make an instance of a class and pass the value thru that.
|
|
|
|
|
as a constructor parameter for instance...
|
|
|
|
|
Hi Experts,
How can I enumerate of all Bits of a Byte variable.
Thanx in advance.
|
|
|
|
|
try this
byte byValue = 12;<br />
byte byExtractor = 128;
for( int nIdx =0; nIdx < 8; nIdx ++ )<br />
{<br />
byte byBit = (byExtractor == (byValue&byExtractor));<br />
byExtractor = byExtractor>>1;<br />
std::cout<< "bit at "<<nIdx<<"th position is "<< byBit; <br />
}
|
|
|
|
|
|
Did you mean something like this?
BYTE b = ???;
for( int i = 0; i < 8; i++ )
{
cout << (( b >> i ) & 0x1 ) << endl;
}
|
|
|
|
|
i want to use "Access" database to store my data, i just only know plain c(or Win32API), i can't use c++(or MFC), so how to read and write "Access" database files with C in Windows Programming(not MFC,C++)?
|
|
|
|
|
As far as I know ODBC still works and has a usable C interface. It's a whole technology wrapped in some Dlls so you'll need to look it up and try some examples but essentially it lets you open a database using a vendor supplied driver and run SQL queries against the database to form recordsets of results and then iterate over those result sets operating on individual rows. It's like a primitive version of OLE/DB without the need for COM.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I have a dll built from spidermonkey source. It also seems to build manifest file on winXP. Now my question is how do I load it in my client program. Apparently my winXP box is running .NET 2.0, and they have made it a requirement to load a dll ONLY through the manifest file dependency specification. Earlier it used to be as easy as dropping it in system32 folder, but now with .NET side-by-side assembly structure, things have changed
Can anybody give me pointers as to how do I go about using that DLL in a C program (win32 console application) ?
|
|
|
|