|
ya...using that only i did in view class...but the same thing it is not supporting in Cdialog class
|
|
|
|
|
I divide my frame window into two parts by using splitter window(pane1,pane2). Now i want to drag pane1 to pane2 place in the frame. How can i implement this.Please help me...
ganesh
|
|
|
|
|
This is not possible. Instead you can have MDI and achive the required functionality.
|
|
|
|
|
Anything's possible
I can't write it for you, but I have used placeholder "view" windows as panes in a splitter
window.
The place holder window has two main jobs: Keeping a pane in the splitter, and resizing the
actual pane on top of itself. To control flicker, the placeholder frame should only erase its
background if there's not an actual pane on top of it.
You can get as fancy as you want with the drag and drop. It's the same as any drag and drop -
Detect mouse click, hittest to see if the cursor is in a drag area of the window, move the window
until the mouse button released, and place the window at the destination.
I hope this made sense and helps a bit.
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hai,
I want to Return a array of strings from a function.how i can get this
|
|
|
|
|
In principle it is not difficult: you can just return a pointer, basically the array itself. There are however memory allocation/deallocation issues (depending also an the string datatype you choose) that you have to carefully take in account.
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.
|
|
|
|
|
I have a CToolBar that uses the TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DRAWDDARROWS style, and some toolbar buttons use the BTNS_DROPDOWN style and some of them use BTNS_WHOLEDROPDOWN style. I'd like to make the arrows on the right side of the buttons little bigger and the drop down part more wider, like the Google has done with their toolbar buttons.
I have tried to custom draw the drop down part of the buttons in CDDS_ITEMPOSTPAINT, but here I don't get the button style and even the rect is smaller than actual button size for BTNS_WHOLEDROPDOWN styled buttons.
I am using pure ATL code(***NO MFC***).
Regards!
Padmanabh Sharma
|
|
|
|
|
Hi everybody,
in my application i need to perform a drag&drop into a Word-Document.
For the drag and drop i found a lot of nice tutorials in CodeProject.
But i need also to know how i place the text & images into the clipboard.
I used already a Clipboard-Spyer and saw that a simple text with an image sets nearby
7-10 different "elements" into the clipboard.
Is there probably a guide how to build your own Clipboard-content to paste it into
MS-Word ?
Big thanks !
|
|
|
|
|
Do you need to SetClipboardData function with CF_BITMAP ?
|
|
|
|
|
Hi all,
I have made a sdi window in that i have made a class derived from CFormView which contains a list control. This list control is of report style. i have made a function which insert values inside this list control. That function contains for loop. now my problem is when first time the loop executes it does not modify values in list control. instead it modify values in last when loop finishes but i want it should modify values in midlle only. How to solve this???
THanks in advance
|
|
|
|
|
Check your loop once again ....
and write the modification function after getting the values and also write the function inside the loop
|
|
|
|
|
Can you show code snippet?
|
|
|
|
|
Hi, all
Any one can please help me out to solve the below problem
Below is my code in the execution it shows me assertion Failed
The Error dialog stating that
Debug Error!
DAMAGE: after normal block (#1050693) at 0x01486430.
Following is my whole code:::
char* pszBuffer = NULL;
DWORD dwLen = GetLogicalDriveStrings( 0, pszBuffer);
if ( dwLen == 0)
return;
dwLen += 1;
pszBuffer = new char [dwLen];
GetLogicalDriveStrings( dwLen, pszBuffer);
int nPos = 0;
do
{
int nItem =0;
GetDriveData( pszBuffer + nPos, nItem);
nPos += (strlen( pszBuffer + nPos) + 1);
} while ( strlen( pszBuffer + nPos) > 0);
free ( pszBuffer);
So can you please help me out what is the problem in the above code.
Thanks in advance!!!!
|
|
|
|
|
This problem occurs when you overwrite memory(which is not yours) towards the end of a string, i.e. just after the string. This happens only in debug version to warn you.
I would use GetLogicalDriveStrings likewise...
TCHAR szDrives[MAX_PATH] = { 0 };
if( GetLogicalDriveStrings( MAX_PATH, szDrives ))
{
LPTSTR lptszOneDrive = szDrives;
while( *lptszOneDrive )
{
MessageBox( lptszOneDrive );
lptszOneDrive = ( lptszOneDrive + ( _tcslen( lptszOneDrive ) + 1 ))
}
}
|
|
|
|
|
use delete rather than free.
Debug the pszBuffer, there is a memory view "Alt+6"
Greetings from Germany
|
|
|
|
|
Hi all..
I want to know how upload is done ... as an example when we upload a document .. what is happening a file is generated with same name and size on the destination... can anybody expalin me how it can be done in vc++ ....
Thanks
vikas da
|
|
|
|
|
Do you want to upload the files to a internet server?
If yes, have a look at CFtpConnection-The MFC class CFtpConnection both manages your FTP connection to an Internet server and allows direct manipulation of directories and files on that server
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
If i have some system interconnected(LAN)... that time from my code .... i want to upload a file into other system... that tile will "CFtpConnection " be helpfull for me...
Thanks..
vikas da
|
|
|
|
|
"Uploading" a file basically means sending a file from one place to another.
To do it programmatically, you can use an existing communication protocol or create your own
protocol.
HTTP and FTP are examples of existing protocols capable of transferring files. Both require
a server to connect to, so if you wanted to upload a file with FTP, you need to connect to an
FTP server and send the commands and data necessary (as defined by the protocol) to upload the
file.
To create your own protocl, think about what you may need -
1) A connection to get the data from one place to another (sockets work well)
2) Some kind of header, structure, or command that both ends understand so the sending end can
tell the receiving end the file name, the number of bytes to expect, etc. (whatever info you
decide is necessary - it's your protocol )
Once the endpoints have established what will be transferred, the sending side will read the file
and send the bytes. The receiving end could create a new file, receive the bytes, and write
those bytes to the new file.
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Thanks Mark..
i understood the concept but i want to know ,at the destination where the file is going to store ,just before creating the new file... there must be some temporary place where all these bytes will reside.. this space will be of network or the system .........
other problem is i can imagine how to do but when i will be going to implement it what are the resources i ll be needed .... and have u some reusable code that can help out me.....
Thanks alot
vikas da
vikas da
|
|
|
|
|
tasumisra wrote: at the destination where the file is going to store ,just before creating the new file... there must be some temporary place where all these bytes will reside..
If using sockets, you'd be copying data from the socket buffer to your own memory buffer before
writing the bytes to a file so you've already got the data buffered.
If for some reason you need to receive an entire file before creating the destination file, and
the file is too big to use RAM to buffer it, you could use a temporary file to store the data
(see GetTempPath()/GetTempFileName()).
Generally data is received in manageable size chunks so you can just receive data into a
pre-allocated buffer.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Additionally to what Mark said, add some error handling to your application logic... e.g. if a data upload is interrupted in the middle, you might want to repeat or resume a data transfer.
|
|
|
|
|
Good morning... My query is......
After user selects PRINT menu one message box(usr created)will appear.
The message box consists of 2 command button controls.
one is OK and the other is CANCEL.
If the user presses OK it should take snapshot of the background and should create a BITMAP IMAGE without the message box. That means IMAGE shouldn't contain the message box. For this I am calling EndDialog() function. But now the problem message box is creating some empty space in the background and IMAGE is coming with that empty space. But it shouldn't come.
The code is as folows.
After selecting PRINT menu it will execute the following code.... i.e.,
**************************************************************************8
CSwissMessage m_objMsg;
m_objMsg.m_strMSG = "\n\n\nPress Print to Print the Screen or Cancel To Quit";
m_objMsg.DoModal();
****************************************************************************
Know the message box will appear. If the user selects PRINT button it will execute the following code.....
****************************************************************************
void CSwissMessage::OnClickCmdbtnPrint()
{
CSwissMessage::EndDialog(10);
snap();
}
****************************************************************************
void CSwissMessage::snap()
{
CWnd* pWnd = AfxGetApp()->m_pMainWnd;
if (windowtobmp("ShipStatus.bmp",pWnd)==FALSE)
{
MessageBox("ERROR");
}
}
BOOL CSwissMessage::windowtobmp(CString filename,CWnd* pwnd)
{
CWindowDC dc(pwnd);
CDC memdc;
memdc.CreateCompatibleDC(&dc);
CRect rect;
pwnd->GetWindowRect(rect);
CBitmap bmp;
bmp.CreateCompatibleBitmap(&dc,rect.Width(),rect.Height()-150);
CBitmap* poldbmp = memdc.SelectObject(&bmp);
memdc.BitBlt(0,0,rect.Width(),rect.Height(),&dc,0,0,SRCCOPY);
memdc.SelectObject(poldbmp);
HANDLE hdib = ConvertDDBToDIB(bmp);
writebmp(filename,hdib);
GlobalFree(hdib);
CString strPrintFilePath = FindPrintFilePath();
HINSTANCE hInstancePrint;//,hInstanceEditor;
hInstancePrint = ShellExecute(this->m_hWnd,"print","ShipStatus.bmp",NULL,NULL,SW_HIDE);
return TRUE;
}
|
|
|
|
|
hi..i am not sure but you try this one....
after ending the message box function CSwissMessage::EndDialog(10);
....and before calling the snap() function you call Sleep(); function for a while....then u call the snap() function...
|
|
|
|
|
Thank u Mani......
I have tried Sleep() also. But it is not working.
|
|
|
|