Go to your MSDN CDs, or msdn.microsoft.com (typing URL from memory) and get the latest SDK for the windows shell. It'll replace your shlobj.h file and provide the new values that you need to have defined. You might also have to add WINVER=0x0400 in your settings - if you are using a feature that says Version 0.4 - you want 0x0400 for 5 you want WINVER=0x0500 I was puzzled by this too at first. FYI you can just plug in the values instead of relying on the defines and you'll be okay. Hope this helps: #define BIF_RETURNONLYFSDIRS 0x0001 // For finding a folder to start document searching #define BIF_DONTGOBELOWDOMAIN 0x0002 // For starting the Find Computer #define BIF_STATUSTEXT 0x0004 // Top of the dialog has 2 lines of text for BROWSEINFO.lpszTitle and one line if // this flag is set. Passing the message BFFM_SETSTATUSTEXTA to the hwnd can set the // rest of the text. This is not used with BIF_USENEWUI and BROWSEINFO.lpszTitle gets // all three lines of text. #define BIF_RETURNFSANCESTORS 0x0008 #define BIF_EDITBOX 0x0010 // Add an editbox to the dialog #define BIF_VALIDATE 0x0020 // insist on valid result (or CANCEL) #define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize // Caller needs to call OleInitialize() before using this API #define BIF_USENEWUI (BIF_NEWDIALOGSTYLE | BIF_EDITBOX) #define BIF_BROWSEINCLUDEURLS 0x0080 // Allow URLs to be displayed or entered. (Requires BIF_USENEWUI) #define BIF_UAHINT 0x0100 // Add a UA hint to the dialog, in place of the edit box. May not be combined with BIF_EDITBOX #define BIF_NONEWFOLDERBUTTON 0x0200 // Do not add the "New Folder" button to the dialog. Only applicable with BIF_NEWDIALOGSTYLE. #define BIF_NOTRANSLATETARGETS 0x0400 // don't traverse target as shortcut #define BIF_BROWSEFORCOMPUTER 0x1000 // Browsing for Computers. #define BIF_BROWSEFORPRINTER 0x2000 // Browsing for Printers #define BIF_BROWSEINCLUDEFILES 0x4000 // Browsing for Everything #define BIF_SHAREABLE 0x8000 // sharable resources displayed (remote shares, requires BIF_USENEWUI) --Mark Terrano
Mark Terrano
Posts
-
SHBrowseForFolder and BIF_NONEWFOLDERBUTTON -
Application terminated without error messageI'd guess stack overrun too - its fairly easy to do, and can happen if you pass bad values to some windows functions. Step through your program when you get to the 'bad' area (or use logging, with a flush after each write to your log file) and check carefully around the last thing you did. Check for mismatched parameters on your Calls to the DLLs - its a risk area. --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
Adding more than 32,767 items to a CListBoxStore your own array of items, then use a small list box to display a selected number of them. Use your own slider control and fill the 10 or 20 or however many you are displaying from an index into your own array. Its probably faster anyway. --Mark Terrano
-
Please help !!!You didn't say what your solution was? I was going to guess you had accidentally switched Release and Debugging mode switches - I got surprised by that one time (was exporting the debugging version over the release one) --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
How to Browse for a Directory?I'll ride on this topic with mine...on the off chance the original poster is using WinXP :) http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=80917&fr=176&df=2&app=50#xx79842xx :confused: --Mark Terrano
-
hardware accessMaybe you can just post some more details about the kind of hardware you are going to interface to and the communication to it. Different ways to talk over the Com port, USB, Keyboard, etc. If your question is a general one about how to interface with some sensors - look at companies like Home Automation Labs and X-10 - who have some inexpensive up to professional sensors that are designed to be connected to PCs. There are lab automation application applications of all kinds that are designed to do real-time processing of sensor data and feed other applications clean data, do logs, etc - and you can pick one to interface to an API with C++, VB or your langage of choice. Good luck - post details if you need additional help. --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
RS232 Comms with WideTrackNot sure if I understand the original question exactly or not, but etting the UART to the minimum might be a problem if he can't service the comm before the next character comes in - with Windows this is probably a fairly likely thing and the reason there is a buffer there - it will just be overwritten. You can probably get away with it if the speeds are low - but it seems like you are asking for compatibility problems (i.e. it fails a lot with Winmodems or Cable Modems) if you do this. Can you read the bytes into an intermediate buffer, throw your error if and when you need to, and only pass clean (that pass your test) bytes on to the application? --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
InteractionIf you're just creating the page, then you can generate HTML as text, and save the file out. Write your HTML to the file just like you would do if you were hand editing (or make the HTML with your favorite editor, view it in Source, and cut and paste this into your program. Substitute your dynamic content, and just write the .HTM file like you normally would. Couple tips: I added an HTML line to cause the page to refresh every 5 minutes to show the most recent data automatically - it might be useful for your ladder page. I found it useful on the page to substitute the default quote " as a parameter for single quotes - this stopped me from having to define all my commands with a lot of SIZE=\"%d\" etc. I could just do SIZE='%d' COLOR='%X'etc. --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
a question about check boxTry using BOOL instead of bool for your variable. --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
VSS maintenanceThis might be news: But you can get corruption in a stable network with Win2000 clients throughout. It just happens sometimes. What has seemed to help sometimes is to just get everyone out of the VSS pool. When we have the most problems are when lots of people have things checked out keep VSS/VCC with VSS up all the time (i.e. during Crunch). Sometimes just having everyone exit will let VSS fix itself, and occasionally the Admin gets us all out and does maintenance on a Saturday.
-
SHGetPathFromID under WinXP vs Win2000Problem: Code working for a long time under WinME/2000/98 does not work under WinXP. Little function to pop up a dialog box and allow the user to pick a folder (or file) which is returned as a CString. I get back the wrong value if user creates new folder or types non-existing folder into box. What I'm looking for: Function to pop up dialog and get back existing or new folder as specified by user. Symptoms: Works just as I would expect it to under Win98/ME/2000. Under WinXP if the user creates a folder, or types a new folder into the edit box I get back a reference to their user directory. (Please excuse a bit of 'debugging mess' I'm still trying to figure out what is going on). Also, there are some header files that I don't have the latest versions of, being limited to VC6 with all patches (so you can ignore my comments about BIF_USENEWUI - which is documented but appears at some later point I think). I didn't see any KB articles related to WinXP for either of my two functions-in-question. Any help would be appreciated! --Mark -----My Test Code------ CString CXpgetfoldercheckDlg::getFolderName(CString title, bool requireTrailingBackslash, bool allowNewFolders) { // PURPOSE: // Uses latest UI to get a folder name. // PARAMS: // title = the title of the browse dialog. // rquireTrailingBackslash = true if you want the last character of the folder to be '\' (default t) // allowNewFolders = true if you want a 'new' button to appear on the dialog (default t) // RETURNS: // valid folder name if successful or NULL if not // REQUIRED: // IE 5.0 on up, or Win2000 on up // STEPS: // Bring up a common file dialog, // Allow the user's to select a folder name // Close the dialog // // KNOWN BUG: Problem with WindowXP (11-2-2001) - typed-in filename (i.e. new file name) returns the // user's mydocuments folder. // Results with the following settings // info.ulFlags = BIF_RETURNONLYFSDIRS | BIF_EDITBOX; BROWSEINFO info; ITEMIDLIST *list; HRESULT ret; DWORD dwCoInit=COINIT_APARTMENTTHREADED; ret = CoInitializeEx(NULL,dwCoInit); if (ret == S_OK || ret == S_FALSE ) TRACE("CoInitted\n"); else { return "ERR: Failed CoInit"; } //info.ulFlags = BIF_RETURNONLYFSDIRS | BIF_USENEWUI ; //new // Where are these? // BIF_USENEWUI // BIF_NEWDIALOGSTYLE //FIXME: Could not get the various header issues to work, so I just added the param values
-
Q: Security Attributes on Files- I'm using CopyFile, which does what I need, but it does not copy the security attributes of the file (owner information particularly). I've rooted around in the documentation, but cannot seem to find how I can set the file security attributes of the copied file to match source file. 2) Also, I'd like to know how to set a file to 'my' owner name when I've copied it to a local machine. (Hopefully Q:1 will answer Q:2) I'm hoping there is something easy and obvious I've overlooked. If you can point me to the right name I'd appreciate it. Thanks in advance!:-O --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
Visual C++ Help hangsSame here. One time after a crash this behavior started and my only remedy was to reinstall MSDN. After which everything worked fine (I did try recreating my project dynamic files, etc). --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
How to list a file in a particular directory?Let your function take a starting directory as a parameter (that you pass to FindFile). Then if you are looking at a directory in your list (IsDirectory()), call your own function with the parameter of the current directory. You will then recursively go through all of your files. A common 'add' function in your application called from your find routine will let you gather them all up. --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
Strange behavior from CRecordsetI had this problem and it turns out I was trying to add data to an SQL generated record ID (specified in the table to be sequential). So my updates worked, but my inserts always failed - the table wasn't readonly, but the field threw that exception when I put data in it. Hope this helps - I know how frustrating it can be. --Mark Terrano
-
How can I get TextToSpeech API's?http://www.microsoft.com/speech/ Tons of documents, downloads, and links from there. Good luck.
-
Opening/Editing a simple text fileIf you're using MFC, just (typing from memory here, not pasting - so excuse any typos -the help for CFile::Write has examples I believe) ----- CFile savestring; savestring.Open("Myfile.txt", CFile::modeWrite); size = myString.getLength()+1; //use whatever you need. Not sure if buffer rqd. savestirng.Write( myString.getBuffer(size), size); savestring.Close(); If you have a format for the line, you can just as easily write out your storage class in the 'Write'. CArchive seemed like more of a hassle than just writing things out myself - I messed with it for awhile but had problems with the arrangement of the various macros for Implement_Dynamic and whatnot. --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
Fingerprint scanningWe have fingerprint scanners as our office entry doors. They work well - though the software application supplied by the vendor to program the door units is a bit weak (the print identifiers are locally downloaded to the units). Authorize time is < 2 seconds. There are a couple of different single-PC fingerprint devices that will unlock a particular PC and type in your password to standard windows logons on the market - let me know if you have trouble finding them - at $100 or so for a single PC, its a pretty reasonably priced thing to try for yourself. --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
REQ: VSS Plug-in for trackingThere was a vendor that had a VSS add-on that would do automated and detailed reporting. So you could track changes by developer, by file type, etc. I'm especially interested in automatic notification and difference reporting by file type. I believe I originally saw the product advertised in Doctor Dobbs Journal, but am not able to find a current advertisement for it. If you happen to know the product or vendor - or an alternate product or strategy to get the above info - let me know. --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)
-
Want Easy E-mail for automated processWhat I'd like to do is send a simple text e-mail message using whatever default mail settings the user has already set up on their machine with an easy call like: CreateEmail("User@Somewhere","A Subject Here","Here is the important thing I wanted to send"); I'm writing an MFC app - and heck I can even assume Outlook or Outlook Express will be installed on the user machines if that makes the solution easier. W98, W2K or NT4 are the OS's I need to work with. :confused: What is the easy way to do this - if every virus kid in the world can figure it out, it has to be easier than using 40 lines to talk to MAPI or the other partial solutions /examples I've seen so far. Somewhere I think I must just not be looking for the right function call. Thanks! Mark Terrano