Thanks Sujan and Andrzej. Both solutions seem to work..
Seems to me that the MSDN library which explains the SetBitmap function of the CStatic control should be updated...
I got that specific codepart for the control created on the stack from the MSDN lib.
Ah another thing, when using the code part:
m_statCtrl.SetBitmap(::LoadBitmap(....)); //m_statCtrl is CStatic control
don^t you loose memory? I mean the documentation on LoadBitmap says that one should call DeleteObject on handles created by LoadBitmap... On the other hand, MSDN suggests this code-snippet to set the bitmap on a CStatic... I don^t think the CStatic deletes the handle when it gets destroyed or changed, or does it?????
(another thing that should be updated in MSDN perhaps?)
Can some one tell me the differences between semaphores,critical section and mutexes.When should they be used(i know these are used for synchronization between threads) and the advantages/disadvantages of them over the other.
in one sentence.
Semaphore can be used to manage resources, criticalsection to synchronize access to shared data within same(single) process and mutex to synchronize access to shared data among different process also.
I had splitted the actual view into 4 parts. every view is been derived from different view's class.
The main problem is the one splitter window which has been derived from the FormView has got 2 edit boxes which will resizing itself based upon the size of the window. and when I click in someother view some message has to be displayed in these edit boxes. for example when I click in View1 then some message which I pass from View1 has to be displayed in the edit boxes present in the View2.
I am trying but its always giving me assertion failed and when I debug it its giving the asserting failed in the SetWindowText message. I had created 2 different variables of type CEdit.
Neelesh K J Jain.
I am getting the assertion failed in the winocc.cpp at line 229, When I am using the SetWindowText
Get the view address using GetActivePane() function and use it for setting the window text using setwindow text function
CMyView *pView = (CMyView *) mysplitter.GetActivePane();
Here i do consider that i am having two panes ie two views, first the CCallManagerView(0,0) and the other CUserView(1,0). So when i do need to set some value to the CCallManagerView's control from CUserView, i'll be using the following code
CMainFrame *pMainFrame = (CMainFrame *) GetParentFrame();
CCallManagerView *pView = (CCallManagerView *)pMainFrame->m_wndSplitter.GetPane(0,0);
pView->myEdit.SetWindowText("Hai From Call Manager");
Hope this may help you. If you want the CUserView then use GetPane(1,0)
I don't have a big experience with USB but I'm using a USB device and for this one, they provided a device driver that is used to communicate with the device. I can send control codes to this driver using the DeviceIoControl function. These control codes where also provided by the manufacturer of the USB device.
So every action (open a pipe, write data on this pipe, read data, ...) is performed via this function. I open the device with the CreateFile function.
Gee, it's kind of hard to know what your program needs, if you're not going to tell us what it uses.
There is a program called 'Depends' ( from memory ) in the stuff that comes with VS, it might tell you waht you need. If you use MFC, you need the MFC dll, if you use C in your program, you'll need MSVCRT, etc.
I assume it's a release build ?
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder