|
thanks... i am new to this and so finding it a bit hard.
vijay
|
|
|
|
|
hi,
If you doesnt select the ComboBox then the Index value is always -1
so
if(cmb.getCurSel()== -1) //Nothing but CB_ERR.
{
cmb.setCurSel(previous index value);
}
Think clever.
Uday kiran
|
|
|
|
|
You need to a variable for same previous state,do you have this variable?
|
|
|
|
|
aroli vijay wrote: After clicking the dropdown button of the combo box, if the user does not select any of the items in the listbox of the combo box, then how to display the previously selected item in the edit control of the combo box.
If nothing is selected (i.e., the mouse is clicked outside of the control), the selection does not change.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yes, thank you very much friends.. i got the problem solved quite a while ago... and thanks for ur response..
vijay
|
|
|
|
|
Hi,
I have a MDI application with one open childframe.
I want to open a new childframe automaticly. I call OpenDocumentFile(file) and the childframe opens, the correct data will be displayed. When I look on the Document template I can see that for every childframe it exist an doc. But when I want to use the document functions for saving for example then I use only the document of my childframe that exist before I used OpenDocumentFile().
Must I do something to bind the document template to the right childframe?
Thanks for help
yummi
|
|
|
|
|
I have code written as below :
CString csText;
HANDLE hData=NULL;
m_emailAddress.GetWindowText( csText );
if( (hData=GlobalAlloc( GMEM_MOVEABLE|GMEM_DDESHARE, (csText.GetLength()+1) )) )
{
LPVOID lpLockedMemory=NULL;
lpLockedMemory = GlobalLock( hData );
CopyMemory( lpLockedMemory, csText.GetBuffer(csText.GetLength()), csText.GetLength() );
if( SetClipboardData( CF_TEXT, lpLockedMemory ) == NULL )
{
AfxMessageBox( "Unable to set Clipboard data" );
GlobalUnlock( lpLockedMemory );
lpLockedMemory = NULL;
CloseClipboard();
return;
}
}
Now, this code works fine on Winxp, but for Win98 I get NULL as return value of SetClipboardData(). Can anyone help on this?
-- modified at 4:03 Thursday 24th August, 2006
|
|
|
|
|
Yes, but not in the Lounge. That's why there's a red "No Programming Quesions, Please" sign at the top of the page...
Post in the correct forum and you might just get some assistance with your problem.
Anna
Currently working mostly on: Visual Lint
Anna's Place | Tears and Laughter
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
|
|
|
|
|
|
I'm going to save you from yourself and move this to the right forum. In future, please don't ask programming questions in the lounge.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: move this to the right forum
What work does this require ? I mean, I have no knowledge of databasis and SQL and so, but is this done easily or do you have to dig somewhere to find the thread and reput it in another table ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Well, the first step would be to work here
I made the comment because I thought I was going to be the first ( and only lounge ) reply, and I wanted the OP to know that they had posted in the wrong spot still.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: would be to work here
It was not my intention to do it myself, only wanted to nkow how this works...
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Fair enough - well, as an employee, I get UI to do that, I don't need to be messing with any DB tables directly.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
sachinbhave wrote: but for Win98 I get NULL as return value of SetClipboardData().
No win98 system , to check this.
Can you use GetLastError to check what error its returning.
|
|
|
|
|
Your memory management is a bit off. Call GlobalUnlock() before SetClipboardData() . If SetClipboardData() succeeds, the clipboard owns the memory, so you're done. If it fails, you need to GlobalFree() the memory.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
sachinbhave wrote: CopyMemory( lpLockedMemory, csText.GetBuffer(csText.GetLength()), csText.GetLength() );
It is not necessary to call GetBuffer() since you are not modifying csText .
sachinbhave wrote: I get NULL as return value of SetClipboardData().
Which means you should be calling GetLastError() to find out why.
sachinbhave wrote: GlobalUnlock( lpLockedMemory );
You should be calling this function regardless of whether SetClipboardData() fails or not.
sachinbhave wrote: CloseClipboard();
There's no reason to call this if SetClipboardData() fails. Nothing is open at that point.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Did you use from GetLastError for see error
|
|
|
|
|
Hi all,
I am creating a Edit Box Dynamically in CDialog Box. And when i Right Click on the Edit Box what i have created i want to show a Menu.
//===========================================================================
//Source for Creating the Edit Box when mouse is clicked.
CEdit *ptr = new CEdit;
ptr->Create(WS_VISIBLE|WS_CHILD|WS_BORDER|WS_TABSTOP|ES_AUTOHSCROLL,CRect(point.x,point.y,point.x +100, point.y +20),this,NULL);
Note : the Last Parameter is the ID for the Edit Control in Create(...) Api.
//===========================================================================
Now i am not able to handle an event to this dynamically created Edit Box. I want to Handle the RButtonDown Event for every Dyanmically Created Edit Box. i Mean when ever i Right Click on the EditBox what i have Created i want to Populate a Menu using TrackPopUpMenu(...) Api.
please help me out.
Uday kiran
|
|
|
|
|
You need to add the entries of the control in the message map manually. The best way to do it is to look how class wizard does and do the same for your control.
So, add an edit box to your dialog, add the handler with classwizard look at the message maps entries (in the dialog class header file and source file) and see what has changed. Now you can do the same for your control.
|
|
|
|
|
Hi Cedric Moonen,
My Doubt is that the CEditBox doesn't Handle the WM_RBUTTON_DOWN Event. The Events handled for the Edit Box are.
EN_CHANGE,EN_ERRORSPACE,EN_HSCROLL,EN_KILLFOCUS,EN_MAXTEXT,EN_SETFOCUS,EN_UPDATE.
What about the Event Handler of WM_RBUTTON_WOWN Event.
please tell me your suggestions.
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: The Events handled for the Edit Box are.
EN_CHANGE,EN_ERRORSPACE,EN_HSCROLL,EN_KILLFOCUS,EN_MAXTEXT,EN_SETFOCUS,EN_UPDATE.
These aren't events handled by the edit control. These are notifications posted by the edit control to it's parent. In that case you can use WM_PARENTNOTIFY[^]. Or if your only interested in a right-click there is NM_RCLICK[^] notifications.
|
|
|
|
|
i made an application which used a dll and loads it dynamically. If dll is not present an exception raises. All i want is if dll is not present it should be known at the Loadlibrary(..) call and i could handle that exception.
Is my question meaningfull? If yes please help me.
Thank you
KIRAN PINJARLA
|
|
|
|
|
|
Hi all,
I have created a device independent driver. For which i want a application launcher. My drivers name is "TestIOCTL" and its symbollic link is "\Device\TestIOCTL ". I now want to open this driver file for which i have used the following code segment.
hDevice = CreateFile ("\\DosDevices\\TestIOCTL",
0,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
The hDevice returns 3 thro GetError() Method meaning File not found. Can anyone tell me how to open this driver file.
Thanks In advance.
Regards
Kenny.
|
|
|
|