|
Try using the ShellExecute function, with the operation argument set to "print".
Software Zen: delete this;
|
|
|
|
|
Thanks a lot for your help ! =^^=
I have already solved the printing problem by using "ShellExecute" !
However, it doesn't open the "Print" dialogue. Instead, it just sends the file to the default printer.
Would you like to let me know that how can I launch the "Print" dialogue by using "ShellExecute" also ?
Thanks a lot for your help again !
Betty
|
|
|
|
|
1. You need to find out details of the PrintDlg, PrintDlgEx and PageSetupDlg common dialog box functions.
2. You can't directly. You could save your settings as the default printer and settings (not sure about that last bit, but SetPrinter and stuff should help), and then call Word/Excel with print as an option on the command line - but then you've got to wait and restore the original settings, or the user will be mightily PO-ed.
Also, you'd have a problem printing just some of the pages that way. It might be possible to do it specifically for Excel and Word by using automation, but that feels like a large sledgehammer.
Steve S
|
|
|
|
|
is it possible to allocate more than 400 mb of phisical memory when your ram is only 512mb. i have successfully allocate about 360mb nothing more than that. why is that?
If you re expert on this one,please explain to me.
Thanks,
Shin
|
|
|
|
|
Even though Windows OS is a multi-tasking environment, and on the later versions (2000, NT, XP), it is capable of using the 'Virtual Machine' technology, you cannot allocate all memory for your programs.
The problem here is that even on the VM mode - Where every process of your computer believes it has all the system resources available, and a background process of Windows is taking care of processor time/memory allocation/swapping - the forementioned background process and Windows base services reserve a section of memory for private use. For example, the swap file reserves a piece of cache memory for itself to ensure optimized performance. Similarly, other base services such as HAL layer, Win32 API and SVC host take a piece of the available memory.
Thus, the resulting free memory is available for program use. On a Windows XP system, you can see the available memory from the Task Manager. As an example, my system has 1 GB of RAM memory, from which 707 Mb is currently available. Thus, ~300 Mb is taken by currently running applications and the background services. Putting all other applications to rest I can free up to 830 Mb of memory.
However, the base question is why on Earth do you need 400 Mb of RAM ? If you have a data store of that size, it is suggested to move it into a file or a database. This allows much smoother performance. Eating up RAM memory will slow down the performance of your machine, thus it should be used sparingly. Needless to say what a memory leak would do in this situation..
So, to answer your question: if you want all the 512 Mb of memory for your program's use, you must give up on Windows and/or Linux and use a non-resource hungry OS, such as Symbian OS. However, this will effectively reduce your program's visual output as well.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
confused:I can customize the existing CFileDialog by deriving a subclass from it. But the controls that i can drop into the extended CFileDialog dialog template are limited to only basic windows controls like EditBox,Buttons etc. I also watched that most of these controls are implemented in cmnctl32.dll library.Any attempt to embed any ActiveX control in the template simply shows up nothing - no file dialog.
|
|
|
|
|
I want to put a CButton control within a CReBar control.
I used the CReBar::AddBar method, but the Button appears disabled.
Is there another way to make this work?
Thanks!
|
|
|
|
|
Have you added a handler for the button's click ?
In order for a toolbar's (which a ReBar control is) button to be available, you must have a valid message map entry that handles the click on that button. If this entry is not available, the button is automatically disabled.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks a lot. Now it works.
But I have another problem: I have two Bands on a CReBar control. How can I resize the two bands to make them both visible?
(Sorry formy English!!!).
|
|
|
|
|
Use GetRebarCtrl under CReBar to get the ReBar control. Then use CReBarCtrl::SetBandInfo to set the band properties. Familiarize yourself with REBARBANDINFO structure. It has a member called cx to set the band's width.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi all,
Is it possible to detect the insertion and removal of removable storage? I need to know so I can call up a photo management application when this is done.
Regards,
Mark
|
|
|
|
|
Yes it is possible.
See this[^] link on the MSDN Library. It directs you to the home page of 'Remote Storage Manager' service.
This service can be queried to send notifications on a device's state. If you cannot find useful information from that link, use the keyword 'BeginNtmsDeviceChangeDetection' as a search parameter. This is a function that is used to request a notification object.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
|
I am importing a tlb in MFC which accepts safearray as parameter.
I have to pass filenames in this parameter. can anyone pl tell how can i pass filenames by safearrays as i am novice in vc++
|
|
|
|
|
I know Win32. So I am sending U same. Else gv the id where I can send U complete code. One more thing SafeArray is meant for passnig values from Vb client to vc Dll. Anyway for time being:
<br />
#include "stdafx.h"<br />
#include <windows.h><br />
#include <tchar.h><br />
<br />
#import "..\Colors\Colors.tlb"<br />
<br />
using namespace COLORSLib;<br />
<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
CoInitialize(NULL);<br />
try<br />
{<br />
IColorObjectPtr pSA(__uuidof(ColorObject));<br />
_variant_t var = pSA->Colors;<br />
SAFEARRAY* psa = var.parray;<br />
BSTR* bstrArray;<br />
SafeArrayAccessData(psa,reinterpret_cast<void**>(&bstrArray));<br />
for(UINT i =0;i<psa->rgsabound->cElements;i++)<br />
_tprintf(_T("%ls\n"),bstrArray[i]);<br />
SafeArrayUnaccessData(psa);<br />
}<br />
catch(_com_error e)<br />
{<br />
_tprintf(_T("Error: 0x%08 %ls\n"),e.Error(),e.ErrorMessage());<br />
}<br />
<br />
CoUninitialize();<br />
return 0;<br />
}
hope it help.
Cheers!!
Siddharth
|
|
|
|
|
hi siddharth,
Thanx for ur reply.
Actually I have to use a DLL in MFC that is a ATL DLL in
VC++. This DLL converts from one file format to another. and it accepts a
safearray to perform its functionality.This DLL is running fine from VB as i
have tried and now i am trying to use it in VC++. i tried to pass safearrays
and i guess i am not still at the right position. if u can help me thanx a
lot. one thing more is that i don't have tlb of this dll. my mailid is ritu@sebiz.net
|
|
|
|
|
my program created using MFC which i chose static dynamic link. i also insert a MSFLEXGRID in the program. the computer i use is win2k. i test program on other machine and it only run on win2k comp but not on XP or NT. anyone know why? needed special file?
|
|
|
|
|
It sounds like you don't have the FlexGrid control registered on the other machines.
On your Win2K machine, find the file MSFLXGRD.OCX, which will probably be in \Windows\System32. Copy it to your WinXP machine in the same place. At the command line, use REGSVR32 to register the control.
Software Zen: delete this;
|
|
|
|
|
|
I want to create .pdf from image or text file.
and I have not download PDF SDK from adobe site.
Cour you tell me how to get PDF SDK to create PDF file.
Thanks!
|
|
|
|
|
Hello!
Check this website: http://partners.adobe.com/asn/acrobat/docs.jsp. You can find all sorts of documentations and the PDF SDK there. Hope that helps.
Later,
Caleb
|
|
|
|
|
Oneguy asked me the following question
int a=5;
int &b=a;
Where b is stored,
I answered him in Symbol table...and he said no...and then I asked him , can u plz tell me after interview where it is stored...he didnt replied.Does any one know , where the Standalone reference are stored, How and When..
regards
Balkrishna Talele
|
|
|
|
|
When i tried to compile the above code i got the following error
error C2440: 'initializing' : cannot convert from 'int *' to 'int &'
A reference that is not to 'const' cannot be bound to a non-lvalue
P.R.A.K.A.S.H
|
|
|
|
|
it was just typing mistake...
consider this example
int a=5;
int &b=a;
where is b stored...if so why...REMEMBER , The ans is not stack or heap
regards
Balkrishna Talele
|
|
|
|
|
&b is a reference to a, so b and a are taking the same memory location.
global or stack depending on the scope.
|
|
|
|