|
Hello again,
I want to make an "uninstall" shortcut in start menu where my software resides. How can i do this while creating setup file.
Hope somebody replies.
Thankz.
|
|
|
|
|
VC6.0 datagrid
I want to drag columns in my datagrid,so I respond to MouseDown and MouseUp Message,as following
void CTableView::OnMouseDownDatagrid(short Button, short Shift, long X, long Y)
{
// TODO: Add your control notification handler code here
col1=m_grid.ColContaining(X);
}
col1 is a member of CTableView.
but it doesn't work well
for example,If I press at column 5,it returns 5 instead of 4;
moreover,
if the position which I press at is in the first half part of columns 1, it returns 0,right!,but if the position is near column 2 in column 1, it returns 1, not expected value 0
I don't knew why
Cheers,
shakaqrj
|
|
|
|
|
can you just repost it with some better clarity?
so far, i have used flexgrid, datagrid should also be more or less same.
or if possible, attatch your application to my mail ID chandu004@yahoo.com
i shall see it.
|
|
|
|
|
Thank you!
I have sent you
|
|
|
|
|
I find this problem depends on resolution.
different resolusion gets different result.
Since I have sent you my application, please try!
Thank you!
|
|
|
|
|
What is the native approach for capturing video via FireWire under Windows? I found a lot of samples, which a using and reusing libraries and tools for these purposes, but I want to start from the very beginning, because I have to access additional commands, which are put into the stream of IEEE 1394 data, among the standard video description. Where can I get basics of IEEE 1394 programming under Windows with VC++?
P.S. Does anyone know any IEEE 1394 sniffer for Windows? There a re a lot of such tools for USB, but I found nothing for FireWire...
|
|
|
|
|
Hey Everyone,
I've got a short array that starts with 1 element (obviously) and it grows if it needs more elements. Untimately the array needs to grow as much as possible to suit the program.... I don't know however, how to return the size of the array.
e.g.
ShortArray[0] = 1;
ShortArray[1] = 5;
Length of the array is 2... Mean there are two elements. How do you return the length?
Thanks for your help in advance.... I appreciate all your input
Cheers,
Michael
|
|
|
|
|
Michael101 wrote: I've got a short array that starts with 1 element
How did you declare the array?
Michael101 wrote: Untimately the array needs to grow as much as possible to suit the program
This means you dynamically allocate the memory?
|
|
|
|
|
register short* PrimeNumber = 0;
That's how I declared the array.... I would change it if I need to though. Yeah I want allocate it more memory during runtime i.e it grows.
Cheers,
Michael
|
|
|
|
|
Michael101 wrote: I would change it if I need to though.
The memory can be allocated like
PrimeNumber = new short[2];// an array having length of 2 is created
So 2 is length of array. Similarly you can put the number of element you want in the array in the place of 2.
|
|
|
|
|
Do you know any methods or functions that return how many elements that are in the array?
Like before
Array[0] = 1;
Array[1] = 2;
There are "Two" elements in this array.
Do you know of anything like that?
Cheers again,
Michael
|
|
|
|
|
Sorry I dont get your question correctly.
Suppose you are allocating a memeory with size 5. Then the length of the array is 5. And whats the confusion in that?
you can get the size of memory that you dynamically allocated using new or malloc using the function _msize() . Is that what you want?
|
|
|
|
|
Use a std::vector and be done with it.
"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
|
|
|
|
|
yep I agree.... Thank you for your help!
Cheers
|
|
|
|
|
Michael101 wrote: ShortArray[0] = 1;
ShortArray[1] = 5;
Length of the array is 2... Mean there are two elements. How do you return the length?
const unsigned int length = sizeof(ShortArray)/sizeof(ShortArray[0]); That is, you divide the amount (in bytes) of your array by the size (in bytes) of one element.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hello all,
I'd like to know how to make a Win32 list view control show multiple lines of text beside the icon just like Explorer does:
|||| file_name.txt
|||| Text document
|||| October 10th 2007
I want to be able to control the text on each line and I am having no success, it just wraps a single line of text if it does not fit on one line. No matter what I do - adding columns, putting newlines to the text, setting number of lines with LVM_SETTILEVIEWINFO... nothing helps.
So far I have found only .net examples please, which are useless to me.
Thanks for any pointers.
|
|
|
|
|
Just for a bit of masochistic fun I decided to try and do this using MFC 6, the class CListCtrl of which doesnt include any explicit support for TileView.
1. ensure _WIN32_IE and _WIN32_WINNT are both defined to 0x0501 for the entire project
2. in OnCreate of CMyListView use supported InsertColumn to add 4 columns, then SendMessage(LVM_SETVIEW,,) and SendMessage(LVM_SETTILEVIEWINFO,,) specifying 2 columns
3. for each item added SendMessage(LVM_SETTILEINFO,,) listing the columns I want to see
4. make an application manifest for the exe, I used the myapp.exe.manifest XML file method rather than the resource method
Hey presto multiline TileView using MFC 6, if any one of those steps is omitted then I dont get multiline TileView.
|
|
|
|
|
It seems that I have overlooked the LVM_SETTILEINFO message and thought that LVM_SETTILEVIEWINFO is all that is needed.
Thanks for helping me, you have saved me a lot of time!
|
|
|
|
|
I have a problem I need to solve - preferably elegantly!
I have a series of inputs to my software.
Imagine... If Input A - turn an output on in 5 seconds for 2 second.
If Input B, turn an output on in 3 seconds for 2.5 seconds.
I was thinking of a queue of "on" times, and checkinh if the output should on every (eg 0.1s).
but imagine InputA came on briefly, then 1 second later InputB came on as well. You would have overlapping ON times.
I know I can do this with brute force, have a list of on-off structs, (probably using CPoint), and check every one of them each 0.1s - and get rid of the "expired" ones.
But I'm sure there must be a more elegant solution, probably using STL. It's possible there could be a *lot* of these queued events, so some some of merging of events would be helpful.
Any ideas welcome!
Iain.
|
|
|
|
|
Iain Clarke wrote: I have a problem I need to solve - preferably elegantly!
I have a series of inputs to my software.
Imagine... If Input A - turn an output on in 5 seconds for 2 second.
If Input B, turn an output on in 3 seconds for 2.5 seconds.
How many outputs are involved? Do Input A and B control the same output?
You could have a queue of inputs, each with an ON time span. First, remove an input from the queue and turn the output on for the specified duration (you'll have to decide when it's appropriate to check the queue for inputs). Set a timer to notify you when that duration has expired. When you get a timer notification notifying you that the current input has expired, get the next input and do the same thing again. This assumes that only one output can be turned on at any one time.
If each input controls its own output, then I would approach it differently. I'd set up a timer to tick periodically, say every 100ms. I'd have a queue for the inputs, just as before. I'd check the queue for inputs in response to timer ticks. If there are any inputs in the queue, I'd remove the first one, turn on an output, and place the input into a second queue. The second queue would be a priority queue with the inputs sorted by their duration.
When an input is placed into the priority queue and the queue was previously empty. I'd reset an accumulator variable to zero. Now in response to each timer tick, I'd add the elapsed time to the accumulator (probably use an unsigned long for this). On subsequent timer ticks, if the priority queue is not empty, I subtract the accumulator from the first item's duration. If the result is less than or equal to zero, I remove the item from the queue and turn off its output. I repeat this action until the priority queue is either empty or the duration of the first item in the priority queue is greater than my accumulator.
So in response to each timer tick, I'd process any inputs in the input queue, update my accumulator, and process any items in the priority queue that have expired. Actually, I'd probably do that in reverse order. Process the priority queue first, then the input queue.
|
|
|
|
|
Leslie & El Corazon,
First, thanks for your long thought out replies! It sounds like you both have a decent amount of real experience.
Secondly, my specs were vague. Both (in fact it's 5 - but I was being "simple") inputs map onto a single output. If any of the inputs decree an ON!, then the output will switch on.
My thought were to have a queue of events pushed by the defect detection thread(s), and a check-the-queue-every-now-and-then thread popping the events off.
As these ON events could overlap, my real question was whether there was a really neat way of merging them, so two overlapping ONs become one longer ON instead.
So, a queue of 1s-5s & 10s-12s would be left alone, while 1s-5s & 4s-8s would become 1s-8s.
So it was more of a pure computing problem than I presented it as.
Thanks again for your time,
Iain.
|
|
|
|
|
Iain Clarke wrote: so two overlapping ONs become one longer ON instead.
that is easier still. Use a queue or a ring-buffer as I mentioned, they can be used interchangeably, though a queue will require mutexing if it does not have implicitely shared in the design. When something is "turned on" put it on the on-queue.
When you output, check the on-queue, if anything is present, check it for expiration, if the time has expired, pop it off, if it has not expired, then send output. Pretty simple asynchronous operation. And you don't even have to do a mid-queue removal either. Even if item two has expired, and item one has not, you will want to output. When item 1 expires, you pop it off, check the next one for expiration, and pop it off. You only care if anything is left in the queue, i.e. the queue is not empty, then output.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Iain Clarke wrote: I have a series of inputs to my software.
Imagine... If Input A - turn an output on in 5 seconds for 2 second.
If Input B, turn an output on in 3 seconds for 2.5 seconds.
I deal with this pretty regularly, all our inputs are asynchronous. I guess I should ask, what is the output? Do you want to blend the output of two things during a "double on" situation? do you want to put one at higher priority? How exactly do you wish to handle a double on situation. Forget the implimentation at the moment, start from the statement of action. You have multiple inputs.... double off, no problem, no output. Single on, single off, single output, again no problem. So then comes the doozy, the exception case, double/many on, what do you see as the preferred output? what is the output? where is it going? Is .1 second check the preferred output format? would you alternate between any/all outputs? is there a priority involved where one output should always be first?
I have one situation with position data where sources number n, some unknown number at startup, 1 to many. The code channels the input to a variety of parallel threads to handle the data as rapidly as it comes in. The output is simply stored in an implicetly shared structure that is read from another thread, synced to video (60 times a second). The result is asynchronous output, though the time can be requested in synchronized form given time sync filtering.
In another case, my streaming debugger for embedded applications, many threads feed a ring buffer that feeds a transmit thread for sending debugging information. This allows for n threaded debugging or any system on a network. N threads feeds 1 thread via single channel shared structure similar to a queue (a ring buffer is just an over-glorified queue with fixed memory footprint).
You can always have a queue of "on" events, rather than check all states, setup another queue, though with a read-only option, probably as a vector or ring buffer because of the fixed memory state. Then you need only "push" an on-event onto the "active" state list. Another thread can read and process only the active states sending output, handling priorities, and "pop" completed activities. We do this for a state engine for script events which is always an asynchronous many to many relationship. My goal is always to keep things asynchronous as the input until the very last frame before display, then synchronize if necessary. But that is because I know my data input is always asynchronous, synchronizing it only lowers its accuracy, so I want to do as little as I have to of manipulation of data.
You can also simulate a threaded operation using any heart-beat hardware event from the host system, from idle calls, to timers, to screen refreshes (vsync), etc.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I replied to Leslie here[^].
It's a bit long to retype - but was "thanks for the help you two, and here are some facts I neglected..."
Iain.
|
|
|
|
|
Hi, i have SDI app with dialog based on CDialog class. I need to get pointer to client area to set some properties.
|
|
|
|
|