|
Read "Applied cryptography". It is a little dated, but you won't understand any answer unless you know what that book contains.
|
|
|
|
|
hi,
i made a simple program with the MDC AppWizard...
the problem shows MDI window and child window inside it.
how can i remove the child window that he won't popup everytime i run the program?
(its the default situatoion when u use the appwizard...)
Avi
|
|
|
|
|
Check out MSDN article Q141725.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thanks, it helped alot and it worked...
|
|
|
|
|
Hi,
Does anyone know what the contents of the win32 api function closesocket(SOCKET s) are? As in, the exact code?
I need to use closesocket but I can't use the pre-written function because if I include winsock.h and such, the defines collide with too many of my other defines (I'm compiling and running the program under cygwin, but the problem is that the sockets are closed through windows, so I need closesocket to properly terminate them).
Thanks
Kelly Ryan
|
|
|
|
|
How are you opening the socket? Isn't the SOCKET parameter used by closesocket() the same one filled in by connect() ? In any case, SOCKET is just an unsigned int .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
use winsock2.h
and try WSACleanup() after to close everything
and also closesocket()
gabby
|
|
|
|
|
You can't replace closesocket(). The implementation is going to effect data stored in the TCP/IP stack that you don't have access to.
KellyR wrote:
if I include winsock.h and such, the defines collide with too many of my other defines
I believe you must solve that problem.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hi,
i have a dialog based app with a PretranslateMessage and a OnKeyUp Function that looks like this
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN)
{
switch (pMsg->wParam)
{
case VK_ESCAPE:
break;
....
}
return CDialog::PreTranslateMessage(pMsg);
}
void CMyDlg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
MessageBox ("Up");
CDialog::OnKeyUp(nChar, nRepCnt, nFlags);
}
But the Key up does not work ;
Exception : if i place it directly into the PretranslateMessage Function I can handle the event.
What is the problem ?
thanks
ch
|
|
|
|
|
So here is the problem ... i've been searching for days in the interet but found nothing that could help me. If someone knows the solution of my problem ...
So I wrote a multilanguage application with nice resource only dll's for the dialog boxes, menus ... It works fine libraries and resources are loaded, but there's a problem for two of them.
My application is made of 2 CFormview. It seems that the application loads once the resources for thoses two formviews during the CMainFrame::OnCreateClientfunction, and then nevermore.
Is there a possibility for a view to reload it's dialog resource at runtime ? I've been trying updateview, updatedate, invalidate ... Im'not sure that it is possible .
Tank you for your answer !
Djizzio
|
|
|
|
|
Hello,
It seems that in the app. where I'm working on, the default behaviour of OnKeyDown doesn't seem to catch the return key.
Can you modify this?
Can you modify this for 1 class and not for the entire app.?
tnx!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hi ,
you need to overide the virtualfunction OnGetDlgCode, and then write the following line of code . Your Class must be derived from CWnd.
return CYourClass::OnGetDlgCode() | DLGC_WANTALLKEYS;
Djizzio
|
|
|
|
|
Hey,
tnx for your reply.
I did this:
<br />
UINT CtrlFlexArray::OnGetDlgCode(){<br />
return CWnd::OnGetDlgCode() | DLGC_WANTALLKEYS;<br />
}
but the OnKeyDown still doesn't catch the return key.
Did I forgot something or did I do something wrong?
(NOTE: CtrlFlexArray is derived from CvsFlexArray and CvsFlexArray from CWnd, but I don't think this is the problem)
tnx!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Don't forget to add
ON_WM_GETDLGCODE()
to the message map of your class.
|
|
|
|
|
|
I found my error;
Forgot to add a WM message;
but hey, now it works
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I want to install three hooks in a dll,one is WH_GETMESSAGE, two is WH_CBT,the other is WH_SHELL,the first hook is installed successfully but the second failed,codes as below:
BOOL __declspec(dllexport)__stdcall installhookCBT(HWND hCallProc)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
hCallHook=hCallProc;
hkbCBT=SetWindowsHookEx(WH_CBT,(HOOKPROC)CBTProc,hins,0);
if(NULL == hkbCBT)
{
DWORD d=GetLastError();
CString str;
str.Format("%d",d);
CFile file;
file.Open("D:\\1.txt",CFile::modeCreate|CFile::modeWrite);
file.Write(str,str.GetLength());
file.Close();
return FALSE;
}
return TRUE;
}
value d is 0,why?
this error is happened today,but all three hooks are installed successfully yesterday.
|
|
|
|
|
Hi,
I want to get the process path name..The scenario is like this..
I have same two .exe's in two different folder, which calls a single dll file in which i need to know which ever process is currently using the dll, I need to know it's path name...I get a wrong path when i use GetModuleFileName()API..
Give me some tips..
Shiva P
|
|
|
|
|
Maybe GetCurrentProcess, followed by OpenProcess, followed by GetModuleHandle with the process handle could do it. I haven't tried it, just guessing.
I hope this helps
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Maybe GetCurrentProcess, followed by OpenProcess, followed by GetModuleHandle with the process handle could do it. I haven't tried it, just guessing.
I hope this helps
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
GetModuleFileName(NULL, ...) is what you want to call from within the EXE.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
TssPrasad wrote:
I have same two .exe's in two different folder, which calls a single dll file in which i need to know which ever process is currently using the dll
That's not how processes work. Each EXE has its own private instance of the DLL (there is one copy in memory, but nothing is shared unless you use shared memory or another IPC mechanism).
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Hi Guys,
Iam working on an MFC application.am drawing some lines to the screen using the device context.Iam selecting a font of type "ANSI_FIXED_FONT".
Iam doing it as follows, & stores the font height in a "m_fontHeight" class variable.
m_deviceContext->SelectStockObject(ANSI_FIXED_FONT);
TEXTMETRIC fontMetric;
m_deviceContext->GetTextMetrics(&fontMetric);
m_fontHeight = fontMetric.tmHeight;
Now my question here is,will the font height iam getting here, will be the same on all windows machines.
For eg.- , if I get a FONTHEIGHT here as 13,Will it be the same on some other machine as well...
Thanks
|
|
|
|
|
Test it on another machine. I'd say font height is machine dependent.
Kuphryn
|
|
|
|
|
How to implement a scroll bars in CStatic-derived class. If I'm add following lines then scroll bar will visible, but WM_HSCROLL message not send to my CStatic-derived class.
EnableScrollBarCtrl(SB_HORZ);
SetScrollRange(SB_HORZ, 0, 100);
ShowScrollBar(SB_HORZ);
What's the problem?
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|