|
You might need to install the Platform SDK.
It updates your headerfiles to newer versions...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
How to check out whether a file is existing?
Thanks.
Maer
|
|
|
|
|
You'd use the FindFirstFile() Win32 API function. Assume pstrFile is a pointer to the string filename below:
WIN32_FIND_DATA findData;
HANDLE hFile = FindFirstFile(pstrFile, &findData);
bool bExists = (hFile != INVALID_HANDLE_VALUE);
If the handle returned by FindFirstFile() is INVALID_HANDLE_VALUE, the file doesn't exist.
|
|
|
|
|
Try this:
BOOL FileExists(CString* fn)
{
BOOL exists = FALSE;
if (!fn.IsEmpty())
{
int status = _access((const char*)fn,0);
if (status == 0)
{
exists = TRUE;
}
}
return exists;
}
|
|
|
|
|
Hi, Simmons.
Thanks for your codes pal.
Best regards.
Maer
|
|
|
|
|
Hello!
When You/I create an standard MFC application it will insert an icon for the app, the wellknown MFC icon. If I start the program then the icon will have the same background color as the 'Window banner' (if you are using the standard colors). If you change focus to an another program then the 'banner' will get 'grey' but the icon will still have the same background color (darkblue).
I see in other program, e.g. Visual Studio, that the background color of the icon changes not only when focus change but also when changing the Windows color scheme.
How do they do this??
// Anders
|
|
|
|
|
> How do they do this??
With trasparent background!
MFC Icon is not transparent at all...
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Don't you think that everything is easy when you know how
OK, then I need to get me an Image editor that can create transparant backgrounds
Thank you very much for the answer!
// Mike
|
|
|
|
|
Yep, but you can use VC++ resource editor too!
To select the transparent color, click on that dark-cyan little screen icon in the color palette. The magenta one is for inverted background.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
I always try to learn at least one new fact a day. Now I have learned two things already! I think I need to take the afternoon off
Thanks again!
// Mike
|
|
|
|
|
Hi
I am interested in transferring a File ( upload & download )
using Http Protocol. This computer is connected to the
Internet via proxy.
I am trying to use WinINet.dll. Can some one guide me, whether I am on the right course or if there are free
libraries available to do the same.
Regards,
SanskyPotov
SanskyPotov
|
|
|
|
|
It's easy to download a file using Wininet.
I'm not so sure about upload. I guess that you could post the file to a webpage, and from that webpage you could store the RAW data that was posted, and save them to a file.
I have never tried, but it might work.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Woops, to answar your question...
I think that Wininet is okay for HTTP. It's easy to work with, and seems to be working just fine
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Is there a way to end a keyboard data entry with a carriage return? The CEdit control does not recognize a carriage return. You must enter the information and click some other control to process the input. The OnEditChange Message intercepts each character. I need to wait until the entry is complete, then begin processing the data.
All help appreciated.
Richard
|
|
|
|
|
|
If this is a single-line edit, you'll have to handle two messages:
1) WM_GETDLGCODE - return Default() | DLGC_WANTALLKEYS
2) WM_KEYDOWN - handle VK_RETURN to process whatever you want.
Without (1) your edit control will not receive WM_KEYDOWN when Enter is pressed.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
What I want to do is this: I have a toolbar that has a 'zoom' button on it.
Since my software includes all kinds of zooms, I want to open another toolbar
right next to this button, if this button is pressed on a little bit longer.
The 'popup' toolbar will include all the other kinds of zoom buttons. The user
will be able to choose the kind of zoom while the left button is still pressed. Ofcourse that toolbar should be closed when the left button is up again. You can see those kinds of 'popup' toolbars in 3D Studio MAX, AutoCAD
and I think also Photoshop. I'm using MFC, but Win32 is also good.
Does anyone know how to do this?
Thanks.
|
|
|
|
|
What you want is a Drop-Down button. If you search MSDN for drop-down button or TBSTYLE_DROPDOWN toolbar style you should find some information.
|
|
|
|
|
I am building an application which has similar (limited ) functionality to an art package. The main screen is a grid with different bitmaps that are loaded dynamically to form maps. As well as this main screen there is a floating tool window (which at the moment is empty), that I want to house the bitmap palette, a bit like a colour palette in a normal art package. The map's use a lot of different bitmaps and so I have included a menu on the top of the tool window dialog so that different palettes will be able to be loaded. Another thing I wish to implement is a scroll bar in this tool dialog, again because there are going to be a lot of different bitmaps available.
What do people suggest I do to handle the selecting of different bitmaps on the tool window. At the moment I am trying to implement them using buttons with bitmaps instead of text, problem with this is that I cannot find any examples of dynamically loading these bitmaps from files to go on the button, just resources. Is there a better way of doing things with this tool window than this?
Any suggestions will be greatly appreciated
Nick
|
|
|
|
|
If you have BMP files, you may use LoadImage() to load the bitmaps from file.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Im sorry that i have to make a new tread about my problem but i spent 25 Hours trying to pass a parameter to this stored Procedure in C++:
Alter Procedure URBAN
As
Declare @pkMbtID varchar(50)
INSERT INTO MBT
(pkMbtID, MbtType)
Values (@pkMbtID, '122')
return
I have tried with both CreateParameter and Refresh Method, but i only the error 0xE06D7363. I read about this and tried to do what microsoft say about this, but it aint working
But after a long thought i realized that the stored Procedure cant be stored in the database. I must have the stored procedure in the ATL ADO COM object, anyone here who can give me an example of this before i spend another 25 Hours on something that can be solved easy.
I be very grateful for tips!
|
|
|
|
|
What db are you trying to use? What do you mean the stored proc can't be stored in the database? And why did it take you 25 hours to figure this out?
Another questions is why you are using ADO with C++, OLE DB would be a better choice. IMHO.
Have you tried using a command string to send everything directly?
|
|
|
|
|
If i want to change the Stored Procedures i have to change in the database, its a MSDE database.
I cant change there because the laptop ain't having any administration tools to the MSDE database. So if i want to change the database interface i just produce a new dll file.
OLE DB
I started with this and after a couple of weeks i gave up. To code there aint easy accessing multiple tabels etc... ADO is one level upp making it easy with stored procedures.
A question have you done any advanced application in OLE DB?
I even mailed Len Holgate about my problem with OLE DB and he said:
"I think some of these problems are so hard to solve that when people do
manage to solve them they want to get away from them as quickly as
possible..."
So now i made a stored Procedure inside the ADO code but the error
Unhandled exceptio in CH03.exe(KERNEL32.DLL): 0xE06D7363
is coming up.
Thanks for the tip anyway but i really hate OLE DB coding with ATL
|
|
|
|
|
There was another discussion comparing ADO and OLE DB. In general if you are using C++ ADO is not the best choice, OLE DB gets better performance and less overhead.
Have I done any advanced application in OLE DB?
Yes. The last one was ATL based that used OLE DB to connect to a DB2 database and drive a website using Netscape iPlanet. It used stored procedures, XML formating, updates, insertions, refreshing. How's that?
The only problems I had were that the staff (I was consulting) had absolutly no knowledge of DB2, stored procedures, or Netscape. Talk about a challenge. Idiots spent thousands on software they didn't even know how to use when they had NT with IIS and Oracle.
Doing OLE DB with ATL is much better than trying it raw. If I'm using C++, ADO doesn't even enter my mind.
To each his/her own.
|
|
|
|
|
OK, as you have notice im a beginner at this.
How should i store the stored procedure in the ATL Com object?
Maybe you could send me some cod for this or a link.
I will describe my Problem her again so that is no missunderstanding:
I have this Stored Procedures:
Alter Procedure URBAN
As
Declare @Name varchar(50)
INSERT INTO MBT
(Name, MbtType)
Values (@pkMbtID, '122')
return
I want a COM object(dll file) that produce a function who i can put the parameter @Name in.
Another C++ application vill call this dll file and choose a function(ther vill be about 10 diffrent stored Procedures and 10 diffrent funtions in the dll file)
Thanks alot
|
|
|
|