|
Sorry then,thats all from my side...
Will update you if I find any help on this issue...
Rakesh
|
|
|
|
|
Thankyou.
|
|
|
|
|
Hello,
I found some interesting facts about CSplitterWnd::CreateView(). The document says that you cannot call the 'CreateView()' from outside the OnCreateClient(). But you can call it indirectly from OnCreateClient() i.e. you can call another function from OnCreateClient() which calls CreateView().
________________________________________________________
For example....
OnCreateClient(..)
{
CreateAllViews(..)
}
CreateAllViews(..)
{
CreateView(...);
CreateView(...);
}
______________________________________________
In your code you are calling CreatView() in
void CMyTree::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult).
I think this might be the reason why you get an exception.....
Rakesh
|
|
|
|
|
I write code to communicaton between PC and microcontroller by serial port. I use CreateFile,WriteFile,ReadFile,...and program only use lines Tx,Rx of COM port, program run ok. But now I want to Set/Clear and read status of other lines (pins) of COM port: DTR,DSR,DCD,....
How to do that ?
Pls help me !
Thank !
|
|
|
|
|
I down a example (gridctrl_demo225) to study. in the code one thing puzzled me.
platform : VC.Net
a CGridCtrl based on CWnd,
a Dialog(CDlgA) is the parent of the CGridCtrl instance.
following is a part of the code
// EFW - Added to forward right click to parent so that a context
// menu can be shown without deriving a new grid class.
void CGridCtrl::OnRButtonUp(UINT nFlags, CPoint point)
{
CWnd::OnRButtonUp(nFlags, point); // !!!this call trigers CDlgA::OnContextMenu(...)
:
:
}
I read document of CWnd::OnRButtonUp(nFlags, point), it does not say, it will triger parent's OnContextMenu. so if I say CWnd::OnRButtonUp(nFlags, point) calls parent's OnContextMenu(...). Is it right?
And the weird thing is I set a breakpoint in CDlgA::OnContextMenu(...) want to see who calls it. There is no records of callstack.
|
|
|
|
|
You shouldn't handle WM_RBUTTONUP if you want the default context menu handling, because the default window proc will send a WM_CONTEXTMENU when it sees WM_RBUTTONUP . If you do context menu handling in response to WM_RBUTTONUP , the user won't be able to bring up the context menu using the keyboard.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
in CGridCtrl::OnRButtonUp() it calls base class's CWnd::OnRButtonUp() so My DlgA::OnContextMenu() was called.
I want do same thing for my View. But why MyView::OnContextMenu() won't be called. MyView is CGridCtrl's parent. same as DlgA
|
|
|
|
|
How does one force focus to a new control.... an edit control....
from within an MFC CDialog
SetFocus isn't doing it for me. Focus/Capture is always going to the default button.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen (a.k.a. not an MFC expert!)<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
-- modified at 18:16 Friday 2nd June, 2006
|
|
|
|
|
Try GotoDlgCtrl()
CEdit* pBoxOne;
pBoxOne = (CEdit*) GetDlgItem(IDC_EDIT1);
GotoDlgCtrl(pBoxOne);
Although I would not use GetDlgItem.
Have you tried youreditctrl.SetFocus()?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
-- modified at 18:22 Friday 2nd June, 2006
|
|
|
|
|
I have a CEdit control on a CDialog that is in a docking DialogBar.
Is it possible to have 2 accelerators with the same values, one for the CEdit control, and one for the Whole application that do 2 different things ?
For example; in our case, we would like to be able to hit "Ctrl-X" when the user select the text in the edit box, and also do a "Ctrl-X" if the focus in on another control ( somewhere else in the application ? )
Our application has a custom Edit processing ( cut copy paste will open a dialog ). so now, when the user wants to cut/copy/paste text from an edit box, it does not cut/copy/paste the text, but will start our own cut/copy/paste process.
Is it possible to have the 2 different behaviour with the same accelerators ?
It's not a very clear description. sorry about that.
Thanks
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: Is it possible to have the 2 different behaviour with the same accelerators ?
I believe it practical.
Maxwell Chen
|
|
|
|
|
I've created a WSAEventSelect socket and put it in its own thread with a loop to handle FD_READ events.
Is it possible (and ok) to send packets outside of the thread as long as I have the socket handle?
Also, can I call functions from within the socket thread to change data from a class that wasnt passed to the new thread?
AKA push items onto a vector from within the threaded socket loop.
|
|
|
|
|
SPowers wrote: Is it possible (and ok) to send packets outside of the thread as long as I have the socket handle?
Yes. It is both possible and okay. Some design implementations call for separating the sending and receiving sections for communications.
SPowers wrote: Also, can I call functions from within the socket thread to change data from a class that wasnt passed to the new thread?
AKA push items onto a vector from within the threaded socket loop.
You will probably want a queue, but yes. Just make sure you use critical sections when adding/removing items from the vector/queue.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
I apoligize for my ignorance...
what are critical sections?
Is this related to the read / write problem?
|
|
|
|
|
SPowers wrote: what are critical sections?
A synchronization object clickety[^]
|
|
|
|
|
Hello again
I have a question : What is a handle ?
Is it something like pointer ?
What is difference for example between HWND and a Cwnd ?
Please give me some explicit explanations.
Thank you.
|
|
|
|
|
big_denny_200 wrote: What is a handle ?
A handle is a unique serial number for Windows (and managed by Windows) to identify an instance (or a system object like a window, an event, a timer, a mutex, ... ).
big_denny_200 wrote: What is difference for example between HWND and a Cwnd ?
HWND is a handle: the concept to Windows programming.
CWnd is a class type: the concept to C++ language. This type is defined in MFC Library.
-- modified at 16:58 Friday 2nd June, 2006
class CWnd has a data member of type HWND.
Maxwell Chen
|
|
|
|
|
Hi All,
I need help to find some info of how to develop in visual C++ and VOIP .
I looked in this site and didn't find something really helpful.
Please help me.
Thanks.
|
|
|
|
|
If you are not an experienced Visual C++ developer I suggest you tackle that problem first and in isolation from the VIOP problem.
|
|
|
|
|
I know C++ and i have a lot of experience with visual C++.
I just need some example to know and learn how to use the classes of VOIP.
I don't know nothing about VOIP - and i want to learn - i thought that with some code example i could learn.
Can someone help me ?
-- modified at 16:43 Friday 2nd June, 2006
|
|
|
|
|
yanshof wrote: some example to know and learn how to use the classes of VOIP.
Maybe try THIS LIBRARY[^].
Maxwell Chen
|
|
|
|
|
Hello again
Please someone explain me next situation
I have next code :
...
const UINT SIZE = 5;
TCHAR strDest[SIZE];
LPCTSTR strSource = _T("cool");
_tcscpy_s(strDest,sizeof(strDest)/sizeof(TCHAR), strSource);
CString s(strDest);
MessageBox(s);
...
Everything works fine, but I get some differences in Debug and Release builds.
Specifficaly, in Release build, in debugger when I look at contents of strDest after _tcscpy_s function, I see that, first 4 bytes of it are occupied by come strange characters and 5th byte is 'c' , but anyway the resule is displayed correctly in Message box.
In Debug build everything happens as expected : first 4 bytes are occupied by 'c' 'o' 'o' 'l' and 5th byte is '\0'
Why is this difference ?
thank you.
I have VS2005
-- modified at 14:21 Friday 2nd June, 2006
|
|
|
|
|
The first 4 bytes of a CString are taken up by an DWORD (unsigned long) that holds the size of the buffer. You should see that in both the Debug and Release builds, but the Debugger may move the pointer to the first part of the character buffer when it is built in Debug. If you check the memory at &strDest, you should see similar results for both.
Also, if you intend to place the results of 1 CString into another, you don't need a character buffer.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Looks like that this is bug in visual studio debugger
This strange symbols are nothing else than the pointer to the "cool" string in your resource section(.rdata usually) of executable. In debugger window you see destination buffer address decremented by 4 bytes. I don't know why this happens, but I think that this is bug.
|
|
|
|
|
I am creating a service along with a sys file to aid me in writing to the parallel port data byte. Iam using the code segement given below.
Ser = CreateService (Mgr,
"hwinterface",
"hwinterface",
SERVICE_ALL_ACCESS,
SERVICE_KERNEL_DRIVER,
SERVICE_SYSTEM_START,
SERVICE_ERROR_NORMAL,
"System32\\Drivers\\hwinterface.sys",
NULL,
NULL,
NULL,
NULL,
NULL
);
How ever if i change the term "hwinterface" to say "mydriver". It stops working neither does the sys file get created nor does it interface with the port. Furthermore, the Description of the file is set as buzz driver and copyright is to Buzz corporation why is this happening and how do i change the service name and its associated attributes to say Description: "My ParallelPortDriver"
Copyright to "MYcompany".
any help in this regard would be great.
sharath
|
|
|
|