|
I'd prefer GetKeyState - it reflects they keyboard state of the message currently processed (i.e. it's "closer to the actual click")
Italian is a beautiful language. amare means to love, and amara bitter.
sighist | Agile Programming | doxygen
|
|
|
|
|
I am interested in caturing the packet using winpcap and then send it to the other destination after changing some attributes of packet.
I have captured the packet but unable to send it to the specific destination please if you can help me with sample code or website reference.
Reply me soon
|
|
|
|
|
Hi all!!
I have a form on wich I dynamically create an ActiveX using the Create method of it (the ActiveX is a member variable of my FormView).
What now if I want to remove tha ActiveX?? How can I do this ??? I don't know a lot about ActiveX...
Can somebody help me?
Thanks
|
|
|
|
|
Just call DestroyWindow() for the CWnd the ActiveX is associated with.
Italian is a beautiful language. amare means to love, and amara bitter.
sighist | Agile Programming | doxygen
|
|
|
|
|
Great !! Thanks a lot
|
|
|
|
|
I want to Create a Frame/view/doc structure On a ActiveX Control,but It will be Found Memory leak! And I Found that the reasons is :
CDocManager* CDocManager::pStaticDocManager;
CPtrList* CDocManager::pStaticList;
How Can I avoid Memroy leak?
the Following is My Code :
BOOL Create()
{
if( m_pFrameWnd )
{
if( IsWindow(m_pFrameWnd->m_hWnd) ) return TRUE;
}
CSingleDocTemplate * pDocTemplate;
pDocTemplate = new CSingleDocTemplate(IDR_MAPTYPE,
RUNTIME_CLASS(CMapDoc),
RUNTIME_CLASS(CMapFrame),
RUNTIME_CLASS(CMapView));
CMapDoc * pDoc = new CMapDoc;
CCreateContext Context;
Context.m_pCurrentDoc = pDoc;
Context.m_pNewDocTemplate = pDocTemplate;
Context.m_pNewViewClass = RUNTIME_CLASS(CMapView);
Context.m_pLastView = NULL;
Context.m_pCurrentFrame = NULL;
CMapFrame * pFrameWnd = new CMapFrame;
m_pDoc = pDoc;
m_pFrameWnd = pFrameWnd;
m_pDocTemplate = pDocTemplate;
CRect rcMap;
GetClientRect(&rcMap);
BOOL ret = m_pFrameWnd->Create(AfxRegisterWndClass(CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE, rcMap,this,NULL,&Context);
m_pFrameWnd->ShowWindow(SW_SHOW);
return ret;
}
ZHANGYIFEI
|
|
|
|
|
This is just a guest, but are you deleting m_pDoc, m_pFrameWnd, m_pDocTemplate when you are finised with them? Normaly, I would put code in the destructor to insure that all allocated member items where freed when the class/object was destroyed.
Trust in the code Luke. Yea right!
|
|
|
|
|
sorry ,this can't resolve the proplem!
you may try it by yourself!look what happen!
ZHANGYIFEI
|
|
|
|
|
Sorry, but there is not enough information for me to fix it. If you have not already, I would recommend you run it through "Bounds Checker" (trail version available). If the memory is allocated in that small piece code you gave then it should be easy to find.
Trust in the code Luke. Yea right!
|
|
|
|
|
hello,
is there a method available to check, if the tray of a cd-rom is inside or not?
the IOCTL_STORAGE_CHECK_VERIFY only checks if the media is ok, but there is no
difference between closed cd-rom and no cd and open cd tray.
how can i check if the tray is open?
thanks
enrico
|
|
|
|
|
Hi all,
Where can I find the STL implementation of List and Hash Table containers? Is it published?
-----------------------
Go USA Go
|
|
|
|
|
Try it here[^]. I have never downloaded it, though. But this site is really fine as an STL documentation.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Thanks, great link.
I couldn't find any actual code. I'm looking for the implementation of these templates. Is it an open source?
-----------------------
Go USA Go
|
|
|
|
|
There IS a link 'Download the STL'. You can then download the specific files or the whole tar archive.
For the licenses, you need to look around yourself and maybe mail them for details.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
oops. Thanks again.
-----------------------
Go USA Go
|
|
|
|
|
I need to catch app activation.
I try to use WM_ACTIVATEAPP but I've found strange Windows behavior (I tested on WinXP, Win2K, and think that other OS works the same):
start two programs (two Explorers, for instance),
make active first program,
then click in taskbar on first program: it will be minimized and the second one will be activated.
There is a list of messages that first program receives (checked with Spy++):
<br />
1 Send WM_ACTIVATE fActive:WA_INACTIVE fMinimized:false<br />
2 Return<br />
3 Send WM_ACTIVATEAPP fActive:false dwThreadID:some number<br />
4 Return<br />
5 Post WM_SYSCOMMAND uCmdType:SC_MINIMIZE<br />
6 Send WM_ACTIVATEAPP fActive:true dwThreadID:0<br />
7 Return<br />
8 Send WM_ACTIVATE fActive:WA_ACTIVE fMinimized:true hwndPrev:0<br />
9 Return<br />
In lines 1-4 window and application are deactivated (but not minimized), then posted minimize command (5), and then application and window are activated (window is minimized at this time). Note, that at this moment actually the second program is active, not the first one!
And when you activate first program again it won't receive WM_ACTIVATEAPP because it has received it already.
So how can I catch the app activation in this situation?
|
|
|
|
|
I'm beginner in activex programming and i have a problem with getting files through an activex,i want to write an activex that have a property called "Bitmap".this property Will set with a bitmap file that user select from "All" property sheet.now through the class wizard and in "Add Property" Dialog , what type should i select?
External name: Bitmap
Type: --->I don't know which one!
Variable name:
Notification function:
Implementation: --->I don't know which one!
Member variable...Or Get/Set methode.
if possible please give me a brief description about handling this type of property.
My english isn't well,Please excuse me for bad comments.
Thanks a lot.
|
|
|
|
|
In my program, I want to load a .jpg picture as a part of the resource.
The API funtion LoadImage() can only load pictures like .bmp. How can I load a .jpg picture into my program only with API funtions? Please help me!
stanley
|
|
|
|
|
I think it is not possible to use .jpg picture in Win32 API.
Try to use IPicture COM-object instead.
|
|
|
|
|
You can do it by using CCtrlList class's SetBkImage() function.
Chintan
C.R.Naik
|
|
|
|
|
I found out that, by default, I cannot pass CString objects in to(or out of) an MFC extension DLL, no matter it is passing by value, by reference or by pointer, doing so will guarantee a run-time "user break point reached" error, if I look into the debug context I find the error was caused by CString destructor.
Although I can get around it by using TCHAR arrays instead of CString, that not only makes my code look swollen, but also a hell lot more awkward... I mean, why would I even use MFC without being able to enjoy the sheer convenience that CString brings to us?
So since you guys are all experts I'm sure some of you will help. Below are part of my code:
<br />
class AFX_EXT_CLASS ClassFoo<br />
{<br />
public:<br />
void FuncBar(CString& str);<br />
};<br />
<br />
void ClassFoo::FuncBar(CString& str)<br />
{<br />
CString strOther = _T("blah blah blah");<br />
str = strOther;<br />
}<br />
<br />
void FuncFooBar()<br />
{<br />
ClassFoo foo;<br />
CString str;<br />
foo.FuncBar(str);
}<br />
I wish I explained my trouble clearly, and thanks in advance.
|
|
|
|
|
The problem you have described usually occurs when your main MFC exe and you extension DLL are both using different heap managers. Make sure you exe and MFC ext dll are using MFC in a shared DLL. You should hen be able to pass CString objects across without any problem.
As you currently have different heap managars, they are trying to deallocate pointers created by each other and having problems as they are not recognised.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
My dll and exe were using MFC in a shared dll, so I guess there must be something else are wrong...
|
|
|
|
|
1. Go to Project/Settings
2. Click in the C++ tab.
3. Select the Code Generation category.
4. Verify the "Use run-time library" combo has the same thing for both of your projects.
Here's what I use for my projects:
Win32 Debug: Debug Multithreaded DLL
Win32 Release: Multithreaded DLL
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
In the past I have had problems with..
=[ Abin ]= wrote:
AFX_EXT_CLASS
instead i use __declspec(dllexport) on the constructor/destructor and any functions I want to export.. Not sure if that has anything to do with your problem..
One other thing why "CString& str" in your dll function?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|