|
I think your problem is of pointers.
|
|
|
|
|
T.RATHA KRISHNAN wrote: Unhandled exception at 0x7c918fea in Perspective.exe: 0xC0000005: Access violation writing location 0x00000010.'
you tried to called something on NULL pointer without providing it memory
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hello,
How do I assign a value to an object of type CDBVariant?Especially if the data type is string.
CDBVariant b;
CString str;
b.m_dwtype = DBVT_STRING;
b.m_pstring = str;
but in the union of CDBVariant m_pstring is pointer to string.so what has to be done?
Thanks
Pritha
|
|
|
|
|
prithaa wrote: b.m_pstring = str
Pass address of string.
CDBVariant b;
CString str;
b.m_dwtype = DBVT_STRING;
b.m_pstring = &str;
|
|
|
|
|
Hello,
So I need to maintain the CString variable so that the pointer has a meaning .I cannot destroy the the CString object or create the object locally ? i.e
Thanks for your reply Prasad
Prithaa
|
|
|
|
|
|
prithaa wrote: b.m_pstring = str;
instead use
b.m_pstring = new CString(str);
the destructor of the CDBVariant will delete this newly created CString.
nave
|
|
|
|
|
Hi,
I am developing a application in which i need to convert the .DWG/.BMP image files into PNG image file format. Can anybody help me to this in VC++ ?
Thanks in Advance !!
Jiteen
|
|
|
|
|
See http://www.wotsit.org[^] for info about graphic files.If you want to save file you can read bmp or png(not dwg)file with CImage class and use of CImage::Save but for dwg I think you need to lot of work.;)
|
|
|
|
|
Thanks a lot sir !!
Jiteen
|
|
|
|
|
You're welcome
|
|
|
|
|
how to add checkboxs for multiple coloumns in listview..
LVS_EX_CHECKBOXES is working for only one coloumn.......
|
|
|
|
|
|
pavan_sw wrote: how to add checkboxs for multiple coloumns in listview..
LVS_EX_CHECKBOXES is working for only one coloumn...
CLIstCtrl::ModifyStyleEx
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
How to make ON_ENCHANGE message Map returning an int or CSize?
I have added this in the header file:
afx_msg int OnEnChangeEditmessage();
The message map I added was :
ON_EN_CHANGE(IDC_EDITMESSAGE, _OnEnChangeEditmessage)
My message handling function is:
int CPreferences::OnEnChangeEditmessage()
{
CPaintDC *pDC;
CSize size;
size = pDC->GetTextExtent(m_strMessage);
return size.cx;
}
ikikhjkhjkhjkhj
|
|
|
|
|
Typecast OnEnChangeEditmessage in ON_EN_CHANGE(IDC_EDITMESSAGE, OnEnChangeEditmessage) to the original prototype.
Come online at:-
jubinc@skype
|
|
|
|
|
Stop! Wrong way.
All message handlers that are put inside the message map have specific declarations.
In your case the prototype shall look like this, the identifier name excepted:
afx_msg void OnEnChangeEditMessage(); You cannot change the return type for message handlers. You have to solve whatever problem you're having in another way. All message handlers in Win32 always return an LRESULT . In MFC this is hidden so MFC message handlers for windows returns void , like above. But if you write a message handler for a user defined message you still have to return an LRESULT , even when using MFC.
Describe your problem if you want suggestions for alternative solutions.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Going a layer further than Roger's reply - take a look at the EN_CHANGE notification docs.
There is no return value. Even if you returned something it would be ignored by the system.
The platform sdk is your friend
|
|
|
|
|
wrote: My message handling function is:
int CPreferences::OnEnChangeEditmessage()
{
CPaintDC *pDC;
CSize size;
size = pDC->GetTextExtent(m_strMessage);
return size.cx;
}
every Message map has it specific handler... you have to consult MSDN for same
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
There are two seperate application dialog.
on one dialog there is one text box as well as check box and on other dialog
there is one button.
now if I press on second dialog's button,then some text should be set on
first dialog's text box and checkbox.
I am able to set text of checkbox but not able to set text into edit box.
I used logic like following
CWnd* pWnd = CWnd::FindWindow(NULL,_T("TestDialog"));
if (pWnd)
{
pWnd->ShowWindow(SW_SHOW);
pWnd->SetForegroundWindow();
pWnd->SetDlgItemText(1003,"Hello");
pWnd->SetDlgItemText(1001,"Hello111");
}
Can anybody tell me how to set text on other application dialog's edit box
Thanks,
Prakash
sonani prakash
|
|
|
|
|
What happens if you use of GetDlgCtrlID() instead 1001
|
|
|
|
|
Now I am able to set text using SendMessage(WM_SETTEXT,...)
Now I have question about getting ID or handle of the edit box of other application dialog ?
sonani prakash
|
|
|
|
|
You can use of this code if we suppose you have two dialogs Main and Local then insert this code on the Local
CMain *m_pMain=(CMain*)GetParent();
m_pMain->function or variables on other dialog
|
|
|
|
|
BOTH THE DIALOGS ARE PART OF SEPERATE APPLIATIONS.
SO First I can get the handle of dialog windows of other application but problem about it's edit box.
sonani prakash
|
|
|
|
|
You can use of EnumChildWindow for enumerates child windows and the use of GetClassName and check if returned class is EDIT also see here[^]
|
|
|
|