|
Sounds to me like a binary tree would do what you want. Once you have found the first node, starting with the letter "A", use that node then to find the next highest, either "B" or "AD".
Waldermort
|
|
|
|
|
WalderMort wrote: Sounds to me like a binary tree would do what you want. Once you have found the first node, starting with the letter "A", use that node then to find the next highest, either "B" or "AD".
The more I look at this the more I am no so sure that this is a binary-tree search. A binary-tree search implies that the tree exists and you are searching through it. In my application, I don't think the tree exists. I am creating it right????
|
|
|
|
|
I re-read you origional post and realized that my reply may have been a little wrong.
From what I understand you are applying a brute force attack on the driver to gather the serial numbers?
I would suggest you create a function which given a string will append the characters A-9 and call your driver. If you get a hit, call your function again with the new string ( complete with appended character ). This is a similar way to how files are found on a drive.
Something like this:
void RecurseSearch( LPTSTR szID )<br />
{<br />
TCHAR szSearch[ 128 ];<br />
<br />
_tcscpy( szSearch, szID );<br />
_tcscat( szID, "A" );<br />
<br />
if ( SomeUnknowFunction( szIdSearch ) )<br />
{<br />
RecurseSearch( szSearch );<br />
}<br />
}
Waldermort
|
|
|
|
|
Exactly what I am looking for...
Something that "finds" filenames
YESSSSSSSSSS
|
|
|
|
|
Welllllllllll
I got side-tracked and now I am finally getting back to this. I was able to use a kind-of brute force recursive search. Using my example, it goes through and finds ABG5. I have also figured out a way to keep track of that. My question now is, how can I have it remember to go back and continue searching from ABxx to find ABN4 and eventually BFT9?
Thanks in advance
Pierre
|
|
|
|
|
I am trying to create an application which requires me to open videos taken from an assortment of cameras, both digital still cameras taking motion pictures and standard video camera. As you are probably well aware, each camera has its own type of file storage format. From my research I have found the four most common types that cameras will save video as being mpeg-1, mpeg-2, QuickTime .mov and .avi. From that list you can already see a problem with QT .mov being proprietary.
The functionality I need in any sort of interface with the videos is very simple.
1. Open the file
2. Grab each frame of the video one at a time
2.a. Allow me to do whatever I want to the data because I will not be altering the file in any way
3. Close the file
I will be doing processing on the actual video data (image matrix). I have tried using both the QuickTime API for this application, as well as the Video for Windows API. I began using OpenCV for video access, but it does not have the capabilities I require. According to VFW, if the codec is registered, the API will interface with the video, but that does not seem to be the case with the .mpg file I am testing the interface out on. Windows Media Player and QuickTime both play the video, and I downloaded GSpot, a codec detection algorithm, and know the correct codec is available, but alas...
What I am getting at is that I need a suggestion as to how to accomplish this task.
Do any of you have any suggestions? I would really appreciate it.
The code for processing the video, developed using a .mov converted to a .avi format, is about 80% complete, I just need this interfacing to be able to complete it.
I reject your reality and substitute my own. Adam Savage - MythBusters
|
|
|
|
|
Ctrl Shift F9 will clear all breakpoints in VC 6.0 , however.... being lazy and keyboard challenged I am asking the forum these questions and hoping for some answers.
1. You can add "remove all bookmarks" in Tools->Customize->Commands->Edit
But I cannot find similar icon "Remove all breakpoints"
Side note - why does one need to click on icon to find out what it does?
How about plain vanilla list instead of this “bearware” icon happy approach?
2. You can right click in edit pane gray left border area to manipulate breakpoints.
How can one add, “Remove all breakpoints” to this popup?
Actually – where can you edit this popup anyway?
3. The “Remove all” button is in Breakpoint dialog – why not anywhere else?
4. Years ago there was a macro or Add-in to accomplish this (remove all breakpoints) but of course I forgot where I found it.
Cheers
Vaclav
|
|
|
|
|
in VC6, you can use ctrl-B to open the breakpoint dialog; there you can remove all break points.
|
|
|
|
|
I am using CRectTracker in an MFC 7.1 app and noticed that it works correctly when linking with "shared" MFC but if I "statically" link to MFC, the Cursor disappears when I move the mouse over any of the handles.
I checked an old app that was written in MFC 4.2 and linked "statically" to that MFC and CRectTracker misbehaves as well. It works correctly when linking to "shared" MFC.
Is anyone familiar with this problem and do you know of any workarounds?
|
|
|
|
|
Try adding this to your resource (.rc) file
#include "afxres.rc"
If it's already there, make sure you don't have _AFX_NO_TRACKER_RESOURCES
defined somewhere.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Damn your good!
It's working now.
Thanks for taking the time out to help.
|
|
|
|
|
hi,
i tried to execute the following program(which was given in turbo c++ documentation) in vc++. but it gives an error, that graphics.h can't be found.
so i copied that graphics.h from turbo c to the vc++'s include folder. now it is showing many errors, which i can't resolve(i even don't understand these errors). i am studying c++ in my college. our syllabus include everything from file handling to all oops concepts. but graphics is not covered in out syllabus. so i decided to learn it on my own. but don't know how to start
someone help me please
the following code works perfectly in turbo c, but not in vc++
<br />
#include <graphics.h><br />
#include <stdlib.h><br />
#include <stdio.h><br />
#include <conio.h><br />
<br />
int main(void)<br />
{<br />
<br />
int gdriver = DETECT, gmode, errorcode;<br />
int xmax, ymax;<br />
<br />
<br />
initgraph(&gdriver, &gmode, "");<br />
<br />
<br />
errorcode = graphresult();<br />
<br />
if (errorcode != grOk)<br />
{<br />
printf("Graphics error: %s\n", grapherrormsg(errorcode));<br />
printf("Press any key to halt:");<br />
getch();<br />
exit(1);<br />
}<br />
<br />
setcolor(getmaxcolor());<br />
xmax = getmaxx();<br />
ymax = getmaxy();<br />
<br />
<br />
line(0, 0, xmax, ymax);<br />
<br />
<br />
getch();<br />
closegraph();<br />
return 0;<br />
}<br />
|
|
|
|
|
C++ does not have any "native" "Graphics" support. Most graphics libraries are either vendor specific or API's exposed by the OS.
The Turbo C++ graphics library will be borland specific. You will need to refer to Borlands documentation on how to use it correctly.
A majority of the programmers here probably (just a guess) have more experience and better command of GDI and GDI+ either directly or through avenues such as MFC classes, GDI+ wrapper classes, or .NET.
|
|
|
|
|
Good old Turbo C++ came with its own DOS/Console graphics library. You would need to port/include probably the whole thing for there to be any chance of this working. If all the source was provided, I seem to remember it was, then there's no reason in principle why this wouldn't compile under MSVC. Things have moved on though in the C++ language and you may hit really tricky problems down the line if you persue this.
Functions you're calling in the above code like initgraph , setcolor and graphresult are from the Borland graphics library.
I still have a copy of Turbo C++ on a Win 3.11 virtual PC with many of my old university projects which were developed in Borland Turbo C++ 0.99 and ported to Unix, Solaris and NextStep platforms with no problems although they didn't make use of the graphics library.
Enjoy.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
as mentioned you cannot copy a vendor graphics library for use elsewhere. TurboC's was for itself only. It didn't even work with the borland C compiler after a few versions later.
You can use OpenGL, or DirectX, or a variety of other graphics libraries with VC++.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Thanks for the help.
I am trying to use the following code to read an array of file names. However,
I found all the ftitle[i] used the same memery as ftitle[0]. So after the code read all the array, all array of ftitle[0],ftitle[1],ftitle[2] have all the same value of ftitle[2]: "dogfile3"
CString ftitle[10];
for (i=0;i {
fscanf( f_ptr3,"%s\n", ftitle[i]);
}
//
input data file:
dogfile1
dogfile2
dogfile3
Please help me how to read array of filenames correctly with array of CString?
Thanks a lots
|
|
|
|
|
a CString is not a buffer of char's, and you can't treat it like one.
if you want to use CString, you should use the MFC file classes (ex. CStdioFile).
|
|
|
|
|
Thanks a lots for your lighting me up. I have a MFC program
interface. That is why I have to use CString. Also I am not
too familar with MFC. So could you teach me more on the code
with CStdioFile. I am using:
f_ptr6 = fopen(dogfile1,"r");
to use the array of file names.
Thanks again!
-- modified at 12:15 Monday 24th September, 2007
|
|
|
|
|
here is a sample that reads all lines in a file: http://simplesamples.info/Beginners/CStdioFile.php
|
|
|
|
|
"CString is not a buffer of char's, and you can't treat it like one."
I am sure this is not a good correct statement.
|
|
|
|
|
on the contrary, it is both correct and good.
|
|
|
|
|
Aside from a misplaced apostrophe, how is it any worse than, "...a good correct statement?"
"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
|
|
|
|
|
Actually, the code compiles and run. Yes, I did not copy correctly, here is:
CString ftitle[100];
for (i=0;i
|
|
|
|
|
mrby123 wrote: Actually, the code compiles and run.
Which is no guarantee that it is correct.
Use my suggestion and you'll find that it works correctly.
mrby123 wrote: Yes, I did not copy correctly, here is:
And how is this any better? Do the for() loops not look odd?
"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
|
|
|
|
|
It is something odd, when I copied the loop is looked good. However,
after I posted, it changed to odd looking and lost some bits.
my for loop was OK.
The code looks like this now after your guys help:
for (i=0;i
|
|
|
|