|
|
I think I'll start with Reilly’s book.
Personally, I feel as a "victim" of VC wizards.
Always using "MFC project" I have no real knowledge how the compiler and linker works.
I only know about some of the (MFC) files when the IDE breaks, which is pretty common in VC.
I believe "automation" is nice, but at present I am looking at "Make" as an another layer which hides the real works.
To really appreciate "Make" I need to learn how to control the compiler using commands.
Yet another project, darn, on top of "honey do's".
Cheers Vaclav
|
|
|
|
|
Hi,
I'm developing an MFC application using VS2010.
I noticed that the the printing in my application stopped to work. I reckon that it happened when I moved from VS2005 to VS2010, as it was working fine before.
So the releveant piece of code is here:
CPrintDialog PrintDlg(FALSE, PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NOSELECTION | PD_DISABLEPRINTTOFILE, this);
if(PrintDlg.DoModal() == IDOK)
When PrintDlg.DoModal() is executed it comes up with this message:
"Before you can perform printer-releted tasks such as page setup or printing a document, you need to install a printer. Do you want to install a printer now?"
When I press the 'Yes' button it comes with another error:
"Windows can't open Add Printer. The local print spooler service is not running. Please restart the spooler or restart the machine"
I have network printer installed as default, and I can print from any other application without a problem.
I'm using Windows 7, but I checked on Windows XP and it comes with the same error.
I tried to swap the above code with:
CPageSetupDialog psd(PSD_INTHOUSANDTHSOFINCHES | PSD_MARGINS | PSD_ENABLEPAGEPAINTHOOK, this);
if(psd.DoModal() == IDOK)
but it does the same thing.
EDIT:
Actually I run old version of application (compiled with VS2005) and it behaves the same way. So it's not caused by VS2010 after all.
Any ideas?
modified 18-Oct-12 10:00am.
|
|
|
|
|
Have you tried recreating this with a "dummy" application, either console OR dialog based? Put nothing in it but the use of CPrintDialog .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 19-Oct-12 8:02am.
|
|
|
|
|
Yes - I tried it with dummy app and it does the same thing.
|
|
|
|
|
blackbolek wrote: The local print spooler service is not running. Please restart the spooler or restart the machine
You need to start your "Print Spooler" service, through the Services Manager, and then restart your computer, so that the service is running error-free.
To do this
1.) Go to the start menu.
2.) Type in "Services".
3.) Click the item that has the gears on it.
4.) UAC will pop up (since your affecting the whole system and every user on it), Click OK or Yes. If it requests a password, enter the one of the account your on then click OK or Yes.
5.) Then look for the service.
6.) To Start it (look below)
a.) Right-click it, then click "Properties".
b.) Under the tab "General", on the label "Startup type", click the combo box, then click "Automatic" (it may ask you to restart your computer, but you need to anyways).
c.) Click OK, exit out of the Services Manager.
7.) Restart your computer.
Finally, I would test that application, to see if it works now.
Also, if you did not know the service was disabled, maybe malicious software is on your computer, or someone was messing with your computer, just throwing that out there.
Simple Thanks and Regards,
Brandon T. H.
Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst).
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
modified 27-Oct-12 17:43pm.
|
|
|
|
|
I checked and the Print Spooler service is running, start is set to Automatic.
I don't think it has anything to do with it because all the other application on this PC are printing without any problem.
Thanks for your replay anyway.
|
|
|
|
|
Hello Friends
I created a project in VS2010 used adobe SDk and created adobe illustrator plugin(.aip).
Now,i want to open this project in Adobe Flash Builder to convert into ZXP format.
But,I am not able to open this vs2010 project in flash builder.
Any Ideas?
Regards
Yogesh
|
|
|
|
|
At a guess I would say the Flash Builder is not designed to handle Visual Studio project files.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Are you trying to open the vs2010 project in flash builder or are you trying to open your plugin in flash builder?
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
I am trying to vs2010 project in flash builder.
Bcoz I want to create output as .zxp so that i can install in CS Extension manager.
Or is ther any other way to create .zxp format As I am having .aip plugin tht i got as output of vs2010 project.
Or Can I create .zxp format in vs2010 ?
Any Ideas?
Thanks & Regards
Yogesh
modified 19-Oct-12 0:16am.
|
|
|
|
|
ListView_InsertColumn associated subitem.
How does it really works if it works?
It seems that I can create columns with associated subitem -1. Does it mean that this column has no associated items ? also if it has associated subitem it seems that has no affect...
|
|
|
|
|
I'm not sure what you are asking but the subitem is the column index (0 to N) when adding columns. I have not used -1, so would be interested to know what results you see.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
ok, then theoretically you can assign one subitem to several columns. Does it mean that all columns will display for example subitem 1 data?
what if I will delete column 2 which is associated with subitem 1 (while column 1 is associated to subtiem 1 also)?
|
|
|
|
|
As far as I am aware, from using ListView controls, the subitems are merely column indices and are adjusted as columns are added or deleted. Once you have set your columns then the subitems are in ascending order starting at zero.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
This is an interesting question and I have googled a little bit but did not found any satisfying answer.
I have always used the same numbers for column and subitem. I have just tried different subitem values (including -1) with a report list. But everything was working as expected, even with column re-ordering by drag & drop and an owner-drawn list.
So it seems that the subitem number passed by various functions is set to the column number and not to the subitem number.
However, this may be not always true. The LVN_GETDISPINFO notification message passes a LVITEM structure which may contain the subitem number passed when inserting the column. But I didn't checked this so far.
|
|
|
|
|
I have always assumed (and never been proved wrong) that the subitem is the same as the column number. As far as I have been able to tell, there is nothing else associated with the subitem number, although the MSDN information does not make it perfectly clear.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I have map
typedef std::map<int, mydatatype=""> myMap;
myMap m1, m2;
.....
m1 contains old data, m2 - new data. Normaly I am doing so
m1 = m2;
but it does actual copying. How can I copy refference m2 to m1 ?
|
|
|
|
|
You need to use pointers rather than references like:
typedef std::map myMap;
myMap *m1, *m2;
m1 = new myMap;
m2 = new myMap;
m1 = m2;
However, this will affect all the code in between so may not be the optimum solution to your problem.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
If you don't need m2 after its been used to update m1 use the swap function:
m1.swap(m2);
Steve
|
|
|
|
|
See more: VC++
Dear All,
I am working MFC Application, this application is compiled using VS2008.
To capture the key pressed
OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
method is used.
The strange thing happening is when i press the key "a" without caps lock its gives the nChar value as "65" which is suppose to be "97".
Even if the caps lock is "ON" the value i get is "65" when i press "A".
The thing is either the caps lock is on or off, i get the same value as if the caps lock is on. (this is the case with all the keys)
as the OnKeyUp() is as MFC method, I am not sure how to solve this issue.
Kindly help me and let me know if you require any more information.
Below is the code i am using, because of this what happens is, when i set a text using SetDlgItemText(), it is always going as Upper case letter or word.
void CMyProg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CString SBCommand;
CString Temp;
char *s = NULL;
char strnChar[10];
/* Alphabets and Numerals passed to the command box */
if((nChar >= 65 && nChar <= 90) || (nChar >= 48 && nChar <= 57))
{
pFrame->m_wndStatusBar.GetDlgItemText(IDC_SB_POINT,SBCommand);
Temp.Format("%c",nChar);
SBCommand += Temp;
pFrame->m_wndStatusBar.SetDlgItemText(IDC_SB_POINT,SBCommand);
/*pFrame->m_wndStatusBar.GetDlgItemText(IDC_SB_POINT,SBCommand);
SBCommand += (char*)nChar;
pFrame->m_wndStatusBar.SetDlgItemText(IDC_SB_POINT,SBCommand);*/
}
}
|
|
|
|
|
OnKeyDown: The key is Kept Down
OnKeyUp: The Key is released
The above two together form OnKeyPress
All three will give the state of the Keys.
OnChar is the best event for your expectation.
|
|
|
|
|
The character value is a virtual-key[^] code. You can use GetKeyState(VK_SHIFT) to check if any shift key is pressed or not.
Depending on your requirements, it may be better to handle WM_CHAR notifications (CWnd::OnChar() ) rather than using key up/down notifications. Then you will get the character code of the key that was pressed.
|
|
|
|
|
In addition to VK_SHIFT , you may also want to check the state with VK_CAPITAL .
|
|
|
|
|
Hi In VC++ 2005 i am working in SDI applications
1) How to change the whole background color of CStatusbar including all panes.also
2)How to change background color of a Menubar.
|
|
|
|