|
Last time I checked, Roger, we were discussing a C program.
"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
|
|
|
|
|
|
|
|
Did you compile this code?
|
|
|
|
|
yes, but it have two errors,and i couldn't find them
|
|
|
|
|
What were the errors ? and on what line ?
|
|
|
|
|
it is the new code changed by me follow,but it also have one error.
#include <iostream>
using namespace std;
int oo(int m);
int sum=0;
void main()
{
int m;
cin>>m;
oo(m);
cout<
|
|
|
|
|
youbo wrote: unexpected end of file found
then complete this line
#include "???????"
as #include "stdafx.h"
and check the parentesis {}
Russell
|
|
|
|
|
youbo wrote: the error is :fatal error C1004: unexpected end of file found
See here.
Had you used <pre> tags, and proper indentation, you could have quickly seen the error:
using namespace std;
int oo(int m);
int sum=0;
void main()
{
int m;
cin>>m;
oo(m);
cout<<sum;
};
int OO( int m)
{
for(int j=2;j<=m;j++)
{
if (m%j==0)
{
sum=sum+j;
};
if (m==1)
{
return -1 ;
};
return OO(m/j);
}; Once you address the C1004 error, you'll still be presented with a LNK2001 error, however. And to top it all off, a stack overflow is imminent.
"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
|
|
|
|
|
Do what Maximilien suggested.
replace every oo with OO!
Russell
|
|
|
|
|
youbo wrote: };where is the error...
The "error" is that you did not use the debugger.
"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
|
|
|
|
|
|
CString::Find ("html::") ?
CString::Find ("href=") ?
I don't know of any *nice* tools for it, but there may be!
Or you could write a nice class for it, and make an article?
Iain.
|
|
|
|
|
|
This[^] article seems that has got a function that finds all the links in a web page. Don't ask me for the algorithm that it use;P
Russell
|
|
|
|
|
You are wellcome
Russell
|
|
|
|
|
Hello Friends,
I am using the Win32 Application. (its good to make clear).And I want to save the Device Context into any Bitmap File.
I.e.
I have a HDC called hdc. I just want to save it into a .bmp File.Is this possible to do. if yes please tell me How ??.
|
|
|
|
|
|
Thnx for help. But i already mention that I am Using Win32 Not MFC.
So. If you have the Solution for Win32 please tell me.
|
|
|
|
|
Yeah I saw your question(I said that article is MFC) and that article but if you see that article you can find answer to write HDC to a bmp file I wrote
|
|
|
|
|
#include "atlimage.h"
bool SafeDcToBmp( const CDC& cdc, LPCTSTR cBitmapPathAndName )
{
CImage image;
CRect cdcRect;
bool bSucc = false;
if( cdc.GetWindow( ) )
{
cdc.GetWindow( )->GetClientRect( cdcRect );
image.Create( cdcRect.Width( ), cdcRect.Height( ), 24 );
::BitBlt( image.GetDC( ), 0,0, image.GetWidth( ), image.GetHeight( ), cdc.m_hDC, 0,0,SRCCOPY );
bSucc = ( S_OK == image.Save( cBitmapPathAndName ) );
}
return bSucc;
}
//Usage
CDC cdc;
cdc.Attach( GetDC( )->m_hDC );
SafeDcToBmp( cdc, _T("c:\\MyFile.bmp") );
cdc.Detach( );
|
|
|
|
|
Your code is good but here a problem he didnt use of MFC,his program is Win32.;)
|
|
|
|
|
I am writing a mouse hook program to trace the mouse movement and something confused me. I use WH_MOUSE to hook the mouse event in global wide, but some message like WM_MOUSEMOVE can not hooked when the mouse leave the window with a left/right button down, so I have add the SetCapture() function to my code when the GetCapture() return NULL, but it does not worked well, in some window like "MS word" or "Winamp" it go wrong.
I have also tried the WH_MOUSE_LL, it realy worked well. but it slowness the animation In window XP when turn on the visual effect "animation the window when Maxminze or Minmize", you will find the mouse move slowness when you click the mini/max box in the titlebar in any window with the mouse move quickly.
It totally confused me, some one can help me.
Thanks.
|
|
|
|
|
First question, why do you want to hook the mouse?
|
|
|
|