|
Hi,
I guess you are trying to move back to 35 position from the word.
I suggest donot use such logic and a constant value how you get the value 35, won't it be 34 or 36.
Ok I think the resolution is ,when negate the streampos, take care the effective value is not less than 0
i.e *it = (*it - 35) < 0 ? 0 : *it - 35;
Then I think the "it" has the word position, hence "*it-=35" will change the correct position of word, use temporary variable
ie;
seekg((*it - 35) < 0 ? 0 : *it - 35);
|
|
|
|
|
What is the sort order used by _findfirst / _findnext when finding files in a directory? MSDN says _findfirst finds the FIRST INSTANCE of a file matching the given mask, but doesn't define FIRST INSTANCE. If this is an attribute on the directory, is there any way to change it before traversing the directory for files? I need to process each file the directory in FIFO order.
Thanks.
|
|
|
|
|
FIFO order relative to what?
From the docs: "The order in which this function returns the file names is dependent on the file
system type. With NTFS and CDFS file systems, the names are returned in alphabetical order. With
FAT file systems, the names are returned in the order the files were written to the disk, which
may or may not be in alphabetical order."
If you want them sorted you'll need to do that yourself.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
my program minimizes to the system tray i need to know how to make the message that shows when you put the mouse over the icon update or is it even possible?
|
|
|
|
|
Do you mean the tooltip?
If so, use Shell_NotifyIcon(NIM_MODIFY, ...) with the NOTIFYICONDATA struct szTip member (or
maybe szInfoTitle if you're using balloons) set to the new text you want.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
I have PretranslateMessage() that checks for WM_KEYDOWN message to capture keystrokes.
Then I do my processing from the code it gives me..
int key = (151 + HIWORD (pMsg->lParam) & 0x00ff);
All works great, but I want to be able to test it to see if it's a repeat key before processing.
That is, if the key is held down, I don't want the repeats to get through.
How can I extract lparam bits into a var to see if the message is a repeat key?
I beleive 0-15 in lparam tell repeat status.
Sorry, I get kinda stumped when I get into working with data on bit and byte level.
Thanks...
|
|
|
|
|
Something like this...
WORD wRepeatCount = (WORD)(lParam & 0x0000FFFF);
bool fPreviousKeyStateDown;
if (lParam & 0x40000000)
fPreviousKeyStateDown = true;
else
fPreviousKeyStateDown = false;
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks Mark.. your the man.
|
|
|
|
|
Great, but how can I get the extended key info (i.e., ALT or CTRL keys) ?
Thanks in advance.
Mizan
|
|
|
|
|
sure hope there is a simple answer to this question, but for the life of me I can’t find one.
I’ve written a process that collects data from various Internet sites, re-organizes it, and then creates a new series of web pages. I want to share these pages with a user’s group that I am a member of. The problem is how to automatically upload the files to a Windows based Web Server.
I need to do this with Visual Studio 6.0 (not .net) talking to straight ASP (again, not .net).
I can’t use FTP because I am behind a firewall!
I have written a form that has a browse button that talks to an ASP uploader process on the server, and that works great. The problem is that you have to browse to each and every page every time you want to upload something. Browsers will not allow you to default the file path and submit the form “on-load”. If they did that someone could create a link that as soon as the page was loaded to your PC, it would automatically upload “CreditCardNumbers.txt” or any file they wanted to their server.
This process has to run in the background on its own. It has to monitor a directory, and when it sees a file in that directory, upload it to the web server. No human intervension.
So, here are the two questions:
1. Does anyone know how to emulate the “multipart/form-data” stream that is created by the browse button on a form upload process?
2. Is there another way to upload files without using FTP.
PS: This is my first post here, and it is always fair to give something if you want to receive something! If anyone would like information about how to write the SPIDER that will be the front end that feeds files to this uploader, just make a reply to this post and let me know how to go about exchanging private messages.
|
|
|
|
|
BitWare wrote: If anyone would like information about how to write the SPIDER that will be the front end that feeds files to this uploader, just make a reply to this post and let me know how to go about exchanging private messages.
So why not just write an article?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
See how simple that was. I will work on the article and post it in a few days.
It will be a simple console AP that will go to yahoo finance once every minute to get the latest quote for microsoft and also the latest option prices for microsoft. I will document how I got the pages and give teh source on how I scanned the pages to retrieve the information.
Sorry for being very new here, but where do I get details on how to upload the ZIP file of the source code and documentation?
|
|
|
|
|
BitWare wrote: Sorry for being very new here, but where do I get details on how to upload the ZIP file of the source code and documentation?
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I find an evening couse called
Interop programming and Mixed Mode in C++ (unix and Windows)
near my home.
I think it is interesting, I may spend a little time to sit down to learn something new.
but introduction of the couse is too simple and I can't find its teacher to talk about.
I think someone here may know idea of the couse.
My questions are:
1. what does Interop mean? I guess the word is inter-operating-system, i.e. programming crossing windows and unix.
this tech for me is zero so far.
2. what does Mixed-Mode mean?
Hope u can explan by Windows programming, so it is easy for me to understand.
I don't know programming on unix, is it special for unix?
thx.
|
|
|
|
|
Mixed-mode is the mixing of managed and unmanaged code in the same assembly. Unmanaged code
is your old standard C++ code. Managed code uses a managed heap and allows access to the
.NET framework from C++ code.
There's lots of forms of interop, but relative to managed/unmanaged code, interop is
"interoperability", the ability to work with data across differing platforms, languages, and
systems. For example, managed C++ provides interop marshaling for passing managed objects
back and forth between managed and unmanaged code. One example is when you need to call a Windows
API that requires a pointer to an object, but you're calling from managed code and you only
have a managed pointer. Objects pointed to by managed pointers can be moved by the system at any
time and also may have data types that don't exist in the unmanaged world. In that case you need
to use interop marshaling so the API gets data it can work with (that doesn't move).
Just my 2 cents...
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
I want to find MMC's version installed on a system, is there any API or registry key?
Warm Regards,
Mushq
|
|
|
|
|
Mushq wrote: I want to find MMC's...
MultiMedia Card
Microsoft Management Console
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
sorry for inconvenience, it is "Microsoft Management Console", thanks for that
|
|
|
|
|
How about using the version-related functions on mmc.exe?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I would like to be able to turn on and off a bitmap in a dialog when a particular condition exists. I can create the bitmap but I can't seem to find out how to make it invisible when I dont want to see it. Can someone tell how to accomplish this?
Thanks,
Terry
|
|
|
|
|
how do u display your bitmap?
if u call RedawWindow() without displaying it, the bitmap is invisible.
|
|
|
|
|
I have created the bitmap through the dialog editor. I have an ID for the bitmap but am not able to change it's state. How do I implement RedrawWindow? GetDlgItem(IDB_BITMAP)->RedrawWindow(??)?
|
|
|
|
|
Bitmaps don't have a state, nor are they dialog controls. Is the bitmap being displayed in a control? If so, hide or show that control using ShowWindow(). If you are drawing the bitmap
yourself, don't draw it if you want it invisible.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Excellent thanks Mark. I did not realize what I was doing. I did use a picture control to display the bitmap. After you mentioned the bitmap being displayed in a control it clicked. When I used
GetDlgItem(IDC_MYCONTROL)->ShowWindow(SW_HIDE);
The bitmap was hidden and I can make it visible when I need it.
Terry
|
|
|
|