|
Check out the fwatch sample in MSDN. It comes with a .ini file where you include the names of the files you want to watch. Mine looks like:
[Directories]
\\pbssvr\ddrive\Users\David2Brian\53=
[Files]
cwb3mijs.dll=
cwb3uijs.dll= Now whenever anything happens to cwb3mijs.dll or cwb3uijs.dll, a line is printed to stdout.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I think I may have found what the problem is. The folder I'm trying to monitor is actually on a UNIX machine. Our network admin has it where it shows up in our network like it's on one of the regular windows servers, but it's not. I tried the fwatch program and put in the path (regular, and mapped as a drive letter), and it still won't work. It works on my local machine's folders and even on a folder on a different windows 2000 server, but not on the directory I'm trying to get it to work on. I guess I just wasted about 8 hours of company time
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
I guess I just wasted about 8 hours of company time
Nonsense. Programming is never about wasted time. Whether you found one way that does work, or a dozen ways that don't work, you've learned something nontheless. Right? Remember that Thomas Edison said that every wrong attempt discarded is often a step forward.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Of course you're right, thanks for the encouragement. I've rewritten it now using a user-configurable amount of minutes that will be used with the CFileFind class. After processing the zip file it will delete it, or move it to a backup location if they have one specified. Thanks for all your help!
[insert witty comment here]
bdiamond
|
|
|
|
|
Is there any way to capture an image from an USB WebCam?
|
|
|
|
|
yes there is.
here is what you have to do:
1) use the code you find below
2) create a BITMAPINFOHEADER
3) write the BITMAPINFOHEADER and the bitmap, that is captured below to a file.
hdcScreen = CreateDC("DISPLAY", NULL, NULL, NULL);
hdcCompatible = CreateCompatibleDC(hdcScreen);
hbmScreen = CreateCompatibleBitmap(hdcScreen, Videobild.right, Videobild.bottom);
if (hbmScreen == NULL)
MessageBox("Bmp konnte nicht erstellt werden");
hbmScreen = ::CreateDIBSection(dc.GetSafeHdc(), (LPBITMAPINFO) m_dibFile.m_lpBMIH,DIB_RGB_COLORS, (LPVOID*) &m_dibFile.m_lpImage, NULL, 0);
GDIObject=SelectObject(hdcCompatible, hbmScreen);
if(GDIObject==NULL)
MessageBox("Object konnte nicht selected werden");
if (!BitBlt(hdcCompatible, 0,0, Videobild.right, Videobild.bottom, hdcScreen, Videobild.left,Videobild.top, SRCCOPY))
MessageBox("Object konnte nicht geBitBltet werden");
|
|
|
|
|
There is always a way. I haven't actually looked at it for 2 years, so I can't help you directly. You'll probably want to look at DirectShow, everything that you want should be there. I believe I remember an example program in the SDK called Stillcap. Anyway good luck.
|
|
|
|
|
With a CTabCtrl added to a dialog box, it is possible to create it with style TCS_VERTICAL and TCS_RIGHT.
If I however want to use the nice and easy to use Property Sheet and Page classes, I have not yet found a method or variable to do the same setting.
I have found the method to get a handle to the sheet's TabCtrl, but how can I control the style ???
It seems as if the style can only be specified at create time.
I have found some nice code articles related to tab controls and property sheets on Code Project, but so far nothing like this.
Does anyone know ???
Regards,
/Thomas
|
|
|
|
|
There are a few classes that let you replace the tab control with a tree. This is an elegant solution especially on XP where the tab control is not drawn properly when it is not at the top. CTreePropSheet[^]and CTreePropSheetEx[^] both inherit from CPropertySheet and use CPropertyPage object for the pages so this should have minimum impact on your existing code.
Yves
|
|
|
|
|
Thanks for the tip !
The "tree" class looks nice, but in my case I'm afraid it will not work well.
The reason for that is that I'm doing a Windows CE application for a device with a small touch screen, to be clicked with the finger tips, and I'm afraid that the symbols in the tree are too small to click on.
The tabs in a property sheet are simply bigger, at least when I as in my case have only 4-5 of them.
|
|
|
|
|
Is it possible to bold a line of text that has been added to a list box control (via AddString)? I do not want to bold all lines, only one line with a given index. Thanks!!
|
|
|
|
|
|
Hello Friends,
I got a problem.
I had splitted the actual view into 4 parts. every view is been derived from different view's class.
The main problem is the one splitter window which has been derived from the FormView has got 2 edit boxes which will resizing itself based upon the size of the window. and when I click in someother view some message has to be displayed in these edit boxes. for example when I click in View1 then some message which I pass from View1 has to be displayed in the edit boxes present in the View2.
I am trying but its always giving me assertion failed and when I debug it its giving the asserting failed in the SetWindowText message. I had created 2 different variables of type CEdit.
Neelesh K J Jain.
|
|
|
|
|
Neelesh K J Jain wrote:
I am trying but its always giving me assertion failed and when I debug it its giving the asserting failed in the SetWindowText message.
Is it line 44 of afxwin2.inl ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello all,
I've been programming in VB for a few years and I'm trying to learn Visual C++. I'm doing pretty good figuring everything out, in part thanks to this websit, but I'm have a problem using a combobox control. I have a form I created in the resource designer of VC++ 6.0 with two comboboxes. I have entered the data for the list of each box in the properties page but when I run the app and try to display the list all I get is a blank list. Is there something I'm doing/not doing? Do I have to call some sort of load list function even though I created the box in the designer?
Thanks for any help,
JJ
|
|
|
|
|
You need to resize the control itself to be a little bit taller. For more on this, read here.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I tried that before I posted my original message. That's how I got the list portion of the box to show up at all. But it's still empty instead of populated with the data I entered.
Thanks,
JJ
|
|
|
|
|
What else are you doing in the dialog's OnInitDialog() method? Any calls to UpdateData() ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
There is nothing in the dialog's OnInitDialog.
No call the UpdateData but I do call UpdateWindow for the parent window of the dialog.
|
|
|
|
|
So what you are saying is that you created a combo box on your dialog app and then right click on it and chose properties? Then under the data tab you entered in your data that you want listed?
So I just did this in VS 6.0. After each entry are you holding down the control key and hitting enter to go to the next line and entering in the next data?
And it's still not showing up?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Yes, exactly. I entered info in the "data" tab of the properties and held ctrl+enter to put in additional lines and still nothing appears when the app is run. Any ideas?
|
|
|
|
|
What happens if you enter items in the control at run-time (i.e., AddString() )?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I'm not using MFC, so I don't know if AddString() will help. Is there a way to do the same thing under Win32 app type? I would prefer not to use MFC if I can do that.
|
|
|
|
|
Yes, send it a CB_ADDSTRING message.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Since the combobox is part of a designed form and I didn't have a handle for it I used:
char comPort2[12] = "COM3";
SendMessage(GetDlgItem(hDlg, IDC_COMBO_Ports), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)comPort2);
This didn't work but I did cause a change. Now instead of a long blank list I get a blank list with only room for one list item. Could it be that the font color is white or something? Also, did I use the above code correctly?
Thanks
|
|
|
|