|
 Does this work (changes marked in color)?
bool findandcapture()
{
frame=NULL;
HDC devcnt=NULL,devc=NULL,cmpdc=NULL;
RECT dim={0};
HBITMAP bmp=NULL;
BYTE *memory=0;
BITMAPFILEHEADER fileHeader;
BITMAPINFOHEADER infoHeader;
BITMAPINFO info;
int numframe=-1;
char cur[150]={0},prev[150]={0};
EnumWindows(findwebwnd,0);
if(frame!=NULL)
devcnt=GetWindowDC(frame);
else
return false;
GetWindowRect(frame,&dim);
int bitmap_dx = dim.right - dim.left;
int bitmap_dy = dim.bottom - dim.top;
fileHeader.bfType = 0x4d42;
fileHeader.bfSize = 0;
fileHeader.bfReserved1 = 0;
fileHeader.bfReserved2 = 0;
fileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
infoHeader.biSize = sizeof(infoHeader);
infoHeader.biWidth = bitmap_dx;
infoHeader.biHeight = bitmap_dy;
infoHeader.biPlanes = 1;
infoHeader.biBitCount = 24;
infoHeader.biCompression = BI_RGB;
infoHeader.biSizeImage = 0;
infoHeader.biXPelsPerMeter = 0;
infoHeader.biYPelsPerMeter = 0;
infoHeader.biClrUsed = 0;
infoHeader.biClrImportant = 0;
info.bmiHeader = infoHeader;
cmpdc=CreateCompatibleDC(devcnt);
bmp=CreateDIBSection(devcnt, &info, DIB_RGB_COLORS, (void**)&memory, 0, 0);
DWORD eror=GetLastError();
<font color="Red">HGDIOBJ hOldBMP = </font>SelectObject(cmpdc,bmp);
<font color="Green">
<font color="Red">int bytes = (((24*bitmap_dx + 31) & (~31))/8)*bitmap_dy;</font>
while(1)
{
if(strcmp(cur,prev) || strstr(prev,"Broad")!=NULL)
{
numframe++;
GetWindowText(last,cur,150);
BitBlt(cmpdc, 0, 0, bitmap_dx, bitmap_dy, devcnt, 0, 0, SRCCOPY);
<font color="Green">
<font color="Red">
writebmpfile(bitmap_dx,bitmap_dy, bytes, memory,fileHeader,infoHeader,numframe);
<font color="Green">
if(UpdateWindow(mainwin)==false)
break;
if(strstr(prev,"Broad")!=NULL)
Sleep(500);
}
else
Sleep(1);
GetWindowText(last,prev,150);
Sleep(1);
}
<font color="Red">SelectObject(cmpdc,hOldBMP);
DeleteObject(bmp);</font>
DeleteDC(cmpdc);
ReleaseDC(frame, devcnt);
return true;
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
nope same problem and getlasterror still returns Not enough storage after the CreateDIBsection func. i think there is the problem maybe i miscalculated something on the bitmap structures , what do you think ?
P.S : thanks for your kindness to help me
|
|
|
|
|
It looks ok to me - I'm not sure what I'm missing (obviously )
CreateDIBSection is returning NULL and then GetLastError() returns what?
The only thing that should affect that is the width and height - what are those values?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
width=324 and height=244 i get them from GetWindowRect(frame,&dim). if you would like to simplify our communication add my ymsg id : csman_ul
|
|
|
|
|
Hi
I have created Custom dll to override the Windows OS Dialler.
for that we need to make the appr. entry of our dll into rasphone.pbk
CustomRasDialDll=c:\,....\customDial.dll
Now problem is if I open windows mail it triggers the dll and which finally calls "RasCustomDialDlg" method,which connects through the internet using the RasDial API,
But after that i disconnect the conneciton and again try to open the Windows mail so it should again call my dll's RasCustomDialDlg
But it's not doing so intead it calls system dialler..that i want to avoid..
It seems after doing first time conneciton it changes some regsitry entry which causes this ? not sure
please advice. if u do not understnd let me know i can explain in brief..
thanks,
Prakash.
sonani prakash
|
|
|
|
|
Hello everyone,
There are 4 runtime library options, my understanding is,
1. /MT static link to CRT release version
2. /MTd static link to CRT debug version
3. /MD dynamic link to CR release version
4. /MDd dynamic link to CRT debug version
Is my understanding correct?
thanks in advance,
George
|
|
|
|
|
You simply missed that all options refer to multithreaded version of the run-time library.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I think the single threaded library is deprecated as of VS 2005 and not available. Unless I missed a hack somewhere
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I didn't know about.
Anyway is worth noting that the libraries are all multithreaded (even if you have no alternative).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
1. download a project rar, extract it into a directory
2. add to vss6, not through vc6, just open sourcesafe directly, and add the project's root directory to vss6 recursively
3. delete the project outside sourcesafe
When I want to get it out again, I tried both "Get Lastest Version" and "Check out", though the project is get out of vss6, but it seems not associated with vss6. How to let the project files be controlled under vss6?
PS: I leave the working fold by default when get or check out, and check off "Make writable".
|
|
|
|
|
followait wrote: ...but it seems not associated with vss6.
What exactly does this mean?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It means that when I want to edit the file, I need not check it out, and when I finished editing, I can't check it in.
|
|
|
|
|
Visual C++ (6.0) has a place in the .dsp file to indicate that each file is/is not under source control. If that entry isn't in the .dsp, VC6 won't attempt to use source control. I suspect VS 7 also works like that, since VS2005 work the same way.
This occurred because the file you unzipped was never in VC++ to begin with, and when you added to VSS, it didn't have the .dsp showing that it should be under VSS control.
Not sure about VSS, but with ClearCase, I could simply open that project in VC, then select the files and "Add to Source Control". (Note that your .dsp must be writable at this time.) This causes VC to update the dsp file with the SCC information.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Thanks, I'm clear now.
The .dsw has to .dsp and a deep directory hierarchy, so I add it through sourcesafe directly. I'll try to add them through VC++.
|
|
|
|
|
It's done, what I have to do is only add the .dsw .dsp(s) to source safe.
Thanxxxxxx
|
|
|
|
|
Hello.
I have certain programming issue that need to be solved. Im creating an application under win32 console application using VC++2005 :-
1) How can i make the win32 application console invisible/hide during execution. (the black dos window is invisible)
2) Is there any API that can detect an internet connection? I want the application to detect any internet connection is available (wireless or cable). Is there any option or idea to create this mechanism? Maybe it is possible if there is an internet connection available, the application would print a message saying "internet connection available".
3) How can I do a timer in this application? This timer would trigger an event when a time comes. For instance, a message loop will appear every 5 minutes.
Thanks
|
|
|
|
|
Muhamad Hazwan Halim wrote: 2) Is there any API that can detect an internet connection?
See if this helps.
Muhamad Hazwan Halim wrote: 3) How can I do a timer in this application? This timer would trigger an event when a time comes. For instance, a message loop will appear every 5 minutes.
In a console application?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
yes. In a console application. Is it possible? What im trying to do is creating such like a software agent which it is invisible to the user. So, this software agent will try to communicate with the server every 5 minutes. If there is connection, then every 5 minutes this software agent will send packets which contains information regarding the client PC. Since im not doing any graphical icons to this software agent, i created the win32 Console application. Is it possible to create a timer so it will send packets to the server every 5 minutes using win32 console application. Any API codes? Thanks
|
|
|
|
|
Muhamad Hazwan Halim wrote: Is it possible to create a timer so it will send packets to the server every 5 minutes using win32 console application.
Yes. You can use Sleep(300000) for this. When it returns from sleeping, send the packets.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Muhamad Hazwan Halim wrote: How can i make the win32 application console invisible/hide during execution. (the black dos window is invisible)
Why do you need the console window if you are just going to hide it? Maybe you want a windowless application?
|
|
|
|
|
Actually i have receive several opinion from google and also other forums saying that why do i need a console application if we were just going to hide it. Thinking and thinking i still could not understand why. . As for my application here, actually what im trying to do is a software agent which will communicate and send information packets to the server for every 5 minutes. (This is where i need a timer to solve this). So this software agent is located at client side where it must be invisible to the user for security reason. The reason i choose win32 Console application as the client application side (software agent) is because I dont have any intention to put any graphical icon to the application. It is pure text based. So I just wanna hide the dos window (text based) so that user did not even know that the program is running background. Is there any option @ API that can help me accomplish this requirement?
|
|
|
|
|
Hello, i have a problem.
I am currently developing software for several platforms in msvc 7.1. It seems its not possible to add a platform of your own definition by just "adding" it in the configuration manager, only the predefined platforms works, such as Win32, x64, etc. If you type a name of your own in the platform field when creating a new one, you cant select that platform for any of the projects when you want to setup new debug/release configurations for that platform.
Must a new platform somehow be registered with visual studio?
Thanks
Peter
|
|
|
|
|
Well, there's more to a platform choice than a name. It's associated with all sorts of thngs. Which compiler, debugger, virtual machines (ie PDA emulator), etc.
So I think there will have to be all sorts of settings associated with them. Which reinforces your idea about registering a platfrom with VS.
How you do *that* is another question. (For someone cleverer than me).
|
|
|
|
|
Dear Friends,
I m working VC++ where UNICODE is not defined for tht particular application.
I want to display "Name (DownArrow)" as a caption on a control. here Downarrow means the picture of downarrow.
I tried in a following way.
CString s1, s2;
s1 = _T(2193);
s2 = "PickUp" + s1;
But for S1 it is giving me the character with value as 255.
Can anybody help me out?/
I can use painting tht control but i don't want to do that..
Thanks in advance
Megha
|
|
|
|
|
megha_gharote wrote: s1 = _T(2193);
what are you expecting with this ?
|
|
|
|