Could someone show me how to find out if content is in a buffer or not or not. I'm thinking Get Size of Buffer but I don't know how to do this and do something about it. If i can find out that the content is larger than 0 this is all i basically need to know, and if it is 0 or uninitiated, I need to step to the next instruction to fill that buffer with my contents.. I would appreciate any ideas to preform such an operation. Thanks
Posted on 2001-12-05 22:11:17 by cmax
Im kinda of confused as to your purposes. This is not a problem at all.. You can use "GetWindowText" to fill the buffer and "If the function succeeds, the return value is the length, in characters, of the copied string, not including the terminating null character."

If your buffer if being filled from something other than a window.. Preformat the first byte to NULL, then fill the buffer, and check the first byte for NULL to see if anything was changed.

Is this what your getting at?
Posted on 2001-12-05 23:28:44 by NaN
Suppose you had 100 Buffers or Invisible edit boxes that reads files in that is in known folder location on your computer.

Now suppose you or someone else move one of those files to another location or even delete it.

The buffer or invisible edit box pointing to that file would now be empty.

You would have no way of knowing that it was empty until you go to the other part of the program that is used to view all of those files (which is another subject about the program).

I need a way of knowing if any of buffers or boxes is reading nothing so that the program will automatically take action and fill that empty buffer or box with something else in it place, or replace that file, or pop up a Message Box warning "File Has Been Moved or Deleted".

Since all of this happen INVISIBLY at program start up i want add the code that find out if content is in the buffer or not. ( After all is initiated it check to see if All is Well )... There may be other ways to do it but I like to learn how to do it this way first and other ways also. Just knowing how to do stuff like this put many more ideas in my mind. But anything will do....

Sorry about the long explanation but i don't want to mess up this chance to learn about this. ( too long make it more confussing)

Thank NaN

By the way NaN to be a Newbee you show learn fast. I read your posts and follow your programs but I'm not into COM just yet but I'm slowly beginning see the light. I got a lot of questions once I finish with my lay out. Than i can change anything i want to With EASE. To think 10 years ago you had to be a rocket scientist to do with masm what masm32 do for us today.
Posted on 2001-12-06 03:01:01 by cmax
After writing all of that I just realize that maybe i should call GetFileSize 1st and if it's not there or is empty it got to return 0 somehow. If im on the right track do someone have an example of how i could interact with
if it return 0 "DO SOMETHING"
if its still there "DO SOMETHING ELSE"

This may make more sense of it all.

Posted on 2001-12-06 04:49:07 by cmax
Now your following my train of thought (now that i know roughtly what your trying to do..)

The bottom line to keeping what your trying to do together, is doing error checking at critical points. Get file size would definitely be a good start. As well the API your using to actually "fill" the buffer with from disk should also have some return type or indicator of how much was successfully copied. With these two, you can compare and see if all got copied (another error check). etc. etc. etc.

Last thought, when dealing with such problems, where a buffer of data results from a series of "events" (ie. load data from disk, and any other processing), always trap for possible problems at their source (if you can), and work back further up the chain towards the final product (your buffer). This will ensure best stability of your system (as im sure you can respect, since you first tried to solve this problem from the buffer's point of view :P ).

PS: Look forward to hearing your thoughts in the COM section, when your ready...

Posted on 2001-12-06 10:44:31 by NaN
It want be long.
Posted on 2001-12-06 15:58:52 by cmax
NaN, I tried hard for the past few day to figure things out. Everything i tried to do turned out to be dumb. I know this because NOTHING WORKED. I need an example or an workable explanation of how this works. So i must ask this question to the Board again without my dumb ideas included......

How do you Find Out if Your Content is in The Buffer or Not

Better yet..... anything bigger than 129 bytes to indicated to the app that ALL is WELL.

Thanks in advance

PS: Correction to my statement.
I should not say my dumb ideas but ideas that i don't have a clue to how to implement...Sorry
Posted on 2001-12-08 16:57:34 by cmax
Sorry, but i have no time to do *coding*... up to my neck in exams at the moment, but if you havent figured things out by the 21ts... try me again :)

Posted on 2001-12-09 00:05:43 by NaN
I don't want anyone to do any coding. When i post a question i only hope someone knows already or have an example available already. If not thats just the way it is. All of you coders got a life to live too.

By the way this is a question that was posted on the old Board by someone else back in the day when I first found the Community JUST a few days before the Big Switch i think.

i guest that most coders never thought about stuff like this or got other ways of doing things because he never got an real answer to how to do it either.

Anyway don't worry about it I'll find another way unless something show up here one day.

I know you going to get an A+ .... Good Luck

Love you Guy
See Ya
Posted on 2001-12-09 02:24:27 by cmax