|
Thanks!
You are right. I should have been able to hit those myself.
craigk
|
|
|
|
|
I have a program that runs fine as a service under windows nt, however when I try to run this on windows 2000, I get an error message when I try to manually start the service from the service control panel. (I haven't tried to let it start automatically, since I assume the problem will continue to occur.) I get the message that the Service failed to start in a timely matter error 1053. The event log shows that the process timed out at 3000 milliseconds. Does anyone have any suggestions I haven't been able to find much regarding this?
|
|
|
|
|
Maybe some library used by your program is missing on the Windows 2000 machine?
|
|
|
|
|
Unless there is something nt vs. 2000 specific in the libraries, I don't believe this to be the case, as the program works perfectly when I run it as a "standard" application, it is only when I run this as a service that there is a problem. Also the Service Main function spawns a thread where all of the applications work is done. Which incidentally is ftp processing, if that helps at all.
|
|
|
|
|
Is it possible to pass a socket handle between apps?
|
|
|
|
|
Yes. HANDLE is a pointer to a pointer. Do you develop the applications or just one? The reason I ask is because you have to implement a solutino to send and receive the handles.
Kuphryn
|
|
|
|
|
I am developing both applications.. What functions should I look at for doing such a thing?
|
|
|
|
|
There are several solutions for data sharing among processes.
- Winsock
- File-Mapping
- Namepipe
I recommend file-mapping. Mapping the handle of your socket with a valid name. Search for that file-mapped on the other applications via its name.
Kuphryn
|
|
|
|
|
Suppose I have an unsigned integer variable. How can I read only bits 3 to 10 off of it?
Isaac Sasson,
Small time programmer - complainer at large!
Sonork ID 100.13704
|
|
|
|
|
do a binary and (&&) with a bitmask
i.e.
binary 0011111111000000 = 0x3FC0 (hex)
so
nResult = nNumber && 0x3FC0;
You can then use the shift operators << or >> to shift the bits if you want to strip of trailing zeros
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
BOOL IsBitOn (UINT uOriginal, UINT nBit)<br />
{<br />
uOriginal >>= nBit;
uOriginal &= 1;
return (uOriginal == 1);<br />
}
and for the concisists...
#define IsBitOn (x,n) ((x>>n)&1)<code><br />
<br />
Or if you just want to mask out the other bits,<br />
<br />
<code>uOriginal &= 0x03fc;
I hope that helped,
Iain.
|
|
|
|
|
i want to see what does the preprocesor generates how can i do that?, using vc++ 6.0
|
|
|
|
|
add /E to the compiler options. Preprocessed files will go to stdout.
Back to real work : D-22.
|
|
|
|
|
thanks.
|
|
|
|
|
Hi!
I have a MFC application that handle idle processing by overloading CWinApp::OnIdle ; for menus and dialogs, I handle the WM_ENTERIDLE in my MainFrame. But I use ShowHTMLDialog API to display HTML page, and then, I don't receive EnterIdle any more. Why ?
Thanks for any help
Regards
Emmanuel Derriey
|
|
|
|
|
i am not sure if WM_ENTERIDLE is a standard message.
if yes, u can get if from PreTranslateMessage function.
if not (it's a fuction call actually), microsoft never offers it for the class.
includeh10
|
|
|
|
|
ShowHTMLDialog shows a modal dialog box, so by definition you can't expect your app to continue to go into idle from time to time.
There's a work around for that, you have to create a separate thread, and call ShowHTMLDialog in that thread.
Back to real work : D-22.
|
|
|
|
|
Why does some write:
typedef struct {
foo bar;
} MyStruct;
whilst I write
struct MyStruct {
foo bar;
};
I know that it's possible to declare LPMyStruct in the first example.
And why the _TAGMYSTRUCT in some cases?
|
|
|
|
|
I think the fomer syntax is C-code (as opposed to C++), meant to trick some C-compilers into doing what you want.
|
|
|
|
|
it is all for C.
typedef struct ABC
{
foo bar;
} MyStruct;
i.e.
MyFunction(MyStruct ms); //C needs struct as description
similar to:
MyFunction(struct ABC ms);
it can be used by both C and C++.
includeh10
|
|
|
|
|
That was what I meant: You can use all of these forms in both C and C++, but you only NEED them in C.
|
|
|
|
|
I want to change CString data to CString data(in Hex format) and change back from CString data (in Hex format)
to CString data. So I write this below code
<br />
CString m_str = "chop][:" ;<br />
CString ivstr;<br />
StrToHexStr(m_str, ivstr); <br />
StrToHexStr function change CString data to CString data(in Hex format)which have these below detail.
<br />
void StrToHexStr(CString& strData, CString& hexstrData)<br />
{ <br />
int j;<br />
CString strtemp;<br />
<br />
hexstrData.Empty();<br />
for (j=0;j<strData.GetLength();j++){<br />
strtemp.Format("%02X",strData.GetAt(j));<br />
hexstrData+=strtemp;<br />
}<br />
}<br />
I get ivstr = "63686F705D5B3A" (from m_str = "chop][:")
Then I write program to change back from CString data (in Hex format)to CString data.
<br />
ivstr = "63686F705D5B3A"; <br />
HexStrToStr(ivstr, m_str);<br />
HexStrToStr function change CString data (in Hex format)to CString data which have these below detail.
<br />
void HexStrToStr(CString& hexstrData, CString& strData)<br />
{ <br />
int j, strlen;<br />
CString c1, c2;<br />
int temp;<br />
unsigned char ctemp;<br />
<br />
strData.Empty();<br />
<br />
for (j=0;j<hexstrData.GetLength();j+=2)<br />
{<br />
c1= hexstrData.GetAt(j);<br />
if ((c1 == 'A')||(c1 == 'B')||(c1 == 'C')||(c1 == 'D')||(c1 == 'E')||(c1 == 'F'))<br />
{<br />
ctemp = c1[0];<br />
temp = (ctemp-55)*16;<br />
}<br />
else<br />
{<br />
temp = atoi(c1)*16;<br />
}<br />
c2= hexstrData.GetAt(j+1);<br />
if ((c2 == 'A')||(c2 == 'B')||(c2 == 'C')||(c2 == 'D')||(c2 == 'E')||(c2 == 'F'))<br />
{<br />
ctemp = c2[0];<br />
temp = (ctemp-55);<br />
}<br />
else<br />
{<br />
temp += atoi(c2);<br />
}<br />
strData += temp;<br />
}<br />
}<br />
But I do not get m_str = "chop][:"
m_str is the other string
Do you know how to solve my problem?
Thank you for your reply.
|
|
|
|
|
When reversing the process, take each two Hex chars, convert them to a long (strtol base 16 ) then format it into a char, then concatenate into a string
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
How can I get the coordinates of a window, relative to it's parent?
And how can I create sticky buttons on a toolbar? (Staying up/down when clicked)
Using MFC
|
|
|
|
|
Not sure about the coords part, but sticky buttons work exactly the same way as checkable menu items do
--
Help me! I'm turning into a grapefruit!
|
|
|
|