|
Hi.
I am really lost in using ADO with C++. Can anyone direct me to a site with information for beginners for database access.
Thanks.
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
Did you see Database section on the codeproject?
|
|
|
|
|
i hand't thought of that. Thanks
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
I want to make flexigrid non- editable in VC++.net2003.can anyone suggest me how
|
|
|
|
|
hi, all
I paint a bitmap image on picturebox control using Bitblt() function .
now but i want to do . I want to resizing the image and moving the image
on the picture box control with the help of the mouse. can any one help
me in this topic . any sample code or article . a search a lot on google
not find nay sample and idea how to start it .
Trioum
|
|
|
|
|
For change size of image you can use of StretchBlt (but it decrease quality of image) and with mouse you have two events WM_LBUTTONDOWN and WM_LBUTTONUP you can use of them.
|
|
|
|
|
About the size, use the function in the other answer.
About the movement, you can use those messages (OnMouseDown/Up) to set/reset a bool variable and then change the coordinates of the bitmap while mouse moving. Something like:
BOOL bAllowDragDrop
CPoint m_cpDragOffset;
void CMyView::OnLButtonDown(UINT nFlags, CPoint point)
{
cpDragOffset = cpBitmapCoord - point;
bAllowDragDrop = TRUE;
}
void CMyView::OnLButtonUp(UINT nFlags, CPoint point)
{
if (bAllowDragDrop)
{ cpBitmapCoord = point - cpDragOffset;
bAllowDragDrop = FALSE;
}
Invalidate ();
UpdateWindow ();
}
This would not move the bitmap while mouse moving, just take coordinates by downclicking and saving the new ones by upclicking. If you wanna see the movement, insert the OnMouseMove and do the same as by upclicking.
This is a way. Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
For the resizing, look up CRectTracker
It provides the pieces needed for moving or resizing a rectangular object. You still have to provide some of the plumbing but it gets the job done.
|
|
|
|
|
Hi all,
I have a board (embedded device) that send RAW data over USB to the PC, it also expects to receive some data and commands from USB, anybody knows how to write a program to send data from PC to USB and receive data from USB to PC?? any samples, articles or any kind of help is appreciated..
Thank you very much
Mohammad Gdeisat
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
USB doesn't work the same way as standard serial port (COM port) work. You cannot open the USB and send/receive data on it.
Instead, ýou'll need to open the driver associated with your device (using CreateFile) and then you'll be able to read/write data (using ReadFile/WriteFile) to your device. You'll be also be able to send specific command codes to your driver using DeviceIOControl.
Normally, you should have received documentation with your board (and the driver also). Everything should be explained ther (because for example IO control codes are specific to the driver).
|
|
|
|
|
Please help to figure out what is wrong with my program. It runs and yield correct results. The program is a hybrid of MFC and C++. After the program finish display the results and then when I hit the exit key I Got:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comdlg32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shell32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winspool.drv', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\oledlg.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\olepro32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\oleaut32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\entapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\psapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\netapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\SynTPFcs.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', no matching symbolic information found.
First-chance exception in blast_vib_proc.exe: 0xC0000005: Access Violation.
The program 'C:\blast_vib_proc_model_from_d\Debug\blast_vib_proc.exe' has exited with code 0 (0x0).
Please let me know where is the problem and how to fix it.
Thanks a lots.
|
|
|
|
|
There's no errors until the first-chance exception. If that exception isn't handled
then the app will terminate. If the exception is handled, it may or may not be fine,
depending on what code is causing the exception and how it's being handled.
In other words, if the exception is occurring in your code, you may want to look into it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark.
It seems that Exit function and Next Function got these errors because when I hit these buttons I got the message and program terminates.
Thanks again for any ideas.
|
|
|
|
|
If you run the application in the debugger, execution will break when the exception occurs.
You should at that point be able to see the offending line(s) of code.
If the exception didn't occur in your code, you can use the call stack window to
trace back to a point in your code and hopefully find the problem.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark.
I followed your suggestion with break point and I got to Exit function and the program terminated. Here is my Exit function. please see if anything wrong. Thanks again.
//---------------------------------------------
void CBlast_vib_procDlg::OnExit()
{
// TODO: Add your control notification handler code here
//
CDialog::OnCancel();
}
//
here is message map:
BEGIN_MESSAGE_MAP(CBlast_vib_procDlg, CDialog)
//{{AFX_MSG_MAP(CBlast_vib_procDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDNext, Next)
ON_BN_CLICKED(IDExit, OnExit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
|
|
|
|
|
Nothing that should cause an exception there.
Do you get an unhandled exception error or does it just terminate
as expected?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark. I do get error message:
The application encountered a problem and needs to close.WHen I hit the debug button in the message, I got:
"he instruction at "0x0048d044" referenced memory at "0x61746596", the memory could not be "written",Click on OK to terminate the program.
Thanks again
|
|
|
|
|
Looks like a bad pointer. I couldn't possibly guess where and/or how it's getting trashed.
Some debugging is needed!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have to do what, seems to me, is a binary search.
I have different hardware modules "out on the buss" each with its own unique 17 character ascii serial number. Initially, I don't know each's serial number and until I do, I can't communicate with them. I am going to scale down my example to 3 modules each with a 4 character wide alphanumeric (in real life each character can be any of the printable ascii characters)serial number.
Here would be the 3 units and their serial numbers..
Module # Serial #
1 ABG5
2 ABN4
3 BFT9
The way the hardware and software interface works is like this.
If I ask for any serial number starting with 'A', I will get a reply.. But I don't know how many yet.
If I ask for any serial number starting with 'B', the same holds true.
If I ask for any serial number starting with any other character other than 'A' or 'B', I don't get "a hit". Now, I can eliminate any serial numbers that don't start with the letters 'A' or 'B'
Now, I ask for serial numbers starting with 'AA' through 'AZ...A9' and get "hits" for 'AB' only.
I also run through any serial numbers starting with 'BA' through 'BZ...B9' and get one "hit" for 'BF'
This time, I eliminate anything that doesn't start with 'AB' or 'BF'
Each time I get "a hit" I don't know how many. Until I "drill" my way down through all four characters. At some point I will have only "one hit" for each of the serial numbers.
Nowwwwwwwwwwwwwwwwwwwwww.... How can I do this in Visual C++?????
As I mentioned above, I think this would be a binary search. But I am having a hard time figuring out how to "keep score" of the "non-hits" so that I don't waste time trying those on future iterations. Keeping in mind that each serial number is 17 characters wide and can be made up of any of the 95 printable ascii characters
Are there any code snippets that I can "stitch" together to do this....
Thank you in advance
Pierre
|
|
|
|
|
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
|
|
|
|