|
There is a function
MakeSureDirectoryPathExists(PCSTR Pathname)
This function however is located in dbghelp.dll which you can /nedd to distribute with your application. for more information have a look in MSDN Platform SDK
cheers
Rainer
|
|
|
|
|
I use this:
#include <io.h>
BOOL FileExists(CString fn)
{
BOOL exists = FALSE;
if (!fn.IsEmpty()))
{
int status = _access((const char*)fn, 0);
if (status == 0)
{
exists = TRUE;
}
}
return exists;
}
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Is there any way when using CInternetSession OpenURL to tell if the file requested is not found. I am using the following:
CInternetSession session;
CStdioFile *remote = session.OpenURL(url,1,INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);
No matter what I send as a url if it is a valid address the remote file is opens with no errors as far as I can tell. Problem is in place of the file I want to download what I am getting is the default page sent by the server when a file cannot be found. Since I am replacing a critical application file this can be big troubles.
Is there a solution or a better way to get files in the background.
Thanks
Richard
If you pick up a starving dog and make him prosperous, he will not bite you. This is the principal difference between a dog and a man.
- Pudd'nhead Wilson's Calendar
|
|
|
|
|
I have a class with an abstract member function-
virtual void foo( obj& ) = 0;
and I have implemented this in the derived class. However, whenever I try and call a member function (which incidentally is derived from the base class publically also) from within the derived class one, I get an error message that the this argument (which I understand is passed implicitly in any member function call) discards qualifiers. Im not sure what im doing wrong and what these qualifiers are even...
thanks in advance,
Chris M
|
|
|
|
|
It would help if you post the code and the error message. It's probably talking about "CV-qualifiers" which means "const" and "volatile". If you call a method that specifies a const this pointer, you can't then call another method that doesn't have a const this. For example:
class xyz
{
int nonconstthis() { return 1; }
int constthis() const { return nonconstthis(); }
};
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Hi all, having succesfully created/loaded a 24-bit DIBSection and managed to access "the bits", I now need to display it transparently. The program loads a DIBSection from file (so say a photo), and I want to then draw another 24-bit DIBSection over it. However, using BitBlt it just copies the bitmap over it (obviously since I use the SRCCOPY flag), black background included, and you can`t see the photo anymore. Having looked at Christians article I tried using the following code to incorporate TransparentBlt :
HBITMAP hOldBitmap = (HBITMAP)dcMem.SelectObject(bm);
TransparentBlt(pDC->m_hDC,0,0,bm.bmWidth,bm.bmHeight,dcMem.m_hDC,0,0,bm.bmWidth,bm.bmHeight,0);
dcMem.SelectObject(hOldBitmap);
dcMem.DeleteDC();
However, I get the following error message:
BitmapView.obj : error LNK2001 : unresolved external symbol _imp_TransparentBlt@44
Debug/Dissertation.exe: fatal error LNK1120:1 unresolved externals
Error executing Link.exe
Dissertation.exe - 2 error(s), 0 warning(s)
Also, I have noticed in the MSDN that TransparentBlt should only be used with 4 or 8 bit bitmaps, and have tried using AlphaBlend, which is supposed to be for 32-bit bitmaps, but I get a similar message. Can someone please tell me where me or my computer are going wrong? Much appreciated.
Alan.
P.S. Any chance you know how to initialise a 24-bit DIBSection so that its background is white, not black? (Without iterating through "the bits") I`ve asked this question a couple of times, no-one seems to have a clue.
AEGC
|
|
|
|
|
TO make it white just select the DIBSection into a CDC and bltblt onto it using WHITENESS instead of SCRCCOPY.
My code for TransparentBlting is called TransparentBltU, you're trying to use the standard windows function, and for some reason you're finding the header but not the library. I assume you're talking the code from WDJ. Internally that function shows how to generate a mask on the fly.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
How do i get the library? do i have to re-install it? Would you mind if I used an implementation of your code from the WDJ site? (I was talking about that - couldn`t remember site name off top of my head though).
Cheers for the response, again, Christian,
Alan.
AEGC
|
|
|
|
|
HI.
I´m developing a database application using ADO and, although it´s a large program i don´t want to use more than 2 or 3 open connections.
The problem is that i can´t define a global connection pointer, right now, i can only make it work creating a new con in every cpp file.
I´ve tryed defining a global pointer in every way i know but I´m allways getting memory or even weirder errors.
Can anyone help me out?
Pedro Besteiro
LSI systems integration
|
|
|
|
|
Global variables are the work of the devil, but if you must, the best way is to make it extern in stdafx.h, and declare it in stdafx.cpp. Assuming you're using MFC, I'd put it in CMainFrame, because a pointer to that class is so easy to get ahold of from anywhere in your application - CMainframe * pMain = dynamic_cast<CMainFrame*>(AfxGetMainWnd());
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I want to lock Internet Temporary folder. Don't permiss IE save any file to this folder!
If you have any infor please show it for me!
|
|
|
|
|
I have not tried this out. But you could rename it temporarily and then rename it back. Poor IE wont be able to write into it, because it won't exist. But you never know, perhaps it will create it again.
Nish
|
|
|
|
|
If you're using NT, you should use NTFS. If you are using NT and NTFS it's obvious: Don't give anyone but "System" any access whatsoever to the temp folder.
Please report how hard MSIE crashed.
/Mike
|
|
|
|
|
- How to modify the color of the caption of a button(not including the background of the button)?
- Regards,
Maer
|
|
|
|
|
Two ideas:
- handle WM_CTLCOLORBTN (MSDN: "By responding to this message, the parent window can set a button's text and background colors")
- use ownerdraw buttons (see BS_OWNERDRAW )
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
- Thanks, Paolo pal!
- I have never used "WM_CTLCOLORBTN" before (even not heard it). Since I am a newbie, can you show me an example?
- Have a nice weekend,
Maer
|
|
|
|
|
See this link:-
http://support.microsoft.com/support/kb/articles/Q130/9/52.ASP
WM_CTLCOLORBTN is not valid anymore.....
p.s. I first put this in the wrong thread...
|
|
|
|
|
See this link:-
http://support.microsoft.com/support/kb/articles/Q130/9/52.ASP
WM_CTLCOLORBTN is not valid anymore.....
|
|
|
|
|
- Thanks for your URL, Nish pal!
- I have never used the messages before, can you show me an example about the useage?
- Have a nice weekend,
Maer
|
|
|
|
|
- Sorry for interrupting again, Nish pal!
- I still have a question. After reading the article you introduced to me, it seems that we can not use these messages now. Are there any other methods to change the color of the caption of the button?
- Have a nice weekend,
Maer
|
|
|
|
|
see this link
http://www.codeproject.com/buttonctrl/cbuttonst.asp
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
- Thanks pal!
- The article will be great help to me.
- Have a nice day,
Maer
|
|
|
|
|
- Please help!
- Regards,
Maer
|
|
|
|
|
Is it possible to create a window that will render HTML, something like internet explorer. As our product is dependant on the version of the common controls dll that comes with IE5 I know IE5 will be installed so can I actually use the 'Internet Explorer_Server' window class. I am restricted to the Win32 API so the MFC solutions such as CHTMLView are not available to me. Any information you can provide would be greatly appreciated.
Steve.
|
|
|
|
|
I need my program to register itself as a service
I tried (RegisteSrviceProcess)
but it doesn't work with Win2000
so I need a way to do it (way that works with Win2000)
thanks in advance
MR.Byte
|
|
|
|