|
"_$h@nky_" wrote: i have read an article which works fine but its not support XLSX files.
XLSX follows an entirely different format[^]. So, you shouldn't expect BasicExcel to work with Excel 2007.
"_$h@nky_" wrote: provide me any guidance and any example for xlsx files.
See if How to automate Excel from C++ without using MFC or #import[^] helps you.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
This library http://www.libxl.com can read and write xls and xlsx formats directly. Perhaps it will be solution for you.
|
|
|
|
|
Hello,
I'm new in OpenGl Library.I'm trying to learn Opengl to use it in Visual C++ Windows Form Application .
I can't work application in here:Creating an OpenGL view on a Windows Form[^]I can build it.But never debugging in Visual Stduio 2008.Where can I change in this code?
Another problem of mine.How can I use Opengl in PictureBox toolbox in Visual Studio 2008.I didn't come across any document on internet.Do you know any document,tutorial,code example etc. about this topic?
Could you help me please?
|
|
|
|
|
hiiiiiiiiiiiiiiii i want to read & display bitmap image using c.plz help me uptilnow i open the image ,read it ,mesure its width , hight, type etc but I cant put it in the form of array iwant to display array o image as well as i/p image also so plz help me.
|
|
|
|
|
See, for instance [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi ,
I am working on Access data base using MFC DAO classes.
Can I set/change the password of the data base programmatically.?
If yes please give me an idea.
Regards,
Sunil Kumar
|
|
|
|
|
Hi,
I have traverse all folder of Outlook in c# but not able to do same in c++.
please guide to do that.
Code is here
foreach (Microsoft.Office.Interop.Outlook.MAPIFolder folder in start)
{
node = node.Nodes.Add(folder.Name);
Microsoft.Office.Interop.Outlook.MAPIFolder found = TraverseTee(folder.Folders, name, bBuildTree, node);
node = node.Parent;
}
|
|
|
|
|
CFileFind can be called recursively to do the same
Величие не Бога может быть недооценена.
|
|
|
|
|
CFindFile traverse file but I want to traverse folder from outlook.
If this can happen with with please give any idea with code.
|
|
|
|
|
|
thank you for reply but no luck
|
|
|
|
|
Does this[^] help?
Regards,
Sandip.
|
|
|
|
|
|
I want to capture the desktop as an image just like printscreen function. Any Win32 API or MFC class that perform the task.
THANKS.
|
|
|
|
|
|
I believe there is a better way to do the Capture it the GDI way in the article.
Instead of GetDesktopWindow() and GetDC() you can use CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
offcourse superman's suggested method is better
see the code below for help
HDC hDesktopDC, hMemDC;
int nXPos = 0, nYPos = 0;
int nWidth = 0, nHeight = 0;
HGDIOBJ hOldBitmap, hBitmap;
// check for an empty rectangle
if ( IsRectEmpty( lpRect_i ))
{
return NULL;
}
// create a DC for the screen and create
// a memory DC compatible to screen DC
hDesktopDC = CreateDC( _T( "DISPLAY" ), NULL, NULL, NULL );
hMemDC = CreateCompatibleDC( hDesktopDC ); // get points of rectangle to grab
nXPos = lpRect_i->left;
nYPos = lpRect_i->top;
nWidth = lpRect_i->right - lpRect_i->left;
nHeight = lpRect_i->bottom - lpRect_i->top ;
// create a bitmap compatible with the screen DC
hBitmap = CreateCompatibleBitmap( hDesktopDC, nWidth, nHeight );
// select new bitmap into memory DC
hOldBitmap = SelectObject ( hMemDC, hBitmap );
// bitblt screen DC to memory DC
BitBlt( hMemDC, 0, 0, nWidth, nHeight, hDesktopDC, nXPos, nYPos, SRCCOPY );
// select old bitmap back into memory DC and get handle to
// bitmap of the screen
hBitmap = SelectObject( hMemDC, hOldBitmap );
// clean up
DeleteDC( hDesktopDC );
DeleteDC( hMemDC );
// return handle to the bitmap
return ( HBITMAP )hBitmap;
Величие не Бога может быть недооценена.
|
|
|
|
|
Thanks all of you for guidance and providing me a couple of alternates to perform the task. I would implement the stuff then I would be back , if i face some problem.....
|
|
|
|
|
Sorry, I have to ask very primitive questions but I did some work in VC++ around 9 years back and now forget every thing. Even I have to struggle to play with AfxMessageBox these days
Anyhow, now I want to display the captured image. The image is captured in HBITMAP hCaptureBitmap, so what class I should use to display the image. Suppose I have SDI based application and in View class what should I do......
|
|
|
|
|
no more direct code
Clue :-
1. device context.
2. SelectObject
3. bitBlt
Now try yourself
Величие не Бога может быть недооценена.
|
|
|
|
|
You mean , I should get the DC in view class by calling some thing like GetDC , then Select that DC and at the end by using bitBlt should display in the view class....
hmmm. what about if I take an object of Picturebox and then assign the handler of Bitmap to it. but I guess u are right there is no need to take an object of PictureBox, rather view class can be work as a placeholder as well. let me try
|
|
|
|
|
yes u should try
Величие не Бога может быть недооценена.
|
|
|
|
|
void CSDITESTView::OnFileTest()
{
int nScreenWidth = GetSystemMetrics(SM_CXSCREEN);
int nScreenHeight = GetSystemMetrics(SM_CYSCREEN);
HWND hDesktopWnd = GetDesktopWindow()->m_hWnd;
HDC hDesktopDC = ::GetDC(hDesktopWnd);
HDC hCaptureDC = CreateCompatibleDC(hDesktopDC);
HBITMAP hCaptureBitmap =CreateCompatibleBitmap(hDesktopDC,nScreenWidth, nScreenHeight);
SelectObject(hCaptureDC,hCaptureBitmap);
BitBlt(hCaptureDC,0,0,nScreenWidth,nScreenHeight, hDesktopDC,0,0,SRCCOPY|CAPTUREBLT);
::ReleaseDC(hDesktopWnd,hDesktopDC);
DeleteDC(hCaptureDC);
}
I guess this code should work as it is doing the all stuff already, but it not displaying anything ? why
|
|
|
|
|
Who will call the paint?
clue
1. Some one should call painting, isnt
Just simple, usually it is not done to give the whole code,
well check the below code.
HBITMAP CopyScreen( LPRECT lpRect_i )
{
HDC hDesktopDC, hMemDC;
int nXPos = 0, nYPos = 0;
int nWidth = 0, nHeight = 0;
HGDIOBJ hOldBitmap, hBitmap;
// check for an empty rectangle
if ( IsRectEmpty( lpRect_i ))
{
return NULL;
}
// create a DC for the screen and create
// a memory DC compatible to screen DC
hDesktopDC = CreateDC( _T( "DISPLAY" ), NULL, NULL, NULL );
hMemDC = CreateCompatibleDC( hDesktopDC ); // get points of rectangle to grab
nXPos = lpRect_i->left;
nYPos = lpRect_i->top;
nWidth = lpRect_i->right - lpRect_i->left;
nHeight = lpRect_i->bottom - lpRect_i->top ;
// create a bitmap compatible with the screen DC
hBitmap = CreateCompatibleBitmap( hDesktopDC, nWidth, nHeight );
// select new bitmap into memory DC
hOldBitmap = SelectObject ( hMemDC, hBitmap );
// bitblt screen DC to memory DC
BitBlt( hMemDC, 0, 0, nWidth, nHeight, hDesktopDC, nXPos, nYPos, SRCCOPY );
// select old bitmap back into memory DC and get handle to
// bitmap of the screen
hBitmap = SelectObject( hMemDC, hOldBitmap );
// clean up
DeleteDC( hDesktopDC );
DeleteDC( hMemDC );
// return handle to the bitmap
return ( HBITMAP )hBitmap;
}
void CSlideshawDlg::OnFirst()
{
RECT rect;
rect.left = 150;
rect.bottom = 500;
rect.top = 150;
rect.right = 500;
HBITMAP hBit = CopyScreen( &rect );
CDC memdc1;
CClientDC dc(this);
memdc1.CreateCompatibleDC(&dc);
memdc1.SelectObject( hBit );
dc.BitBlt(150,150,500,500,&memdc1,0,0,SRCCOPY);
}
Величие не Бога может быть недооценена.
modified on Thursday, July 30, 2009 7:01 AM
|
|
|
|
|
This is what I cooked, but it is not working... I know there is Invalidate() but it call onpaint again, so why we call it here.
void CSDITESTView::OnFileTest()
{
//m_pDC store the CDC pointer in OnDraw() function.
CDeskTop desktop;
CBitmap bitmap;
HWND hWnd=NULL;
bitmap.Attach(desktop.GetDeskTopImage());
BITMAP bm;
bitmap.GetBitmap(&bm );
CDC memDC;
CClientDC dc(this);
memDC.CreateCompatibleDC(&dc);
memDC.SelectObject(&bitmap );
m_pDC->BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &memDC, 0, 0,SRCCOPY);
}
HBITMAP CDeskTop:: GetDeskTopImage()
{
int nScreenWidth = GetSystemMetrics(SM_CXSCREEN);
int nScreenHeight = GetSystemMetrics(SM_CYSCREEN);
HWND hDesktopWnd = GetDesktopWindow();
HDC hDesktopDC = GetDC(hDesktopWnd);
HDC hCaptureDC = CreateCompatibleDC(hDesktopDC);
HBITMAP hCaptureBitmap =CreateCompatibleBitmap(hDesktopDC,nScreenWidth, nScreenHeight);
SelectObject(hCaptureDC,hCaptureBitmap);
BitBlt(hCaptureDC,0,0,nScreenWidth,nScreenHeight, hDesktopDC,0,0,SRCCOPY|CAPTUREBLT);
ReleaseDC(hDesktopWnd,hDesktopDC);
DeleteDC(hCaptureDC);
return hCaptureBitmap;
}
|
|
|
|
|