|
|
I NOW ABOUT ELSE ...HM... BUT ELSE ....AND... WHAT ?
Bravoone
|
|
|
|
|
no more than else .
the following:
Bravoone_2006 wrote:
CString s1,s2;
s2 = "100";
m_24.GetWindowText(s1);
int nDout = s2.Find(s1);
if(nDout ! = -1)
{
AfxMessageBox("Found it")
}
becomes:
CString s1,s2;
s2 = "100";
m_24.GetWindowText(s1);
int nDout = s2.Find(s1);
if(nDout != -1)
{
AfxMessageBox("Found it");
}
else
{
AfxMessageBox("Do not found");
}
since (MSDN):
CString::Find
int Find( TCHAR ch ) const;
int Find( LPCTSTR lpszSub ) const;
int Find( TCHAR ch, int nStart ) const;
int Find( LPCTSTR pstr, int nStart ) const;
Return Value
The zero-based index of the first character in this CString object that matches the requested substring or characters; -1 if the substring or character is not found.
hope that helps...
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.
|
|
|
|
|
no, is not working !
Bravoone
|
|
|
|
|
|
You are trying to find a m_24 window's caption text in the string "100"?
It should work if the window's caption is "1", "0", "10", etc.
|
|
|
|
|
I was hoping this api call would help speed up the drawing in my window, but no such luck.
This is how it works, I process the WM_SIZE of the main window, from there I call BeginDeferWindowPos() adding all the child windows. For each child window, I propagate down the Z-order adding all the childrens children to the same struct. Once all windows have been succesfully added, I call EndDeferWindowPos() to move/size the windows. Now here is the problem, only the children of the main window are effected, the childrens children do not get moved/resized.
As far as I can tell my code is working correctly for the most part. I store the rectangle for each child, from this I can tell Each call to DeferWindowPos() is being called with the correct paramaters. Also I tried converting the DeferWindowPos() call to the standard SetWindowPos() and this moves ALL windows as expected.
Would anybody happen to know of a reason why this may be failing?
|
|
|
|
|
From MSDN:
[quote]
All windows in a multiple-window – position structure must have the same parent.
[/quote]
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Where did you find that? I read and re-read my copy of MSDN and have been unable to find anything like it.
|
|
|
|
|
See DeferWindowPos() API, hWnd (2nd) parameter.
|
|
|
|
|
Parameters
hWinPosInfo
[in] Handle to a multiple-window – position structure that contains size and position information for one or more windows. This structure is returned by BeginDeferWindowPos or by the most recent call to DeferWindowPos.
hWnd
[in] Handle to the window for which update information is stored in the structure. All windows in a multiple-window – position structure must have the same parent.
hWndInsertAfter
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hi everybody.
I facing big problem in DDK,i am fress softwaredeveloper,i want to controll Pendrive through vc++ 6.0,for this application i want some knowledge about DDk,in DDk i want to know all the fundamental about usb port device drive program and removal device drive controll program,for this i can't get much document and help ,please any one having this knowledge then send the document,and give the idea for doing the application.please help me.
Ram Krishna Pattnayak
Junior Developer (SDS-SunDew Solutions)
www.sundewsolutions.com
|
|
|
|
|
Question 1:
For a class Class_A, it has a constructor function Class_A::Class_A() and a deconstructor function Class_A::~Class_A().
My question is when the two functions will be called.
For constructor function, I think it will be called in two cases:
case 1: when declare a Class_A type pointer variable: Class_A * ptrClass_A = new Class_A();
case 2: when declare a Class_A type variable : Class_A objClass_A;
my question arises with deconstructor function,
corresponding to the above case 1: deconstructor function is called when using ' delete ptrClass_A '
I am confused with the second case. It seems to me that deconstructor function will never be called for the above case 2, since there is no a counterpart in case 2 to ' delete ' in case 1.
Question 2
How to dynamically create a control, say a CEdit control.
Should I place a CEdit control (IDC_EDIT0) on the form first, then add a variable (m_EditBox_0) for the control.
In the *.cpp file, I should create a object of CEdit type
CEdit * objCEdit = new CEDit();
finally, associate objCEdit with m_EditBox_0 in some way.
I am not sure if the above steps are correct or not.
Question 3:
My project (Test) is a SDI framework. Somehow the CTestView node in the "Workspace | ClassView" in the Visuatl C++ Ver. 6.0 (SP6) IDE disappearred. However, TestDoc, TestApp and some other nodes are still there.
Also, the files CTestView.h and CTestView.cpp can be opened successfully. Why this could happen. How can I get it back.
Question 4:
I wonder if there is shortcur keys to let prgrammers to go to next/previous breakpoint from current line or current breakpoint.
|
|
|
|
|
cy163@hotmail.com wrote: I am confused with the second case. It seems to me that deconstructor function will never be called for the above case 2, since there is no a counterpart in case 2 to ' delete ' in case 1.
Object is created on stack. Its d'tor will get called in clean up. i.e. when objects goes out of scope.
cy163@hotmail.com wrote: How to dynamically create a control, say a CEdit control.
Should I place a CEdit control (IDC_EDIT0) on the form first, then add a variable (m_EditBox_0) for the control.
In the *.cpp file, I should create a object of CEdit type
CEdit * objCEdit = new CEDit();
You need to call Create function of CEdit class in combination to ShowWindow. No need to create it on form while design.
cy163@hotmail.com wrote: My project (Test) is a SDI framework. Somehow the CTestView node in the "Workspace | ClassView" in the Visuatl C++ Ver. 6.0 (SP6) IDE disappearred. However, TestDoc, TestApp and some other nodes are still there.
Also, the files CTestView.h and CTestView.cpp can be opened successfully. Why this could happen. How can I get it back.
close project. Delete .dsw and open .dsp again.
cy163@hotmail.com wrote: I wonder if there is shortcur keys to let prgrammers to go to next/previous breakpoint from current line or current breakpoint.
You can go to next break point by using f5 key.
to go to previous break point , you need to go to that point, righ clik and selct option 'set next statement'
|
|
|
|
|
Prasad, Thank you for your prompt and great answers.
|
|
|
|
|
Visual C++ 2005 Build Paths can be added manually thru the IDE Tools->Options->Project and Solutions-> VC++ Directories . Now, i observed that installers of many SDKs (such as DirectX SDK) automatically adds these paths (paths to dxsdk\lib , \include \bin ) to VC++.
How can i do the same with my installer so when the installation of my SDK completes, all the paths to lib, include, bin are automatically added there?
I can add those paths using the environment variables INCLUDE, LIB, but those paths are not available to the IDE unless i launch VC++2005 using the "/useenv " switch (devenv /useenv ). (Launching normally does not enable those paths)
Is there a registry key where i can add those paths?
Thanks in advance.
|
|
|
|
|
I would expect the paths to be in a registry key somewhere under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0
|
|
|
|
|
The path is not saved in the registry, instead it is saved in CurrentSettings.vssettings file in
C:\Documents and Settings\XXX\My Documents\Visual Studio 2005\Settings.
it is an XML file, but there seems to be no easy way to write it..
|
|
|
|
|
Hello
Kindly do me a favour by enlightening me with the difference between MFC's in VC++ & VC++.net
Can i use the same code which is in VC++ 6.0 in VC++.net.
Thank you
Kind Regards
Sandy
|
|
|
|
|
ksandy45 wrote: Kindly do me a favour by enlightening me with the difference between MFC's in VC++ & VC++.net
You may like to have a look at this[^]
ksandy45 wrote: Can i use the same code which is in VC++ 6.0 in VC++.ne
You can.
|
|
|
|
|
Hi Prasad,
Thanks for the help, then what is the difference between these two MFC's. Does .net MFC offer any new classes?
Kind Regards
Sandy
|
|
|
|
|
yes ofcourse.there r some classes mixed with atl which are added in MFC 2003,i mean these classes can be used in ATL as well MFC like CImage,CString etc.you can C more on msdn.
Tasleem Arif
|
|
|
|
|
Thanks a lot Tasleem.
Can you just tell me how Managed VC++ is different from the MFC?
Can the same functionallity be achieved by using the VC++.Net (managed C++).
Kind Regards
Sandy
|
|
|
|
|
VC++.net managed C++ is differnet from MFC in sense
yes functionality can be achieved using managed C++.
1.managed c++ is plateform independant.
2.it support more classes then MFC supports.
Regards.
Tasleem Arif
|
|
|
|
|
Thank you very much Tasleem. I am clear now. So i can use Managed C++ and achieve all the things which a MFC offers and this can done with a great ease.
I hope what i understood is correct?
I think you have a great knowledge in thins field. I would like you to help me, kindly provide me with you are support.
Thanks a lot.
Kind Regards
Sandy
|
|
|
|