|
Joe Woodbury wrote: Ah, but filenames can begin with a dot.
Of course, and I believe my comment accounted for that.
Joe Woodbury wrote: It's best to check the attributes...
Which is exactly what IsDirectory() and IsDots() does.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Sorry, misread your comment.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Use FindFirstFile() and FindNextFile() to enumerate the files.
There are articles here on Code Project, there are also Google and MSDN. Search!
|
|
|
|
|
Hi there,
I have a CWnd derived class that displays bitmap data in its client area using the BitBlt function of a compatible CDC object.
This works fine in the usual case on one PC.
However, if I run my application on a remote PC using WinXP's Remote Desktop, the client area of my display CWnd is not updated, it displays instead a copy of the underlying windows contents.
Debugging (via Remote Desktop) the drawing process does not yield any error in the following procedure I use for drawing the content of my CBitmap *pbMyBitmapToDisplay:
{
CPaintDC dcpaint(this);
CRect rClient;
GetClientRect(&rClient);
CDC dc;
if (!dc.CreateCompatibleDC(&dcpaint)) {
return;
}
CBitmap* pOldBitmap = dc.SelectObject(m_pbMyBitmapToDisplay);
dcpaint.BitBlt(0, 0, rClient.Width(), rClient.Height(), &dc, 0, 0, SRCCOPY);
dc.SelectObject(pOldBitmap);
}
Can someone please give me a clue what is causing the strange display behaviour via Remote Desktop?
Kind regards.
Juri
|
|
|
|
|
What function is that code in?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The code is within the OnPaint() message handler of the CWnd.
|
|
|
|
|
Cool, thanks.
I would suspect the bitmap is not compatible with the DC
so the SelectObject call is failing.
How is the bitmap created? What class is it?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark, your questions already contain the wanted clue
The bitmap is a class derived from CBitmap.
For creation I use the CreateBitmap(..) member.
I suspect you want me to use the CreateCompatibleBitmap(pDC,...) where pDC is a pointer to a CDC which is compatible with my CWnd derived object I use to display the bitmap? I will try this.
Thx again
Juri
modified on Thursday, September 18, 2008 11:31 AM
|
|
|
|
|
JuriB wrote: I suspect you want me to use the CreateCompatibleBitmap(pDC,...)
If you're going to use a device dependent bitmap, then yes,
it HAS to be compatible with the device. If you choose to use
CreateCompatibleBitmap(), make sure you use the paint DC, not
the compatible DC (otherwise you'll get a monochrome bitmap).
For an alternative, use a DIBsection bitmap instead of a DDB.
You can select a DIBSection into a non-compatible DC.
For a DIBSection, use the CImage class instead of CBitmap.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Problem solved.
I have switched to drawing via a CImage object. This works fine now also when the application is run over Remote Desktop.
Thanks for your help Mark
Best regards
Juri
|
|
|
|
|
JuriB wrote: This works fine now also when the application is run over Remote Desktop.
Cool Thanks for the update!
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi!
Does anybody use CEGUI(Crazzy Eddie's Graphical User Interface) here? CEGUI site( is down? I've some doubts. Where can I get a guidance regarding CEGUI?
|
|
|
|
|
|
I'm getting some errors in VS2008 while they dont happen in VS 2006.
There are three projects
1. dll project
2. library project
3. exe project
Second(library) and third(exe) projects use some functions of first(dll) project. Second(Library)is also used by third(exe) project.
During building second(Library) project i dont need to include
first(dll) in project settings under additional dll option in linker because i include this dll(dllname.lib) in project settings of third(exe) project.
When i build first, second and third(exe) projects in VC6 they are builded successfully without any error.
While if i build them in VS 2008(vc9) first and second build successfully while third(exe)gives some errors "unresolved external symbols".
These are the errors of those function of first dll which are used in second(library) project. But since i have include this dll in project setting(under linker) in exe project so linker should search their definitions here. I'm surprised why it's happening. I have set the option enable incremental linking in project settings of second and third projects.
Please suggest any solution.
|
|
|
|
|
|
I have tried all options under linker settings but unable to solve the error. Please suggest which option you want to change
|
|
|
|
|
The linker errors state what symbols are unable to be resolved.
What are the errors?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
error is described below
error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl operator >>=(class MyNamespace::MyClass const &,char const * &)" (__imp_??_2@YA_NABVMyClass@MyNamespace@@AAPBD@Z)
fatal error LNK1120: 1 unresolved externals
In dll project, there is one namespace MyNamespace which contains a class MyClass and the definition for >>= operator.
Library project create object of MyNamespace::MyClass and use >>= operator.
|
|
|
|
|
MKC002 wrote: In dll project, there is one namespace MyNamespace which contains a class MyClass and the definition for >>= operator.
Are you exporting that class from the DLL so it can be imported
in the app build?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi Experts
I am reading a 7GB File line by line and i need to write some of it's contantants into two files of 9MB and 6MB in a function, for reading and writing i am using a while loop,but my application is not writing the complete OUT-PUT Files. it seems my application is not able to read the complete In-Put File.
My System has only 256MB of RAM and hardly 8 GB Free space in my Hard disk.
so can anybody tell me what could be the reason?
Thanks in advance
RYK
|
|
|
|
|
Take a look here
Thank you masters!
|
|
|
|
|
But Dear i m not using MFC or SDK
|
|
|
|
|
You are suggesting that he memory map a file... a file that is more than twice his available address space...?
Peace!
N.B. While we do have a 4GB address space on Win32, only 2-3GB of it can be considered available, and even that takes some doing...
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
VC_RYK wrote: it seems my application is not able to read the complete In-Put File.
My System has only 256MB of RAM and hardly 8 GB Free space in my Hard disk.
so can anybody tell me what could be the reason?
Are you storing anything other than the current line? If not, I can't imagine RAM or disk space having any relevancy.
Can you provide a code snippet that exhibits the problem?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|