|
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.
|
|
|
|
|
Correction:
Error 3 means ERROR_PATH_NOT_FOUND
(Error 2 means ERROR_FILE_NOT_FOUND)
Just a hint, I never opened a driver myself.
But I suggest you try these for the "file" name:
L"\\\\.\\Device\\TestIOCTL"
L"\\\\.\\TestIOCTL"
L"\\\\.\\DosDevices\\TestIOCTL
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
|
Hi all,
I have disabled my grid lines of ListCtrl, so that it is not visible now.But I need to draw a border line(should be splitted line) between some items ie my listCtrl will looks like this
col1 col2 col3 col4 col5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
And also I dont want to show the partition lies between the column heading
Can anybody tell a solution to this,
Thanks in Advance
George K JOlly
-- modified at 2:27 Thursday 24th August, 2006
|
|
|
|
|
I see two solutions:
1. Make an ownerdrawn control derived from the CListCtrl.
2. Use a grid control
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Hi Rage,
How can i make an ownerdrawn listcontrol,
Thanks
George K Jolly
|
|
|
|
|
|
Another one[^]
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
|
Another solution would be to use customdraw.
|
|
|
|
|
Hi,
Im getting BitMap file from my Pic folder ..if the pic folder is not in that drive i display the bitmap file from Resource file.This is requirement.Everythign is fine.When the Pic folder is not here it will pop up this message box when i click OK then it will display BMP file resource.
As per the coding it displays the BMP from resorce when i click OK,but the message box still exist in screen i continuosly press OK it does not go,then i have to press close icon in that box for 10 times then it goes off..whats the reason anything wrong in my code?
if(AfxMessageBox("Pic Folder is not there",MB_OK)==IDOK)
{
CDC dcImage;
if(!dcImage.CreateCompatibleDC(pDC))
return;
BITMAP bm;
CBitmap* pOldBitmap;
m_bitmap.GetBitmap(&bm);
pOldBitmap = dcImage.SelectObject(&m_bitmap);
pDC->BitBlt(350,100, bm.bmWidth, bm.bmHeight, &dcImage, 0, 0, SRCCOPY);
dcImage.SelectObject(pOldBitmap);
}
Anu
|
|
|
|
|
Probably, you written this code in OnPaint or similar function. Invoking message box cause it to call again(WM_PAINT)(it invalidates that area), and its going in endless loop.
Avoid calling messagebox there.
|
|
|
|
|
Yes, Im doing this in OnDraw().Ok Thank u.
Anu
|
|
|
|
|
More in general, avoid user interactions and whatever action that may be destructive respect to the drawing ... while drawing.
The good practice is to handle all user "options" with commands altering the "state" of the application (some member variables), and make OnDraw / OnPaint to already know everiting about their drawing.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|