Click here to Skip to main content
16,009,185 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: colorful text in Edit? Pin
ThatsAlok14-Feb-06 21:39
ThatsAlok14-Feb-06 21:39 
QuestionRS232 Newbie Pin
Jader8913-Feb-06 11:31
Jader8913-Feb-06 11:31 
AnswerRe: RS232 Newbie Pin
Cool Ju13-Feb-06 17:49
Cool Ju13-Feb-06 17:49 
GeneralRe: RS232 Newbie Pin
Jader8914-Feb-06 13:26
Jader8914-Feb-06 13:26 
QuestionValid File Name Pin
Jack Puppy13-Feb-06 11:18
Jack Puppy13-Feb-06 11:18 
AnswerRe: Valid File Name Pin
Stephen Hewitt13-Feb-06 19:05
Stephen Hewitt13-Feb-06 19:05 
GeneralRe: Valid File Name Pin
Jack Puppy14-Feb-06 3:59
Jack Puppy14-Feb-06 3:59 
GeneralRe: Valid File Name Pin
Stephen Hewitt14-Feb-06 11:25
Stephen Hewitt14-Feb-06 11:25 
I used the following code:
--------------------------
void IsValid(LPCOLESTR pFileName)
{
IMoniker* pMonk;
HRESULT hr = CreateFileMoniker(pFileName, &pMonk);
if ( SUCCEEDED(hr) )
{
pMonk->Release();
wcout << L"'" << pFileName << L"' is valid.\n";
return;
}

wcout << L"'" << pFileName << L"' is NOT valid.\n";
}

int main(int argc, char* argv[])
{
OleInitialize(NULL);
IsValid(OLESTR("auxa.txt"));
IsValid(OLESTR("aux.txt"));
IsValid(OLESTR("aux .txt"));
IsValid(OLESTR("C:\\ filename.txt"));
IsValid(OLESTR("C:\\auxa.txt"));
IsValid(OLESTR("C:\\aux.txt"));
IsValid(OLESTR("C:\\aux .txt"));
OleUninitialize();
return 0;
}

And got this in output:
-----------------------
'auxa.txt' is valid.
'aux.txt' is valid.
'aux .txt' is valid.
'C:\filename.txt ' is valid.
'C:\auxa.txt' is valid.
'C:\aux.txt' is NOT valid.
'C:\aux .txt' is NOT valid.

Seems to work only for fully qualifed paths. Seems to fail the trailing space rule in any case.

Steve
Questionopening My documents ? Pin
sparra0613-Feb-06 11:13
sparra0613-Feb-06 11:13 
QuestionPasting 256 color images into an icon Pin
Joe Woodbury13-Feb-06 9:46
professionalJoe Woodbury13-Feb-06 9:46 
QuestionOpening MDI Child windows Pin
Vijaykumar Rajaram13-Feb-06 7:39
Vijaykumar Rajaram13-Feb-06 7:39 
Questionbroadcasting using MFC sockets in VC++ Pin
rohini sharma13-Feb-06 7:33
rohini sharma13-Feb-06 7:33 
AnswerRe: broadcasting using MFC sockets in VC++ Pin
James R. Twine13-Feb-06 7:54
James R. Twine13-Feb-06 7:54 
Questionhandling larg number of data in CStringArray Object. Pin
zahid_ash13-Feb-06 6:41
zahid_ash13-Feb-06 6:41 
AnswerRe: handling larg number of data in CStringArray Object. Pin
toxcct13-Feb-06 6:49
toxcct13-Feb-06 6:49 
GeneralRe: handling larg number of data in CStringArray Object. Pin
zahid_ash13-Feb-06 6:52
zahid_ash13-Feb-06 6:52 
GeneralRe: handling larg number of data in CStringArray Object. Pin
toxcct13-Feb-06 6:54
toxcct13-Feb-06 6:54 
AnswerRe: handling larg number of data in CStringArray Object. Pin
Maximilien13-Feb-06 7:13
Maximilien13-Feb-06 7:13 
AnswerRe: handling larg number of data in CStringArray Object. Pin
basementman13-Feb-06 7:31
basementman13-Feb-06 7:31 
AnswerRe: handling larg number of data in CStringArray Object. Pin
David Crow13-Feb-06 10:27
David Crow13-Feb-06 10:27 
AnswerRe: handling larg number of data in CStringArray Object. Pin
Joe Woodbury13-Feb-06 17:51
professionalJoe Woodbury13-Feb-06 17:51 
QuestionTotal Commander in Visual C++ Pin
Adriana Frunza13-Feb-06 6:32
Adriana Frunza13-Feb-06 6:32 
AnswerRe: Total Commander in Visual C++ Pin
toxcct13-Feb-06 6:35
toxcct13-Feb-06 6:35 
GeneralRe: Total Commander in Visual C++ Pin
Adriana Frunza13-Feb-06 6:38
Adriana Frunza13-Feb-06 6:38 
GeneralRe: Total Commander in Visual C++ Pin
toxcct13-Feb-06 6:40
toxcct13-Feb-06 6:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.