|
The easiest way to do something like this is to take a slightly different approach:
- Use Windows 'Print to file' to produce a file containing the printer driver's output
- Copy the file to the 'printer port'. This can be a networked printer.
For example, on the LAN I'm using, there's a printer called 'mint' that's served through a print server called 'greenhouse'. If I print to a file, 'd:\test.prn', the following will cause the file to be correctly printed:
copy d:\test.prn \\greenhouse\mint
|
|
|
|
|
I have 3 values "number name and value" for different parameters in a notepad..
My Question:
Suppose a notepad say A contains the above values in the following manner
number1
name1
value1
number2
name2
value2
.
.
.
.....and so on till say 500 parameters..Now I have a notepad B which is empty.I am using a listbox which contains the list of all parameter names.So if I click on a particular name,it must automatically take the corresponding number and value of that parameter name from the notepad A and store them along with the parameter name selected in notepad B.The listbox is a multiselection listbox.I want to execute this using VC++ MFC classes.Can anyone pls help me how to do this?
Thanks,
modified on Wednesday, January 21, 2009 5:40 AM
|
|
|
|
|
And what is your doubt about?
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]
|
|
|
|
|
notepad to me means notepad.exe, a simple text editor.
I assume you mean a text file?
So you many small problems you can work on one by one.
1/ How do I read a file,
2/ I need to take 3 lines at a time, and fill a structure with: Number,Name and Value. I don't know if value is text, floating point or integer
3/ Make an array or list of these structures as they come in
4/ Have a list box, and populate it with this information - I'd suggest a ListCtrl in report view; but if you could do that, you'd be asking different questions. Keep it simple first!
5/ Detect a click on the list box
6/ Write the contents of the correct array entry to a file.
You problem sounds intimidating at first - so don't swallow it whole, try bite sized nibbles.
Each of the above stages should be solvable with your favourite book / msdn.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Iain Clarke wrote: You problem sounds intimidating at first - so don't swallow it whole, try bite sized nibbles.
Ah, the classic "How do you eat an elephant?" approach.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
DavidCrow wrote: Ah, the classic "How do you eat an elephant?" approach.
Isn't the answer "Lots of ketchup"?
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
My doubt is:
What code should I use to get the information stored from notepad A to notepad B,when I doubleclick on the parameter name given in the listbox.How to do this using VC++ MFC classes?
|
|
|
|
|
i have created a simple project in Visual studio 2008 after installing the feature pack.
i found that there are new classes for toolbar, menu etc viz: CMFCToolbar, CMFCMenuBar, ...
now if i want to use the old class CToolBar and create a toolbar, then DockControlBar() function fails.
is there no way to use CToolBar class?
sample code:
after i create the toolbar, i dock as follows
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
thanks
|
|
|
|
|
me too running with the same issue ple ase help
|
|
|
|
|
Hai !
I have an button in my dialog i want to make it invisible, is there any function to it ??
for ex> to disable a button i do : myButton.EnableWindow (FALSE);
thanks !
|
|
|
|
|
|
You can use of ShowWindow(SW_HIDE) or you can set visible option to false of your control on the property window.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
The previous answers were correct but remember that a hidden button is still enabled.
|
|
|
|
|
i have an image n i want to set it as my Application Icon how can i set it ?
|
|
|
|
|
1. change the extension of the image to .ico and put the image in your res folder.
2. in the resource editor select the option called icon
right click and select import
select the image from the res folder
set the icon in the constructor of your dilaogdlg.cpp file
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
Hope it helps
|
|
|
|
|
thanks a lot, m just gona try it...hope it'll work
|
|
|
|
|
hi i m using BitBlt for preview dc my drawing coming distorted while in normal display it comes proper.
i have used memDC for drawing and using BitBlt for copying on display dc. i have to use memDC to avoid flickering.
used StrechDibits also same result.
Plz help and suggest me flicker free solution.
thnks
|
|
|
|
|
|
|
i think u didnt get me.. i have used memDC fot flicker free drwaing but it does not work in case PrintPreview. I have used BitBlt for copying from memDC to pDC. But not in case of print preivw.
if i do drawing does not come properly.
i think there is some problem with BitBlt in case of preview DC.
thanks
|
|
|
|
|
What exactly do you mean by
_T("No name") wrote: drawing does not come properly
?
Maybe put up some code or -don't know if it is possible or allowed or a nice thing to do- screenshots or maybe links to screenshots for us to see what you mean.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
void CCalendarControlView::DrawOnDC(CDC * pDC, int isPrinting)
{
if (pDC->IsKindOf(RUNTIME_CLASS(CPreviewDC)))
{
memDC.CreateCompatibleDC(pDC);
bmp.CreateCompatibleBitmap(pDC, rc.Width(),rc.height());
memDC.SelectObject(&bmp);
pMemDC = &memDC;
}
//Now m doing some drawing on pMemDc
and at last after drawing for display
pDC->BitBlt(0,0,rc.Width(),rc.Height(),pMemDC,SRCCOPY);
}
and onPrintPreviewButtton()
{
AFXPrintPreview(this);
}
m doing this getting correct drawig in case of niormal display but not in case or print preivew.
|
|
|
|
|
Explain what your print preview looks like. You could try using SetAttribDC[^] or SetOutputDC[^], but without seeing your results i am just guessing around.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
i was getting some thing earlier. but now with the code i have given u m nt getting nything. on Print preview it just comes while page.
did u got the code write in that code i have just written the case of preview DC
thanx
|
|
|
|
|
Pardon?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|