|
Does anyone know how to do a screen grab into a DIB from a CView derived window. I actually do the rendering in the window using OpenGL and I need to display the screen grab of the window in a thmubnail. everything is set up, now I need to get that DIB from the window.
Oh yeah, the other thing is that not all of the windows will be visible, but I still need to grab of the screen as it would appear if it were on top...
can anyone help?
|
|
|
|
|
I want to create an Excel file.
so I use :
hFile=::CreateFile("E:\\my.xls", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
but this file is 0 KB ,
In fact ,EXCEL create a new file is 11kb.
I think ,this file don't contain excel format .
Can you help me ?thank you!
|
|
|
|
|
the file u created is an empty file. .xls if a file format and u need to create ur file in that file format. just by naming a file with .xls extension u cant get an excel sheet. so search creating a file in excel file format
Ganesh Ramaswamy
|
|
|
|
|
If you can ensure excel will be installed on the machine(s) where your program will run, you can use Excel's COM interface to create a new worksheet: (example for Excel 97)
import interfaces (adjust to install path for office)
#import "C:\Program Files\Microsoft Office\Office\MSO97.DLL"
#import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBEEXT1.OLB"
#import "C:\Program Files\Microsoft Office\Office\EXCEL8.OLB" \
rename("DialogBox","_DialogBox") \
rename("RGB","_RGB") \
exclude("IFont","IPicture")
using namespace Excel;
launch Excel, create new workbook
_ApplicationPtr pApp(__uuidof(Application));
pApp->Workbooks->Add();
display to user
pApp->PutVisible(TRUE);
For more information on manipulating Excel via COM, see the MSDN documentation. For more on using the Excel COM interface from Visual C++, see Igor Tkachev's article Using MS Office in an MFC Application.
|
|
|
|
|
Okay it's time to make my Cuestion....
Any body Know which is the service that manage the Shared Directorys????
I have a service that read a shared directory, When the server starts the service can't read the shared directoy. I need to make my service depending of that service...
Thanks....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I think it's the 'Server' service
|
|
|
|
|
I found the service, I need to make my service depending of workstation service....
Cheers!!!!
I'm Happy Again...
Today is Friday!!!
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
SC_HANDLE CreateService(
SC_HANDLE hSCManager, // handle to SCM database
LPCTSTR lpServiceName, // name of service to start
LPCTSTR lpDisplayName, // display name
DWORD dwDesiredAccess, // type of access to service
DWORD dwServiceType, // type of service
DWORD dwStartType, // when to start service
DWORD dwErrorControl, // severity of service failure
LPCTSTR lpBinaryPathName, // name of binary file
LPCTSTR lpLoadOrderGroup, // name of load ordering group
LPDWORD lpdwTagId, // tag identifier
LPCTSTR lpDependencies, // array of dependency names
LPCTSTR lpServiceStartName, // account name
LPCTSTR lpPassword // account password
);
You have to specify dependencies in the lpDependencies parameter.
Martin
|
|
|
|
|
Carlos Antollini wrote:
I found the service, I need to make my service depending of workstation service....
Like a few others already have said, it's actually the server service.
The server service handle NETBIOS, which makes other computers able to access your shares, and makes you able to access shares, and a lot of other stuff...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
shares are handled by the "Server" service.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hello,
How it is possible to delete a CWinApp object (theApp) programmatecally???
I explain my problem:
My main programm is a console programm (then it use no frame).
When a user type a command in the console, the main programm create a CWinApp
object and build a CMainFrame object using a DLL.
To close the main frame (ie the CMainFrame object), the user use a menu option
and I send a WM_CLOSE message to CMainFrame.
CMainFrame is correctly destroyed, but the CWinApp object is not deleted...
How it is possible to delete a CWinApp object (theApp) programmatecally???
Thks,
PK
|
|
|
|
|
Hello Everybody,
my problem is the following: I have create a Splietted View.
I would like to hide or show the second row simply cliccking a toolbar button.
How can I do that?
Have a good day
|
|
|
|
|
Any tip / sample code ?
Thanks in advance.
Miroslav Rajcic
|
|
|
|
|
Try this:
BOOL SHGetPathFromIDList(LPCITEMIDLIST pidl,LPTSTR pszPath);
and then
DWORD WNetGetUniversalName(
LPCTSTR lpLocalPath, // path for network resource
DWORD dwInfoLevel, // level of information
LPVOID lpBuffer, // name buffer
LPDWORD lpBufferSize // size of buffer
);
Regards,
Martin
|
|
|
|
|
Thanks!
First one now works good enough for me.
Regards,
Miroslav Rajcic
|
|
|
|
|
Hello everyone!
I have one silly question.
::SendMessage(::GetDlgItem(m_hWnd, IDC_LIST), LB_ADDSTRING, 0, (LONG) achKey);
This ^^^^ adding string to a listbox.
How can I do same thing for Control List?
==============
www.design.kg
|
|
|
|
|
If you mean a ListView control, look up LVM_INSERTITEM on MSDN.
Michael
|
|
|
|
|
Hi all, I`ve managed to load a bitmap as a DIBSection and have kept the HBITMAP structure (I haven`t attached it to a CBitmap). However, now I want to serialize the bitmap in the widely used bitmap format. Currently I create a CFile object to the location I want to save, with the flags modeCreate | modeWrite, I then create a CArchive and set it to ::Store using this newly created file. I then attach my HBITMAP to a CBitmap object and call the serialize function. The "bitmap" is created in the location specified but its 0 bytes big, so I don`t think the CBitmap serialize is working, any ideas on how to solve this would be much appreciated,
Cheers Guys,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Bitmaps do not support serialisation. Look at the bitmap section on Code Project for several classes to save bitmaps, also my GDI+ articles, and the FAQ lists several other options
Only a master of evil, Darth - Obi Wan Kenobi
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Thanks Christian, I thought this question would be right up your alley! I like the return quote too, it humoured me quite a bit.
Cheers again Christian,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
I`ve checked the codeproject web-site and found a CxImage wrapper, which does serialisation amongst many other stuff. However I find it incredibly difficult to read (as its a multi-project thing with passwords etc.), but its too complex. It uses a FILE structure (of which I know nothin about) and fwrite. I was wanting to use CArchive's << operators (I know a tincy wincy thing about them), but I need to know which order to iterate through each member variable, does anyone know this? or can someone advise on a better approach (I just need a little kick in the right direction, cos I`m not sure what I`m doing at the moment ) Is GDI+ the way to go Christian?
Thanks guys,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
is that u have a proper HBITMAP and u want to persist this bitmap, if so refer MSDN Platform for storing bitmaps and it has a sample code. copy and paste ( if u dont wnat to understand ) and u r done ( ofcourse u have rename the variables )
Ganesh Ramaswamy
|
|
|
|
|
Yes, GDI+ makes all of this incredibly easy. The only catch is it doesn't support W95.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hi all, OK I`ve managed to get it going, and am just seeking a little reassurance. What I`ve done is created a (fully filled out) BITMAPINFO structure, and a (filled it out manually) BITMAPFILEHEADER structure. I`ve then used
ar.Write(theBITMAPFILEHEADER, sizeof(BITMAPFILEHEADER));
ar.Write(theBITMAPINFO, sizeof(BITMAPINFO));
ar.Write(pBits, theBITMAPINFO->bmiHeader.biSizeImage);
Now, I seek reassurance cos when I compare an image that exists on my HD, to an identical copy that I saved using my app, the newly saved image is 2 bytes shorter (in at least one case). I`ve tried re-loading the new image in paint, everything seems fine, do I just leave it? Or is this a problem that could potentially send my computer kaput?
Cheers all for your responses,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Think of an application like Explorer. It can easily drag & drop files to another application, if the application allows to do so. For example if you drag a text file to IE, the file is not copied to a location but shown in the explorer.
I am trying to implement such a functionality similar to Explorer. I want to list some files in a tree control and then I want to be able to drag them to another application. This application knows how to handle dragged files, like the explorer drags.
I've found several examples on d'n'd where both, drag source and drag target, remainded in the same app and in the same client window. But I have never found an example on how to drag something outside my application.
Does somebody have suggestions?
|
|
|
|
|