|
thanx alot but really i dont know where or how can i add GetCursorPos() in my MFC program
ahmad al-omar
|
|
|
|
|
GetCursorPos()
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
thanx alot but really i dont know where or how can i add GetCursorPos() in my MFC program
ahmad al-omar
|
|
|
|
|
ahmad al-omar wrote: i dont know where or how can i add GetCursorPos() in my MFC program
It's really easy, Open your favorite web browser, navigate to msdn.microsoft.com[^], type GetCursorPos into the search bar in the upper right hand side of the page and click the search button. A new webpage will be presented to you with a variety of different links mostly relating to the topic of GetCursorPos. Read up and enjoy.
The second or third link is GetCursorPos Function[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
I Made a project in vc++ and Mysql, i write my code at vc++ button and when i compile there is no error and when i build code ( There is not linking error) but at last
when i run the application an messageBox display and say
libmysql.dll can not find and terminate the execution of program
Note : In my system \\mysql\bin\libmysql.lib exist
How can i solve this problem
can any one tell me this
Yogendra Kaushik
mailing me
|
|
|
|
|
You also need the libmysql.dll . Moreover you need the Loader knows about libmysql.dll path, (MSDN):
[...] Windows then searches for the DLLs in the following sequence:
- The directory where the executable module for the current process is located.
- The current directory.
- The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
- The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
The directories listed in the PATH environment variable.
Note that the LIBPATH environment variable is not used.
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.
|
|
|
|
|
Hi, I'm using MSVC6 and using MFC dialog based application.
The combo box will contain different types of items. Therefore, by choosing one of the items listed in the combo box, i will be able to send appropriate data to the hardware to do the testing process. Below is a sample code that i got:
<code>enum CircuitType {Type1, Type2, Type3};
std::map<CircuitType, std::string> assocs;
assocs[Type1] = "c:\\myfiles\\file1.dat";
assocs[Type2] = "c:\\myfiles\\file2.dat";
assocs[Type3] = "c:\\myfiles\\file3.dat";
int index1 = pCombo->AddString("Type1");
pCombo->SetItemData(index, Type1)
int index2 = pCombo->AddString("Type2");
pCombo->SetItemData(index, Type2)
int index3 = pCombo->AddString("Type3");
pCombo->SetItemData(index, Type3)
int sel = pCombo->GetCurSel();
if(sel == CB_ERR)
return;
CircuitType type = (CircuitType)pCombo->GetItemData(sel);
std::map<CircuitType, std::string>::const_iterator pos = assocs.find(type);
if(pos != assocs.end())
{
// the key is in the map
std::string path = pos->second;
}
</code>
however this codes generates error such as:
error C2039: 'map' : is not a member of 'std'
error C2065: 'map' : undeclared identifier
error C2275: 'CircuitType' : illegal use of this type as an expression
error C2065: 'assocs' : undeclared identifier
error C2275: 'std::string' : illegal use of this type as an expression
and many more....
May what is causing the problems?
Thanks in advance
|
|
|
|
|
Have you included the header files for those classes? <map> and <string>
|
|
|
|
|
hi,
Is it correct to just add "using namespace std;" in the header file?
However, this does not seem to correct the problem. So i guess i'm wrong.
As i was finding for solution i found an articlehttp://www.codeproject.com/cpp/cppforumfaq.asp[^][^]and if u look in the problem listed in 2.2 as below:
2.2: I'm trying to call a Windows API, but the compiler gives an undeclared identifier error (C2065). Why? (top
May i know whether this may be the cause of my problem?
Apart from that, may i know what is the class for map and string and how to declare it in the codes. Hope that you can help as i'm a beginneer here.
Thanks
|
|
|
|
|
How can i retrieve if the string is not found ?
i have :
CString s1,s2;
s2 = "100";
m_24.GetWindowText(s1);
int nDout = s2.Find(s1);
if(nDout ! = -1)
{
AfxMessageBox("Found it")
}
How to retrieve if is not find ?
Please help me !!!!!!!!
Bravoone
|
|
|
|
|
What ?
Bravoone_2006 wrote: How to retrieve if is not find ?
-- modified at 2:35 Saturday 25th November, 2006
|
|
|
|
|
if(...........)
{
AfxMessageBox("Not find");
}
!!!!!!!!!
Bravoone
|
|
|
|
|
|
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.
|
|
|
|