|
Thanks! You just made my life much much easier. Now I just need a refresher on HTML which is nothing. I ran some examples of the print and it works alright. I just need to be aware of page limits and so on when printing. I have to take a step backwards a little becuase of the change from CScrollView to CHtmlView, but in the long run it makes my programming time much much shorter.
Thanks!!
Dan
|
|
|
|
|
capDlgVideoFormat is a dialog box to allow user to select resolution dib image but instead of that , i wish to fix the resolution to 640 x 480 :
BITMAPINFO bi;
capGetVideoFormat( ghWndCap, &bi, sizeof(bi));
bi.bmiHeader.biWidth = 640;
bi.bmiHeader.biHeight = 480;
capSetVideoFormat (ghWndCap, &bi, sizeof(bi));
what i got is image resolution (saved image ) remain as 320 x 240, and what i see is a totally black image. What went wrong ?
Anyone familiar with this pls help ?
|
|
|
|
|
Your code is OK (I've used somehing similar in the past without problems). Most probably, the video grabber you're using does not provide the resolution you're asking for. Some allow for any resolution up to a maximum, others only a few predefined sizes. If the device you're using comes with its own video recording program (as most do), you might want to take a look at it to determine which resolutions are available.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi
Thanks for the reply, u were saying that the problem could be cause by the the video grabber, sorry but what is a video grabber? is it the software that controls the webcam ? I actually verify this using another application available : http://codeguru.earthweb.com/multimedia/AviCap.shtml
i modified the codes to fix the resolution, and still, it gives me a black screen. Could the problem be caused by the web cam itself ? what webcam will be better then ?
Thanks in advance!
Chu - Alan
|
|
|
|
|
Well, by "video grabber" I meant the webcam you're using with yopur program. Many webcams allow only for a few dimensions to be set.
Does your program work at all with the webcam. If the app you mentioned manages to get some video, then the problem most likely is in your program, not in the webcam itself. COmpare your code with that of http://codeguru.earthweb.com/multimedia/AviCap.shtml and try to find significative differences.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hi
i got what u meant. i actually suspected that the problem lays in the webcam more than it lays in my app. As mentioned, i modify the app found in : http://codeguru.earthweb.com/multimedia/AviCap.shtml to fix the resolution as indicated in my 1st thread, and this modified app gives me the same result as my app. : black screen .
i really need to further conclude by getting another webcam to try it out. Thanks for ur wonderful advice !!
|
|
|
|
|
First of all you hardware must support 640*480 format.
|
|
|
|
|
Hi all,
I am using a program which generates values in hex and in order to plot I want to convert these values to decimals.
I wonder if there is any free editor which coverts hex values to decimals.
thanks for help
regards
/rsasalm
|
|
|
|
|
rsasalm_ wrote:
I wonder if there is any free editor which coverts hex values to decimals.
Windows Calculator?
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Thanks for reply.
Windows calculator convert one value at a time.
The program I use generate the hex values in a file and it is a big file.
What I want is to paste all the hex values generated from the program and convert them to their corresponding decimal values.
Any help
regards
/rsasalm
|
|
|
|
|
Perhaps something simple like the following could take care of it? Maybe you need to throw in a hex for the input stream also.
#include <iostream>
using namespace std;
int main()
{
int foo;
while ((cin >> foo)) {
cout << foo;
}
return 0;
}
|
|
|
|
|
Not sure if this tool is what you're looking for, but it's really cool nonetheless:
Hex Workshop
Ty
|
|
|
|
|
I'm sure it was asked a hundred times, but I just dont find it.
So, how do I get the screen position (or any position) of MY icon in the system tray? I need it to display a balloon tip pointing toward it.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
I'm sure you already new this, but in 2k/XP the OS does provide balloon tooltips natively.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Use Shell_NotifyIcon function in ANY win32 OS to set tooltip text. Everything else will be done by windows.
Warm regards,
Vladimir V. Polischuk
AlarIT developer
E-mail: greykite@mail.ru
URL: http://www.alarit.com
|
|
|
|
|
That is really helpful. [imagine sarkastic grin here]
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
yes, i know it and they are f... bad like the normal tooltips. Nope. I want some nice ones. So? How i get the position?
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
I've created an mfc-dll which contains a shared memory zone, to be shared by 2 instances.
The first instance creates the memory zone using CreateFileMapping() . The second instance opens the memory zone using OpenFileMapping() . They both get the pointer to the address of the first byte of the memory using MapViewOfFile() .
That works just fine on a win98 machine. The 2 instances get the same address.
But if we run it on a winNT, the MapViewOfFile returns different addresses for the 2 instances (shared memory huh?). How is that possible?
Here's how I created the memory:
if(bInit)
{
hMapHandle=CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_READWRITE,0,SHMEMSIZE,"XE_MEMORY_MAP");
if(!hMapHandle)
AfxMessageBox("CreateFileMapping failed");
}
else
{
hMapHandle=OpenFileMapping(FILE_MAP_ALL_ACCESS,FALSE,"XE_MEMORY_MAP");
if(!hMapHandle)
AfxMessageBox("OpenFileMapping failed");
}
lpMapAddress=MapViewOfFile(hMapHandle,FILE_MAP_ALL_ACCESS,0,0,0);
if(!lpMapAddress)
AfxMessageBox("MapViewOfFile failed");
if(bInit)
memset(lpMapAddress,0,SHMEMSIZE);
char buf[100];
sprintf(buf,"memory initialised: %d",bInit);
AfxMessageBox(buf);
sprintf(buf,"\tlpMapAddress=%p",lpMapAddress);
AfxMessageBox(buf);
lpMapAddress points to the same address on win98, but not on NT.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Curious, but why did you think they should? Nothing ever states that you'd get the same results. Consider it more a coincidence than anything else. Never rely on the fact that it gives the same address in two processes.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
That's the whole point of shared memory. 2 applications that use the same memory.
So, by definition, the addresses MUST correspond. Otherwise it's no longer shared memory.
ex.
Using the first instance, we put an integer on address 666. Now, if we want to read that integer with the second instance, we need to know the address. In my case here, on win98 the address for the second instance is 666, but on winNT it is 1024 and so it doesn't refer to the same integer.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Grote Smurf (aka frisco) wrote:
So, by definition, the addresses MUST correspond. Otherwise it's no longer shared memory
Not at all. One process may get base address equal to 1000, another to 2000. If process 2 sets the address 2010 to 55, then first one will see 55 at 1010. Virtual memory, you know
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Ok, understood. So, linked lists are not an option here (what was I thinking, pressure).
But we can have an array of objects starting at a base-address. That's right, isn't it? So all I have to do is count from the address lpMapAddress to access all the objects.
Bassicly, I've been programming in java for several years, neglecting c for quite a while. I forgot that you can't assume anything in c++ . It's just a coincidence that the win98 returns the same address.
carry on...
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Grote Smurf (aka frisco) wrote:
linked lists are not an option here (what was I thinking, pressure).
Don't think so. Instead of pointers, use offsets. To create a real pointer, add offset to base address.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
You're right, but it seems easier to have something like pMyPointer++.
It doesn't have to be speedy, you know.
Nevertheless, this is just for a testcase. Next week, I'll start implementing this in our app, then I'm going to do the linked list for sure.
tnx again!
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Grote Smurf (aka frisco) wrote:
You're right, but it seems easier to have something like pMyPointer++.
There's nothing which could stop you from implementing smart pointer class. Providing operator++ would be trivial.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|