|
MFC includes the full source. Here it is:
BOOL CDC::ArcTo(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
{
ASSERT(m_hDC != NULL);
BOOL bResult = ::ArcTo(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4);
if (m_hDC != m_hAttribDC)
{
CPoint pt;
VERIFY(::GetCurrentPositionEx(m_hDC, &pt));
VERIFY(::MoveToEx(m_hAttribDC, pt.x, pt.y, NULL));
}
return bResult;
}
As you can see, it calls an internal API function, as much of the MFC GDI classes do. I suggest buying a maths book on the topic if you want to know more.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well Thanx but the source code is of method "ArcTo" ... From where can I get source code of Arc ... Help me Please
|
|
|
|
|
Well I want to know more ... So i shud buy a math book :P
|
|
|
|
|
I created a row socket in order to send raw TCP data using following code:
SOCKET sRaw = socket(AF_INET,SOCK_RAW,IPPROTO_IP);
int flag = 1;
setsockopt(sRaw, IPPROTO_IP, IP_HDRINCL, (char*)&flag, sizeo(flag));
after i intialized buffer and dest address, i call sendto function send it:
int nRet = ::sendto(sRaw,
buff, sizeof(ipHeader) + sizeof(tcpHeader), 0, (sockaddr*)&in, sizeof(in));
if(nRet == SOCKET_ERROR)
{
printf(" sendto failed () %d \n", ::GetLastError());
return;
}
the result is sendto failed with error code : 10004.
Why? help me, tell me why, how can i send raw TCP data using raw socket.
my OS is Windows xp sp2.
|
|
|
|
|
Microsoft have crippled the TCP implementation in SP2. Google groups is your friend.
Aaron.
|
|
|
|
|
thank you very much.
does TCP implementation exist in SP1?
|
|
|
|
|
Hello All,
I have a assignment something like this
LPTHREAD_START_ROUTINE a = ThreadProc;
Where ThreadProc is the thread function
After the above assignment a and ThreaProc shows different pointer value. Which is understandable.
My question is how do I get the ThreadProc pointer value back from a. How should my variable declaration look like
i.e if ThreadProc shows 0x00401028 in the watch window
and a shows 0x00401c90
then how do I obtain back 0x00401028 from a.
Rajdeep
|
|
|
|
|
rajandpayal wrote:
I have a assignment something like this
LPTHREAD_START_ROUTINE a = ThreadProc;
Where ThreadProc is the thread function
After the above assignment a and ThreaProc shows different pointer value. Which is understandable.
i.e if ThreadProc shows 0x00401028 in the watch window
and a shows 0x00401c90
You saw that in a Debug build, right? In a Release build, a will most likely have the direct address of ThreadProc .
rajandpayal wrote:
then how do I obtain back 0x00401028 from a
In a Debug build, a will point to a JMP to ThreadProc instruction. You might inspect the memory pointed by a to obtain the JMP instruction (which comprises 5 bytes, if I remember well), and then decode the parameter, which would be the ThreadProc address...
But, I'm curious, why would you need that?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I think this an easy one for an experienced VC++6 MFC person.
I'm using VC++6 MFC Forms project. Where is the proper place to initialize the controls on the Forms. (ie, making certain buttons visible/enabled and check boxes checke/not)
I'm thinking that either in the application or form .ccp file, but can't figure out where?
Thanks.
|
|
|
|
|
Freddie Code wrote:
I'm using VC++6 MFC Forms project. Where is the proper place to initialize the controls on the Forms. (ie, making certain buttons visible/enabled and check boxes checke/not)
In your dialog class (derived from CDialog ) you need to override OnInitDialog() . After calling the base class implementation, you can initialize your controls. Take a look at:
CDialog::OnInitDialog in MSDN[^]
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I get the C2676 error and have tried implementing the workaround described in KB 814455 on the Microsoft site. The difficulty is the overloaded function that I am told to take out of class scope references 'this'. When I take the function out of class scope, it becomes static and the compiler does not accept it.
I am trying to build MAPM
(www.tc.umn.edu/_ringx004/mapm-main.html)
with MS Visual Studio C++ 2003, Enterprise Architect. The problem is not specific to MAPM or its particular file but to the fact that the workaround for the Visual C++ bug does not address what to do with 'this'.
Admittedly the problem may be my rudimentary experience with C++, so I would very much appreciate help.
The functions (in m_apm.h) causing the difficulty are
MAPM operator--() /* Prefix decrement operator */
{return *this = *this-MM_One;}
and
MAPM &operator-=(const MAPM &m) {*this = *this-m;return *this;}
Other people (although I cannot find them on the net, frustrating) have apparently successfully done this.
Thanks.
-Ted
|
|
|
|
|
TedCB wrote:
The functions (in m_apm.h) causing the difficulty are
MAPM operator--() /* Prefix decrement operator */
{return *this = *this-MM_One;}
and
MAPM &operator-=(const MAPM &m) {*this = *this-m;return *this;}
Member functions receive an implicit parameter this that represents the object on which the member was called. A member class operator defined as:
MAPM operator--()
{
return *this = *this-MM_One;
}
is an unary operator that is acting only on the implicit parameter this .
If you want to, as the MS article suggests, move it out of the class scope, you need to declare it as a friend non-member function, and the implicit parameter needs to become explicit. In the function body, the references to this need to be changed to references to the now explicit parameter. You should write something like this:
class MAPM
{
friend MAPM operator--(MAPM& m);
};
MAPM operator--(MAPM& m)
{
return m = m - MM_One;
}
Similarly, the operator-= is a binary operator, receiving first the implicit this and then the explicit const MAPM& m . So, as before, if you want to move it out of the class scope, you'll need to convert the implicit first parameter this to an explicit parameter. Something like this (now showing the move of both operators out of the class):
class MAPM
{
friend MAPM operator--(MAPM& m);
friend MAPM& operator-=(MAPM& m1, const MAPM& m2);
};
MAPM operator--(MAPM& m)
{
return m = m - MM_One;
}
MAPM& operator-=(MAPM &m1, const MAPM& m2)
{
m1 = m1 - m2;
return m1;
}
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thanks much. MAPM now builds! I'm on a time critical path and so I appreciate your responding so quickly.
There's a lot of testing to do to see if MAPM still operates as intended -- this arbitrary precision stuff is complicated. But I'm on my way ....
-Ted
|
|
|
|
|
TedCB wrote:
Thanks much. MAPM now builds!
Good! Glad to be of help.
TedCB wrote:
I'm on a time critical path and so I appreciate your responding so quickly.
That was just luck. I connected shortly after your post and started reading the most recent threads
TedCB wrote:
There's a lot of testing to do to see if MAPM still operates as intended -- this arbitrary precision stuff is complicated. But I'm on my way ....
Keep going, and good luck
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I want to hide my executing process in task manager.How can I?
|
|
|
|
|
Why do you want to do that? Name a good reason other than to write a virus.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
I want to make a program which doesn't allow any how to go focus out of him not even the mouse cursor goes out the window and I even want to trap the message ctrl+alt+del,so that my process can't be killed.
|
|
|
|
|
Is this a virus?
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
|
I want to know how to execute the program before the login screen appears, and how to abort the system shutdown , I uses the abortsystemshutdown function but it works only in win98 and even in win 98 after calling the function the system shows the message not responding.
|
|
|
|
|
Anonymous wrote:
I want to know how to execute the program before the login screen appears...
Are you talking about a service?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
No, he is talking about a virus
Einstein: "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
My Articles
|
|
|
|
|
I'm not sure how you gleaned that from the original post.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
I'm really stuck guys. I tried to change the icon in "folder options
|
|
|
|
|
In the 'Folder Options' -> 'File Types', There'll be another entry called "Folder" apart from "File Folder". (If it's not there, create it). Click Advanced and in the coming dialog box, add action "Open" with application "C:\Windows\Explorer.exe".
Regards,
Pravin.
|
|
|
|