|
Hi, you need too Google the "Observer Pattern" to see a very well explained answer to your question. Hope this helps.
|
|
|
|
|
Hi,
I have an idea to develop one MSDEV (VC6) addin that shows the line numbers in editor (like the VS2008 IDE).
Could you please give me the basic idea that I should follow (i mean how to modify the existing editor window)?
Krishnakumar TG
|
|
|
|
|
Krishnakumartg wrote: I have an idea to develop one MSDEV (VC6) addin
Why, oh, why do you want to do an add-in for an antiquated IDE ?
Nihil obstat
|
|
|
|
|
I agree with the previous post... why would you want to develop something new for something so old?
If you just want a project, I'm sure you can find other more useful and productive things to work on. Line numbers are hardly ever useful either, I've never had the need for them (I guess if you're having a need to discuss a file with another coder they'd be useful but I've never needed them).
|
|
|
|
|
Krishnakumartg wrote: Could you please give me the basic idea that I should follow (i mean how to
modify the existing editor window)?
Have you already researched whether that VS supported Addins at all?
If it does then finding examples would be one way to approach it.
|
|
|
|
|
Hi,
I am trying to prepare a test application that combines two windows. I visualize that if one window is dragged, the other one also drags automatically.
For this,
1. I created a dialog based app
2. In button click created a new window (other than dialog apps window). And the new window is attached with the dialog apps window.
But after the button click whole the app hangs. Unable to touch the windows.
The code is as follows. Could you please help?
CWnd NewWindow;
void CAttachDlg::OnButton1()
{
CRect crect( 0, 0, 500, 500 );
RECT rect;
rect.left = 0;
rect.top = 0;
rect.right = 100;
rect.bottom = 100;
CString csClassName = AfxRegisterWndClass( 0 );
BOOL bReturn = NewWindow.Create( csClassName, "Test", WS_POPUP | WS_VISIBLE, crect, this, 0 );
RECT wRECT;
GetWindowRect( &wRECT );
wRECT.right = wRECT.left - 1;
wRECT.left = wRECT.left - 100;
NewWindow.MoveWindow( &wRECT, TRUE );
this->Attach( NewWindow.operator HWND());
}
Krishnakumar TG
|
|
|
|
|
Hello Krishnakumartg,
Use CreateEx method insted of Create. Because WS_POPUP cannot be used with the Create method.
|
|
|
|
|
How to shut down computer using c programming?
|
|
|
|
|
By calling the appropriate OS API, if any, if you are permitted.
|
|
|
|
|
Basically two ways to do this that I know of:
1. Make a call from your C code to the Operating System API for shutdown. Which API call, what permissions you need and what options you have depends on the Operating System.
2. Break out the books and learn to make ACPI BIOS calls, probably more assembler than C. This will do it fast and sure but you may corrupt your OS and will certianly loose any unsaved data if you go this way.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
|
Hello Friends
I am going to add Ribbon Toolbar in My Existing MFC application. As i go through on net,i found that in VS2010,we can create Ribbon Resource using Ribbon Designer Inspite of using Ribbon Classes to create Ribbon Toolbar.
Now, I am using VS2010. I want to know How can I Add Ribbon toolbar to my application which is using old toolbars. Do I need to create Ribbon Resource Independently and then to load in Exisitng Application Or Some other Way to DO it?
Any Help Will be Appreciated.I want to in Right way when I update to Ribbon toolbar.
Thanks In Advance.
Regards
Y
|
|
|
|
|
|
Hi,
I have a derived CAsyncSoct class as a member of a Derived CwinThread Class
the members that I have in my derived CAsynSocket class include data members such as a port no
that I wish to connect to
so...
class CSocketThread : public CwinThread
{
public
CSocket thisicket
}
class CSocket : public CAsynSocket
{
I create a UI thread
via new SockThread(start_port)
I create the thread suspended
fill in the missing pieces such the ipaddr, port #
Then do a resumethread this should kick the SockThread:Iinitinstance overridable
I figure by this time everthing the SockThread and Csocket Objects has been Created
So in the SOckThread::initinstance I do a Socket.create withe yhe ipaddr and port
By the time i get to create the third of fourth thread I get an exceptin from
CAsynSocket::Create
One of my questons is if I create the SockThread on the heap via new does that mean
every data memeber and or classes such the CSocket is contructed on the heap
and is there something wrong with my design
Thanks in advance
|
|
|
|
|
First of all, without synchronisation objects, you can't rely on anything having happened in another thread.
Second, CAsynchSocket has some inherent design problems (see CSocket considered harmful). You might want to consider rolling your own using the Win32 SDK if you're going to keep it running in a separate thread.
Third, you shouldn't create your CWinThread object directly. Use AfxBeginThread instead.
|
|
|
|
|
Thank you for response youe point about synchronistion is well taken
Second I am creating a UI thread as I want the send/receive socket to be initiate dvia messages and I dont beleive the owrker threads can process messages
I didn't know there were porblems with CSocket
Thank you
|
|
|
|
|
i used browser control in win32 dialogbox. i want to disable rightclick popup. who can i do that .
|
|
|
|
|
Is it your application wherein you are going to do this, or do you want this to be across the SYSTEM?
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
yes,i have one win32 diallogbox with one browser custum control. i am calling this dialog from dll.it is working fine.i taring to disable right click of web browser control.
|
|
|
|
|
|
Hi,
How can i retain the text color while highlighting a particular row in Clist control
I am using a derived Clist control where already draw item is overridden in the name of OnNMCustomdraw (OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult))
|
|
|
|
|
The colors set in a custom draw handler for CListCtrl s are ignored for selected and hot items. With classic styles, the system uses COLOR_HIGHLIGHTTEXT for selected items. If you want to use other colors for selected and hot items, you must draw the items yourself and set the custom draw handler result to CDRF_SKIPDEFAULT :
void CMyListCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = CDRF_DODEFAULT;
LPNMLVCUSTOMDRAW lplvcd = reinterpret_cast<LPNMLVCUSTOMDRAW>(pNMHDR);
switch (lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT : *pResult = CDRF_NOTIFYITEMDRAW; break;
case CDDS_ITEMPREPAINT : *pResult = CDRF_NOTIFYSUBITEMDRAW; break;
case CDDS_ITEMPREPAINT | CDDS_SUBITEM : if (IsSelected(lplvcd->nmcd.dwItemSpec))
{
DrawCell(lplvcd, COLOR_HIGHLIGHTTEXT);
*pResult = CDRF_SKIPDEFAULT; }
else
{
}
break;
}
}
This example is for a report style list control.
|
|
|
|
|
how to build application for x86 on visual studio 2003
|
|
|
|
|
As opposed to what? Normally F7 will build whatever application you have created.
Have you tried this forum?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
x86 is usually the default... so just build it and it should work on x86. if you have to do something for x64, then you usually have to use the 64-bit compiler (which is included but not the default).
|
|
|
|