|
What problem with this code
<br />
CRegistry Reg;<br />
CString string2 = "Software\\MyApp\\key";<br />
Reg.SetRootKey(HKEY_LOCAL_MACHINE);<br />
Reg.SetKey(string2,TRUE);<br />
<br />
|
|
|
|
|
![Go to Parent](https://www.codeproject.com/App_Themes/CodeProject/Img/arrow-up24.png) If I remove the ( ) it gives me a lot of errors:
MyReg error LNK2019: unresolved external symbol "public: __thiscall CRegistry::~CRegistry(void)" (??1CRegistry@@QAE@XZ) referenced in function "protected: virtual int __thiscall CMyRegDlg::OnInitDialog(void)" (?OnInitDialog@CMyRegDlg@@MAEHXZ)
MyReg error LNK2019: unresolved external symbol "public: __thiscall CRegistry::CRegistry(void)" (??0CRegistry@@QAE@XZ) referenced in function "protected: virtual int __thiscall CMyRegDlg::OnInitDialog(void)" (?OnInitDialog@CMyRegDlg@@MAEHXZ)
MyReg error LNK2019: unresolved external symbol "public: int __thiscall CRegistry::SetKey(class ATL::CStringT<char,class strtraitmfc_dll<char,class="" atl::chtraitscrt<char=""> > >,int)" (?SetKey@CRegistry@@QAEHV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@H@Z) referenced in function "protected: virtual int __thiscall CMyRegDlg::OnInitDialog(void)" (?OnInitDialog@CMyRegDlg@@MAEHXZ)
MyReg error LNK2019: unresolved external symbol "public: int __thiscall CRegistry::SetRootKey(struct HKEY__ *)" (?SetRootKey@CRegistry@@QAEHPAUHKEY__@@@Z) referenced in function "protected: virtual int __thiscall CMyRegDlg::OnInitDialog(void)" (?OnInitDialog@CMyRegDlg@@MAEHXZ)
MyReg fatal error LNK1120: 4 unresolved externals
SnaidiS(Semion)
|
|
|
|
|
please help me
SnaidiS(Semion)
|
|
|
|
|
I see this article and when you run these functions you have a reg key in registry (MyApp) but i dont know how do you use this article that you have these errors can you explain how do you use from this article,please
|
|
|
|
|
how to get the input data (text) from text box in mfc dialog based application in v c++ 6
|
|
|
|
|
GetWindowText (CString& rString) const
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
i want it as long not string?????????????
|
|
|
|
|
Take it as string convert it to long
char * str=new char[100];
GetDlgItemText (IDC_EDIT1,str,100);
long l;
l=atol (str);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: GetDlgItemText (IDC_EDIT1,str,100);
Hey this will cause error
u need to modify this to
GetDlgItemText (IDC_EDIT1,(LPTSTR)str,100);
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
see me wrote:
Hey this will cause error
And Why so:
LPTSTR-An LPWSTR if UNICODE is defined, an LPSTR otherwise.
Did you try using the code that I gave.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
see me wrote:
GetWindowText (CString& rString) const
Thanks for your comment.
But just have a look at your post . Shouldn't it be:
CString str;
m_editBox.GetWindowText(str);
No personnel issues but just to.......
say that we don't post the code here that is always optimized.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Map it to some variable (ex: m_edit)
While mapping it select long as its type.
In the code use the following lines
long val;
UpdateData();
val=m_edit
|
|
|
|
|
CString csText;
GetDlgItemText( IDC_EDIT1, csText );// here IDC_EDIT1 is the id of the edit control
nave
|
|
|
|
|
identity_85 wrote: how to get the input data (text) from text box in mfc dialog based application in v c++ 6
GetDlgItemText
|
|
|
|
|
I have a pointer to a CStatic object but i need a handle to it cos i need to reposition it on the screen with the help of SetWindowPos function. How can i obtain a handle to the object if I have pointer and is there any other way to move/reposition the CStatic object. Plzz Help !!!
Anshul
|
|
|
|
|
if StaticCtrl is an object of CStatic, then StaticCtrl.m_hWnd points to the handle to that static control.
nave
|
|
|
|
|
Err... You don't need its handle. Just call the MoveWindow function directly:
pStaticCtrl->MoveWindow(...);
|
|
|
|
|
HWND CStatic::GetSafeHwnd() const;
Maxwell Chen
|
|
|
|
|
see i will tell u, there are many CStatic objects on the client window, right. Now what happens is that the user clicks on one of them and i get the address of that object in the 'this' pointer. Now i want to move this object according to the mouse drag on the screen, with the help of SetWindow Pos func and Invalidate(TRUE); I have the address of the CStatic object which the user is trying to drag.How do i get the handle of this object so that i can move it. is there any way to find out the handle with the help of this pointer.
otherwise tell me how i can move the CStatic window along with the mouse.
|
|
|
|
|
Hey....do you want to know that how to give the first param of SetWindowPos( )
u have an object to the CStatic like
CStatic objMyStatic;
then get handle like this
objMyStatic.m_hWnd;
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
see i will tell u, there are many CStatic objects on the client window, right. Now what happens is that the user clicks on one of them and i get the address of that object in the 'this' pointer. Now i want to move this object according to the mouse drag on the screen, with the help of SetWindow Pos func and Invalidate(TRUE); I have the address of the CStatic object which the user is trying to drag.How do i get the handle of this object so that i can move it. is there any way to find out the handle with the help of this pointer.
|
|
|
|
|
if you have a derived CStatic what do you need?
|
|
|
|
|
i need to move the CStatic object which is again a window along with mouse drag. The moment user clicks in the window i get the pointer to it in the this pointer, but SetWindowPos func takes the handle of the window as tha paramater so now what to do ????
|
|
|
|
|
See Here[^] maybe it is some helpful to you
|
|
|
|