|
File and directory names are Unicode strings and many (most) non-MS apps don't handle them properly.
The Unicode version of openfile dialog can handle 32K characters for a path name while the ANSI version does ~260. This is a good reason alone to always use the Unicode version. Another is if someone uses a non-European language for a directory name.
My question is how can this be done and still have the app work on Win98/ME ?
If an MFC app is built with the Unicode setting on, does one need to install the "Unicode layer" dll's onto a Win98/ME machine?
I thought that I checked and MFC, even when set to Unicode, still limits paths to MAX_PATH. Is there a standard solution?
Is there any advantage in making just the file handling portion of the code wide character?
|
|
|
|
|
search MSDN for "Microsoft Layer for Unicode".
you need this to be able to use UNICODE on win98 and Me.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Richard O. wrote:
...the ANSI version does ~260. This is a good reason alone to always use the Unicode version.
Is this a problem? I'm wondering when 260 characters would not be sufficient for a path/file name. I don't work with UNICODE so my view is a bit jaded.
|
|
|
|
|
The 260 char limit causes me grief when working with shared files on our dept. server. There are lots of files in a highly structured organization.
Adding the UNC name, share name, the long folder names and file names- it would often go beyond what the file utility I used could handle.
(Besides, there is a newly disccovered flaw in some anti-virus programs. They also can not go beyound 260 character paths, so virus infected files can hide in deeply nested directories.)
Richard
|
|
|
|
|
>>> .NET
www.cydoniasoftware.net :: .NET & Macromedia
www.cydoniasoftware.net/watcherdemo :: ASP.NET & ORACLE
www.cydoniasoftware.net/helpdeskdemo :: ASP.NET & SQL Server
>>> Other new technologies from Cydonia...
www.008DesignLab.com
www.RealVideoTV.com
www.InfinityWebHosting.net
www.Century21centralamerica.com
www.ConexionVIP.com
|
|
|
|
|
Try this code:
void HandleSpam(CMessage *pMessage)
{
CSpamMessage *pSpam = dynamic_cast<CSpamMessage *>(pMessage);
if(pSpam)
{
AfxMessageBox("Please do not post Spam in the forums");
pSpam->SetPostRating(1.0);
}
}
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
Hey, that really works!
"If you just say porn then you get all manner of chaff and low grade stuff." - Paul Watson, Lounge 25 Mar 03 "But a fresh install - it's like having clean sheets" - C. Maunder Lounge 3 Mar '03
Jonathan 'nonny' Newman
Homepage [www.nonny.com] [^]
|
|
|
|
|
Your implementation has memory leaks. pMessage is created in a seperate thread and should be deleted.
this would be the preferred solution:
void HandleSpam(CMessage *pMessage)
{
CSpamMessage *pSpam = dynamic_cast<CSpamMessage *>(pMessage);
if(pSpam)
{
AfxMessageBox("Please do not post Spam in the forums");
delete pSpam;
}
}
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Build : warning : failed to (or don't know how to) build 'D:\Projects\MyProj\Debug\MyProj.pch'
It builds in "release" mode! I can't find anything different in the settings! (save for optimization and debug info) Any ideas?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
The pre-compiled header is missing. Rebuild everything and you should be ok.
|
|
|
|
|
I get this error on "Rebuild All"
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
All your source files are setup to use the PCH file but non are set to actually build it.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I have gotten this from time to time. Eventually it aggrivated me to an extent that I just changed my project settings.
In Pre-compiled headers, set it to "Automatic" (for all configurations.) Then you will never see this error again.
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
How can I get Hardware Information via DMI ? Are there any examples in which case I can use DMI with Visual C++ ?
thnx,
Sendel
|
|
|
|
|
Use WMI to get what you're looking for. DMI is in a protected low-memory area of the bios and Windows won't let you get at it without writing a device driver to the best of my knowledge.
|
|
|
|
|
I have no idea why. When I create a new SDI or MDI MFC-Application, compile the wizard generated code, open the aboutbox -> crash
It also crashes even if I want to display a simple messagebox.
Would be nice if someone could help me.
|
|
|
|
|
It's hard to help debug without examples of code.
Kuphryn
|
|
|
|
|
It even crashes with the wizard-generated code.
New project. SDI and disabled ActiveX the rest as default. Compile and try to open the aboutbox
I know that he crashs at:
CAboutDlg aboutdlg;
aboutdlb.doModal(); <-- crashes in this function.
I also checked some "learn c++"-example apps and they also crashed when I opened the aboutbox.
I don't understand why it works in dialogapps and not in SDI.
|
|
|
|
|
Try to debug it and check what the debugger stops at when the crash happens. VC6? Have you installed the service packs? What system do you run?
Regards,
BB
|
|
|
|
|
I'm running WinXP and VC.Net
The closest point I could trace the crash is in dlgcore.cpp
in the function CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,CWnd* pParentWnd, HINSTANCE hInst)
at the end of the TRY-part
// create modeless dialog
AfxHookWindowCreate(this);
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate, <- here it crashes
pParentWnd->GetSafeHwnd(), AfxDlgProc);
I don't understand why this function works when the mainwindow opens but crashes when another window is openen like the aboutbox, a dialogbox or just a simple messagebox.
Is there another way to open dialogboxes? Or am I the only one with this problem?
|
|
|
|
|
1. Is hInst an appropriate module handle?
2. Is lpDialogTemplate valid?
3. Is parent non-NULL and also valid? (!!!)
If so, send me a sample project pls.
mail@BartoszBien.com
Regards,
BB
|
|
|
|
|
Im working on a dialog based application. I need use of the arrows keys, but when I add handlers for the keydown events, they are already being handled, so when I use the arrow keys, it only changes the focus to the next button in hte dialog. How do I overide the use of the arrow keys?
Dean and Roy Suck...
Kevin Shaffer
Student of Computer Science
University of Kansas
kshaff03@msn.com
|
|
|
|
|
|
Override CYourDialog::PreTranslateMessage .
Regards,
BB
|
|
|
|
|
Is there a way to open the WinSta0 (default window station) of a specific Terminal Services session?
Specifically, my problem revolves around drawing a System Tray icon in the correct tray whenever a user switches sessions (i.e. in WinXP using Fast User Switching). If I just use the currently open window station, the tray icon does not get drawn. Since there is no way to tell the Shell_NotifyIcon which session to draw in, I need to open the window station of the correct session and have my process use that station instead.
Any ideas?
thanks!
|
|
|
|