|
subramanyeswari wrote: It is drawing the control but Client area of window is blank
you mean black?How did you create the DC and bitmap?
also did you try PrintWindow() function?
|
|
|
|
|
I did not create dc and bitmap. Because that did not work. I wrote a function in which i am drawing the control and calling the sendmessage with WM_PRINT. it is drawing the control and scrool bars but the remaining portion is coming as blank.
I refer this link.
http://www.fengyuan.com/article/wmprint.html
in that article he clearly mentioned that If you send a WM_PRINT message to a window, normally all the non-client area, which includes border, title bar, menu bar, scroll bar, etc., and common controls are drawn properly. Client area of windows implemented by application programs are normally left blank.
and he gave the solution to implement WM_PRINTCLIENT. how to implement that in my control which is derived from CObject
Regards
modified on Monday, June 9, 2008 6:46 AM
|
|
|
|
|
Dear all,
how to switch off the "Show window content while dragging" to my window.?
is there any window style ?.
if there is no way how can i implement the style with coding. ?
thanks in advance
|
|
|
|
|
Try
::SystemParametersInfo with SPI_SETDRAGFULLWINDOWS parameter.
-@SuDhIrKuMaR@-
|
|
|
|
|
The SPI setting will turn it off for more than just your own window, and changing a user's setting on them is A Bad Thing , so Do Not Do That .
I have had to do this before and IIRC, I had to handle the WM_MOVING , WM_SIZING , WM_MOVE and WM_SIZE messages. You have to keep handling the WM_MOVE and WM_SIZE messages because (again, IIRC), the OS keeps sending those messages while the window is being moved/sized which is why that feature works without application support.
You may need to check to see if the user has the mouse button down or up to determine which set of messages is the "final" message.
If the user is moving/sizing by the keyboard... Well, I did not handle that...
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
this is based on Registry Setting ( Afect all windows). If the user has no right to change system settings then how it works.. ?
|
|
|
|
|
In my SDI application, I have two views, Treeview and FormView.
I placed Edit control on FormView. I have to change value of Edit control by clicking on Tree. Both are different classes.
But I am unable to access FormView Class members from Treeview. How can I do that?
void CLeftView::OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
CRightView *rView = new CRightView();
if(rView!=NULL)
{
rView->m_Edit1.SetWindowText(_T("ok"));
}
}
Code gives Debug Assertion Error.
|
|
|
|
|
|
You are creating new View object CRightView *rView = new CRightView();.Instead of this you should get the the attached View object.
-@SuDhIrKuMaR@-
|
|
|
|
|
Sir, I am very confused.
Please give me some example.
How do I create attached view object?
|
|
|
|
|
Try to run this code.
CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd);
CView* pFrmView = pFrame->GetActiveView ();
CRightView *rView = NULL;
if (pFrmView->IsKindOf (RUNTIME_CLASS (CRightView)))
rView = (CRightView *)pFrmView;
(Your Doc Class Name) * pDoc = GetDocument()
if(rView == NULL)
{
POSITION pos = pDoc->GetFirstViewPosition();
while (pos)
{
CView* pView = GetNextView (pos);
if (pView->IsKindOf (RUNTIME_CLASS (CFormView)))
{
rView = (CRightView *)pFrmView;
}
}
}
if(rView!=NULL)
{
rView->m_Edit1.SetWindowText(_T("ok"));
}
-@SuDhIrKuMaR@-
|
|
|
|
|
Now, i get this error:
Unhandled exception at 0x00530a33 in MyPrg.exe: 0xC0000005: Access violation reading location 0x1271e40a.
and control goes to:
void CWnd::SetWindowText(LPCTSTR lpszString)
{
ENSURE(this);
ENSURE(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
if (m_pCtrlSite == NULL)
::SetWindowText(m_hWnd, lpszString);
else
m_pCtrlSite->SetWindowText(lpszString);
}
|
|
|
|
|
I had posted this earlier but no reply. Sorry for posting it again
This is how it is...
My Class is defined in newclass.h as...
Class A
{
public:
void out_func1();
void out_func2();
class B
{
public:
string path;
in_func1();
};
};
I then Get the path at intialize.cpp as follows....
void A::out_func1()
{
B obj;
obj.path="c:\folder\file1.txt";
}
Then I try to open the file to write in write.cpp...
void A::out_func2()
{
B obj;
ofstream myfile;
myfile.open (obj.path.c_str(), ios::app);
...
}
This crashes.I have included the header initialise.h too.
Please let me know were I could have gone wrong. I think I am having problem with the scope of the varible. But I am not sure.
THANKS.
|
|
|
|
|
out_func1() and out_func2() uses different instance of the class B. You should use same instance of class B in both functions.
|
|
|
|
|
Actually you got replies.
I repeat myself: no wonder your application crashes, you're passing a uninitialized path to myfile.open .
Hint: usage of locals where class member (or method parameter) should be used.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Where do you initialize the variable obj? That kept aside you don't call out_func1 that is initializign the obj variable. Initialize and use the same variables.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
pl_kode wrote: obj.path="c:\folder\file1.txt";
Use below code,
obj.path="c:\\folder\\file1.txt";
Regards,
Paresh.
|
|
|
|
|
pl_kode wrote: myfile.open (obj.path.c_str(), ios::app);
obj has not been initialized.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i created 3 property pages i am doing one of those 3 pages
i am getting like this
unresolved external symbol "public: static struct CRuntimeClass const CNSPropertyPage::classCNSPropertyPage" (?classCNSPropertyPage@CNSPropertyPage@@2UCRuntimeClass@@B)
followed by 30 LNK2001 errors
|
|
|
|
|
forgetting to link some libs ?
|
|
|
|
|
i checked but no libs missed
|
|
|
|
|
|
i created class CNSVirtualcircuitPath which is inherited from CNSPropertypage which is derived from CResizablePage
code i am writing for this page is already existing in my App i copied same code but this error is coming
|
|
|
|
|
and here i am giving some of examples
error LNK2001: unresolved external symbol "public: virtual bool __thiscall CNSPropertyPage::SkipFieldUpdate(class CString)" (?SkipFieldUpdate@CNSPropertyPage@@UAE_NVCString@@@Z)
NSPathInformationPage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CNSPropertyPage::InitializeTagMap(void)" (?InitializeTagMap@CNSPropertyPage@@UAEXXZ)
NSPathInformationPage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CNSPropertyPage::CreateTagMap(void)" (?CreateTagMap@CNSPropertyPage@@UAEXXZ)
NSPathInformationPage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CNSPropertyPage::GetEditableDependentsList(class std::list<struct NSObject::ObjectDependencyInfo const *,class std::allocator<struct NSObject::Obj
ectDependencyInfo const *> > &)" (?GetEditableDependentsList@CNSPropertyPage@@UAEXAAV?$list@PBUObjectDependencyInfo@NSObject@@V?$allocator@PBUObjectDependencyInfo@NSObject@@@std@@@std@@@Z)
NSPathInformationPage.obj :
|
|
|
|
|
Did you add the .cpp file which contains the definition of CNSPropertyPage in your project ?
|
|
|
|