|
Indeed. A real desperate way...
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
Being new to this, I have a very dumb question.
When calling a function that requires a list of options or flags, what do you pass if you don't want to use any of them?
For example:
FindText(FR_DOWN | FR_MATCHCASE, other arg here);
I don't want to use either of those flags, but passing 0, FALSE or NULL doesn't seem to work!
Thanks, and remember you were a newbie once too
|
|
|
|
|
what happens if you don't pass anything - don't even use the comma ?
|
|
|
|
|
stretchcoder wrote: When calling a function that requires a list of options or flags, what do you pass if you don't want to use any of them?
That all depends on what the function is expecting.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It all depends on what the person who wrote the function expected. By convention, the function SHOULD work with 0 as the parameter. However, some people force a non-zero answer by requiring you to send a default flag value in. If it is a library function (e.g. in MFC) look at the documentation and see what it expects. If you have the source for the function, look at what the function is doing and determine what value you should send.
stretchcoder wrote: Thanks, and remember you were a newbie once too
No problem ... but when I was a newbie, 99.999% of "simple" questions would receive the answer of "RTFM!"
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: when I was a newbie, 99.999% of "simple" questions would receive the answer of "RTFM"
Luxury.
When I was a newbie, they hadn't written the manual yet.
|
|
|
|
|
normanS wrote: When I was a newbie, they hadn't written the manual yet.
Same here. Usually that just mean they expected you to read the entire bookshelf at B&N before asking a question. Which, looking back on it, wouldn't be a bad thing to recommend to some people.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Why FALSE or NULL doesn't seem to work
|
|
|
|
|
I have an error message that says..
"Unhandled exception at 0x77fcc024 in MyApp.exe: 0x0000005: Access violation writing location 0x000000"
This error only happens in release. Can i use the location 0x77fcc024 to somehow find out where this is crashing. When i look at the call stack i get the general area, but cannot zone in on it.
Thanks,
|
|
|
|
|
If you only see it in the Release build, and don't see any memory violation warnings in the Debug Console for Debug builds, then your options are limited. First, check your project settings (specifically with regard to stack size) to make sure they are the same for both builds. Then, if you can narrow down the problem to a specific class or function, try to comment out then entire area and then slowly uncomment it to see when you see the problem.
Another option is also to put an __asm { int 3 }; line in the area you see this exception to spawn the debugger (you will want to compile your Release build with debug symbols unless you really want to debug assembly code though).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
|
Hi,
I'm create new store (.pst) in Outlook. There are two folders in it by default (Deleted Items and Search Folders). How can I delete this folders?
WBR, Rider.
|
|
|
|
|
Hi,
I'm trying to use Rob Manderson's article Capture an HTML document as an image to capture full site as image. The problem is that the CCreateHTMLImage class needs a size to work with, and it crops the image to that size. Since we have the html page loaded already, how can I get the *real* page dimentions from the browser/doc/html interface ?
Thanks
Yariv
|
|
|
|
|
Yariv wrote: how can I get the *real* page dimentions
HTML pages don't have 'real' dimensions; they size to fit their container.
|
|
|
|
|
but still, the web browser has scroll bars if needed. I tried to use the get_HWND() method to get the web browser window and to try and calculate its size by using the scroll bar info. Although I have found a lot of examples of using this method in the internet, in my app it fails to return valid HWND.
Any ideas ?
|
|
|
|
|
CDHtmlDialog or CHtmlView arent good for your program.
|
|
|
|
|
Each time when I plug in USB memory stick to the pc, there is a window (file folder for the USB drive) pops out. I have application to indicate whether a USB memory stick presents.I don't want this auto window to pop out. How shall I resolve it??
|
|
|
|
|
|
Yeah, it runs on XP. I've opened USB drive property and didn't find way to turn off autoplay. There are program options for different data stored in the USB drive. For example, if there is music stored in the USB drive, I can either pick windows media to play it or do nothing. I set all listed item with "No AutoPlay". But the USB drive folder opens up each time the USB drive is plugged into the PC.
The USB drive I'm using will only store files. I need windows to assign drive letter for it , but not to open the folder for that drive.
Please advise further
Thanks
Vicky
|
|
|
|
|
Drive's properties has AutoPlay tag where listed content types of music, video, picture, and the mixed. I seleted "Take No Action" for all of them and retried the USB drive. But each time when the USB drive is plugged into the PC, the folder automaticly is opened up.
|
|
|
|
|
I have unicode application developed on Win XP. I am trying to run it on Window98/ME. I could run the application successfully on Windows 98, by building my application with MSLU libraries. However when I try to run it on Windows ME, its crashing with the error that .exe is crashed in MFC42Lu.dll.
We have even tried to build the MSLU libraries and dlls on Win ME OS itself and use the same. However Unicode application will not start.
Do we need to do any particular modification in my application to get it run on Win ME?
Any Sample unicode application that runs on ME?
Any clues in this regard will be highly appreciated.
Thanks - Suyash
|
|
|
|
|
HAPPY FRIDAY!!!
In the ReadFile() function there's an option where you can set it to be overlapped (i.e. be used in asynchronous I/O operations).
If you want to be asynchronous you have to set the "Overlapped" struct's offset member...
However, it says that: "Offset - File position at which to start the transfer. The file position is a byte offset from the start of the file. The calling process must set this member before calling the ReadFile function. This member is used only when the device is a file. Otherwise, this member must be zero."
Here is where my confusion comes from...
I have a FIFO, from a device that I'm communicating with, which is 1K by 32-bit word large.
I need to make ReadFile() asynchronous because of speed constraints.
Can I set the "Offset" if I'm reading from a FIFO? Will FIFO be considered a "File" in this case?
The theory is to send an initial command to fill the FIFO upto 0x155 32-bit words. Then initiate ReadFile(). While this is doing it's thing I'm going to send another command that fills the FIFO with another 0x155 32-bit words. Then initiate ReadFile() on that set of words. While this is happening send a third command, issue a ReadFile()... After this go back and check to see if the 1st ReadFile() issued has completed, etc.
is this possible? or am I dreaming...
Thanks!
Kitty5
|
|
|
|
|
Are you opening up a serial port to use with ReadFile?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: Are you opening up a serial port to use with ReadFile?
I've created a handle to the device which is plugged in to one of the PCI slots.
The card is a PCI/Altera-485 LVDS card.
I'm trying to get data from the Xilinx's DMA FIFO.
-- modified at 10:49 Friday 11th August, 2006
Kitty5
|
|
|
|
|
This is just a guess, but I would imagine that the card would treat the FIFO like a buffer stream. That is, you will always be reading from the top fo the stream, so you would always pass in 0 to ReadFile.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|