|
Is it free to use the MFC source code however you want, or is that off limits. I don't want to use MFC, but I would like to use bits and pieces of it, like CRect etc. Is this legal, or is it violating any copyrights?
|
|
|
|
|
It's completely legal on the condition that you don't use it to write, and I presume sell, a class library or otherwise represent the code as your own.
Microsoft also requests that you don't compile the new results with the same name as the current MFC libraries.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi All,
I am trying to send data from my client to my server through an RPC call in Unix C. I am getting following error:
ServerNameHere: RPC: Unable to send; errno = Bad file number; Illegal file descriptor
I am unaware of nitty gritties of RPC, can anyone help?
I need urgent help. Thanks in advance for any help provided.
Just to elloborate on problem, this error normally comes when I try sending some data 2nd time. I am sending different data each time(taken by user input) in a loop.
Regards,
Ahsan
|
|
|
|
|
Knock Knock...
Anybody home? Someone please answer.
|
|
|
|
|
This is a Visual C++ forum on a site with an almost exclusive Microsoft bias. You're not likely to get help with a UNIX RPC problem here, I'm afraid.
Software Zen: delete this;
|
|
|
|
|
I am a newb to programming, so I use the MFC wizard in VC++ 2003. I would like to have access to the WindowProc function (the function that recieves all the messages), but it is locked. Does anyone know how I could edit the WindowProc function? Anyone that could help, that would be great.
|
|
|
|
|
I need stop the program,
<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {<br />
if (stricmp(lpCmdLine, "-noautorun") == 0) {<br />
autorun(); <br />
i cant juse break; <br />
<br />
}else if (lpCmdLine == NULL || _tcslen(lpCmdLine) == 0) {<br />
<br />
MessageBox(NULL, _T("No switch specified"), g_pszCaption, MB_OK | MB_ICONEXCLAMATION);<br />
return 0;<br />
}<br />
<br />
void autorun(){<br />
if void autorun() ends, <br />
the program needs to stop running <br />
<br />
i cant juse return 0;<br />
<br />
return 0;<br />
}<br />
error C2562: 'autorun' : 'void' function returning a value<br />
<br />
thanx for helping me
Greets Jeroen
|
|
|
|
|
Obviously voids can't return a value but I think you could use ExitProcess API or maybe TerminateProcess API. Try this link
-Ryan M.
|
|
|
|
|
Thanx ryan M.
<br />
void autorun () {<br />
<br />
ExitProcess(0); <br />
}}<br />
Jeroen .b
|
|
|
|
|
don't exit() function work too ?
TOXCCT >>> GEII power
|
|
|
|
|
Sorry, I don't know if this autorun() -function is something special, but if you have a function which has void as return type you can just use the instruction return; to end the function (without any value) or just leave out the return instruction completely.
Hope it helps...
Regards, mYkel
|
|
|
|
|
no i cant use return;
or leave out the return instruction
it gives errors with other functions
ExitProcess(0); works good
Greets jeroen
thanx for your time
|
|
|
|
|
|
he CANNOT return a value if the function is told as "not returning a value", which is the meaning of void here !!!
TOXCCT >>> GEII power
|
|
|
|
|
<br />
void autorun (void) {<br />
<br />
}<br />
exit (0);<br />
}<br />
Jeroen.b
|
|
|
|
|
i kow it works, but actually, i'd like to know the difference between ExitProcess() and exit()
TOXCCT >>> GEII power
|
|
|
|
|
On an Intel architecture, do the following two lines mean the same thing, or for that matter, is the first even valid? I'm struggling with inconsistent lecture notes here and I'm being driven mad!
1) move %eax, 40-16(%fp)
2) move %eax, 40-16(%ebx)
Not knowing Intel assembly very well, I assume that the second operand is using relative addressing, though I'm also not sure about the meaning of 40-16, if anyone could shed any light>
Thanks!
--
Andrew.
|
|
|
|
|
why did you use %fp? is that even a register.? I am not sure if it is even valid but then again i have only been doing assembly for a month now.
-Ryan M.
|
|
|
|
|
I'm pretty sure %fp isn't a register. It's not my code, it's from some lecture notes I'm trying to understand, but am struggling to since I don't know where the %fp comes from.
I presume it's referring to teh frame pointer, which points to the place in the stack where the frame pointer is held for the previous stack frame.
Do you know what the 40-16(%ebx) does?
(I translated %fp into %ebx myself, there is no mention of %ebx in the notes... weird!).
--
Andrew.
|
|
|
|
|
hmm... that is probably true. I have no idea where the 40-16(%ebx) comes from but there is one thing weird about this code: move eax, 40-16. move? I think it should be mov. You might want to figure out what you wrote in the notes. What exactly was this code/program trying to do? Trust me, you are much better at assembly than i am. I am only 14 years old so most of this i have to learn myself; i dont have any classes for this
-Ryan M.
|
|
|
|
|
Taking the last point first, it was me mistyping . I should've typed movl not 'move'.
I also misused %ebx, I think it should have been %esp. Bascially he's trying to move the value of a local variable stored on the stack into the accumulator register.
--
Andrew.
|
|
|
|
|
movl isn't standard Intel x86 assembly, the width of the operation is implicit in the registers, al, ah for 8 bit, ax for 16 and eax for 32. Perhaps this is Unixish?
Anyway bit more code might help.
Paul
|
|
|
|
|
Ok so basically i was wondering if it is possible to have a program copy itself into every directory on the system. If it is possible can you please post the source code
-Ryan M.
|
|
|
|
|
Sure it probably is, baring security!
But there is no ligitiment reason for doing so.
INTP
|
|
|
|
|
yeah i figured that. My friend was trying to do that and i looked at his source code and it wouldn't even compile so that is why i asked this question
-Ryan M.
|
|
|
|