|
ClistCtrl::InsertItem( int nItem, LPCTSTR lpszItem );
using nItem = 0;
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hi,
I'm trying to allow my users to open a file with the read-only check boxed selected. If the user selects a single file and checks the box, GetOpenFileName properly returns the OFN_READONLY flag. If the user selects multiple files, and selects the read-only checkbox, the OFN_READONLY flag is not returned.
This appears to be a bug. Is there a workaround, or am I stuck?
thanks,
Dennis
|
|
|
|
|
I use this code:
CStdioFile inFile;
CString indatastring;
inFile.Open(strpath , CFile::modeReadWrite | CFile::typeText);
while(inFile.ReadString(indatastring))
{
AfxMessageBox(indatastring);
}
inFile.Close();
It only show one message box,my file is .doc file with many lines.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
The mode CFile::typeText relies on a end of line marker to determine a single text line. Based on what you've said, I'm guessing that your DOC contains a single marker, and it's at the end of the document, not at end line.
You may want to consider setting your ReadString statement to read a pre-defined number of characters (like 80 )
char buf[80]
inFile.ReadString( inDataString, buf )
Hope that helped somewhat,
D.
|
|
|
|
|
Douglas Troy wrote:
Hope that helped somewhat
Yes,it works,thank you.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
hi MAZY
here Renjith..
mmm The CStdioFile::ReadString()
function stops the readingwhen it see the first \n charecter
accoring to u thers ia many lines of text so there will me many newlines..so it will stop when it see the first '\n'.so only the first line displays..
you can do it in this way
extern CFile ofile;
char buffer[MAX_PATH];
UINT nReadedBytes = ofile.Read( pbuf, MAX_PATH );
it will consider the linefeed carriage return as a Single Charecter
try thi snow..!!
Renjith
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
I've just written a program with VC++ .Net (My first one with this environment ), and i realise that when I close the window, the process does not close.
It makes access to an oracle and a MS access database through MDAC (jet for Access, and ODBC for Oracle)
Any clues?
Regards,
Frank
|
|
|
|
|
Hi !
I have several databases (in mdb format) for my MFC project. I decided to put them on a server in the network. The path is like this:
//netbackup/multimedia/erginasil.mdb
The problem is: The server (netbackup)has a password which I have but the users will not have.If I first connect there ,the program runs normally. How can I acces a password protected server in the code. I found in msdn opening a password-protected "file" but I must give the "server password" to connect normally.
Thanks in advence..
|
|
|
|
|
You need to connect the resource.
See the Network Functions...
For example WNetAddConnection
Best Regards.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hi
Does anybody know where I can find a symbol/character picker (MFC/C++ source code) where you can choose font and character? I'm looking for something like the character map application (charmap.exe) in Windows.
Any suggestion? Thanks in advance.
/Mauritz
|
|
|
|
|
Hi i'm writing a FTP-client using win32 functions.
I need to compare the "ftLastWriteTime" of a file on a ftp server with a file on a local client without downloading the file from the server(s). I can use FtpFindFirstFile and FindFirstFile to retrieve this time. The problem is that FtpFindFirstFile returns the time by the local timezone.
How can i convert this time to UTC(zone independent) format??
Thanks
Fred
|
|
|
|
|
I have written a custom web browser for my company. I wrote it in MFC using the CHtmlView class. Everything is working well except:
I handle the OnNewWindow2 method to popup a new window and I have everything working as far as popping up the window, showing/hiding the toolbar, menubar, status bar. The problem is I can't find a way to determine the appropriate size of the new window. The info is not passed in with the call and does not appear to be available through the interface.
My best guess (from looking around) is that I need to create an event sink against the WebBrowser object itself and capture the settings there. I am not sure if this is the right approach and I am not quite sure how to go about doing this anyway.
Does anyone have any suggestions?
Thanks in Advance
Matt Gullett
|
|
|
|
|
i create a dialog based program,add some code to add tray icon,popup menu.but when i finished and complite it,1 error occoured.
it said the the Dialog ID have been used and can't be overWrite.But where the place is Wizard create code, i never changed it..
so what caused it?
Thanks a lot...
|
|
|
|
|
sometimes
the resource ID wich u created newly is the same as the Dialog Resources ID...jusk look in to the resource file and look up on the Dialods ID..and look on the code u added newly..and change if there any..that will work..try it now..!!!
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
Im trying to use a set of _bstr_t with a custom compare func.
The compare func is defined as this
struct _bstr_t_cmp_fn : public std::less<_bstr_t>
{
bool operator ()(const _bstr_t &r1, const _bstr_t &r2)
{
return (stricmp(r1, r2) < 0) ? true : false;
}
};
i then use it like this
std::set<_bstr_t, _bstr_t_cmp_fn> oPaths;
which works fine, insert seem to work the way it should to, but
then i want to use the set::find() function.
I defined the iterator like this, no problem
std::set<_bstr_t, _bstr_t_cmp_fn>::iterator it;
but when i then try this
it = oRefs.find(e); // ( e == _bstr_t object )
i get compiler errors
error C2662: '()' : cannot convert 'this' pointer from 'const struct _bstr_t_cmp_fn' to 'struct _bstr_t_cmp_fn &'
Why is that?? ...it gives me a headache..
/Magnus
|
|
|
|
|
Hmmm... perhaps
it = oRefs.find(&e);
works?
|
|
|
|
|
No does not work, get another error which is what i should get
since the set contains _bstr_t and not _bstr_t *.
/Magnus
|
|
|
|
|
And when you simply remove the &s in the
bool operator ()(const _bstr_t &r1, const _bstr_t &r2)
declaration?
|
|
|
|
|
nevermind, the () operator have to be
bool operator ()(const _bstr_t &r1, const _bstr_t &r2) const
Really crappy error msg i think.....but thats STL it seems
/Magnus
|
|
|
|
|
You have another bug in that stricmp() is the wrong function to use. BSTRs are Unicode strings, you need to use _wcsicmp().
--Mike--
"Jobs that don't allow you to visit the Lounge 25 times a day at the minimum are not worth having anyway."
-- Nish, 3/28/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
I store _bstr_t not BSTR
and _bstr_t have a (char *) operator so it should work just fine.
(maybe not the most efficient way)
/Magnus
|
|
|
|
|
hi,
My question could be a stupid question, but i don't find the solution.
It's simple I have a managed function like that:
bool GetValorBinary(LONG lVarId, String & pCadena, int length)
- inside code i create a new String, where pcadena2 is a TCHAR.
String * prue(pcadena2);
- now i want to do something like to back the value in pCadena
pCadena=pcadena2;
- but at build i recived the next error:
error C2582: 'operator =' function is unavailable in 'System::String'
Any suggestion? thanks in advance.
Salamanca 2002 Capital Cultural Europea, Visitala
|
|
|
|
|
Perhaps
strcpy(pCadena, pcadena2);
helps?
|
|
|
|
|
thanks, but not, it doesn't work, i had try yet.
anymore ideas?
Salamanca 2002 Capital Cultural Europea, Visitala
|
|
|
|
|
This structure is not a true C-language structure because it contains variable-length members. This structure was created solely to depict the organization of data in a version resource and does not appear in any of the header files shipped with the Microsoft
Platform Software Development Kit (SDK).
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|