|
Hi,
I just want to add a cool feature to my application: creation of pdf documents from data in a listview control. However, pdf is a binary format, and therefor not as straightforward to create as for example html.
Does anybody know of a free (maybe open-source?) library that works under Visual C++, to create simple pdf files?
Thank you,
Erik
|
|
|
|
|
I think PDFlib Lite is free for personal use.
Visit www.pdflib.com and look for PDFlib lite.
Regards
|
|
|
|
|
Well, I am a newbie programmer.
I need help with a lil project I am making.
Lets say I have this button called increase, when I press this button I want it to add 1 to the variable x, and display the changes.
So under the button "OnIncrease",
I chose and put the command
x++;
Which lets me add 1 to the variable x which is an unsigned long. Once this button is clicked, I want to also make it display in the box called "OnList"
which is a list box.
Can anyone explain simply how to make it say, "You have "x" dollars in your account."
Thanks,
make sure it is simple for me to understand.
Arun
|
|
|
|
|
CString str;
CString output;
str.Format("%i", x);//make a string from your number
output = "You have \"" + str + "\"dollars in your account.";//make nice ans fluffy string. (\" is a " character in your string)
listbox.Add(output);//add to listbox (could be AddString or something don't know by heart)
hope this helps.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I tried implementing your code and I got errors.
Do you think you can manually explain it?
What did you mean make nice ans fluffy string?
I get these errors -_-
F:\Documents and Settings\Administrator\My Documents\Arun\Code\Tycoon\TycoonDlg.cpp(107) : error C2065: 'listbox' : undeclared identifier
F:\Documents and Settings\Administrator\My Documents\Arun\Code\Tycoon\TycoonDlg.cpp(107) : error C2228: left of '.Add' must have class/struct/union type
F:\Documents and Settings\Administrator\My Documents\Arun\Code\Tycoon\TycoonDlg.cpp(107) : error C2065: 'output' : undeclared identifier
This is the code from my file.
void CTycoonDlg::OnIncrease()
{
cash++;
//On Click, Display in ListBox "You currently have $(cash) with you."
CString str;
CString output;
str.Format("%i", cash);//make a string from your number
output = "You have \"" + str + "\"dollars in your account.";//make nice ans fluffy string. (\" is a " character in your string)
}
void CTycoonDlg::OnList()
{
listbox.Add(output);//add to listbox (could be AddString or something don't know by heart)
}
I know I said "x" would be the variable, but I decided it was too confusing and changed it to "cash".
|
|
|
|
|
arunforce wrote:
What did you mean make nice ans fluffy string?
Nothing actually, crazy developers like myself often set crazy comment to try and be funny.
ok, CString output is declared LOCAL in your case. Put it in your .h file or somewhere on top of your .cpp file. (but under the include part)
"listbox" is an unknown Object (or variable) in your case.
go to the resources, right click your list box and choose "add member variable". Name it and use this name instead of "listbox"
output = "You have \"" + str + "\"dollars in your account."
make it:
output = "You have " + str + " dollars in your account.";
then you don't have the " in your text.
try this and you'll get less errors.
btw: I explained it taken in account you have Visual Studio. If you don't, you have to create your listbox manually. =>( http://msdn.microsoft.com[^] search on CListBox)
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
hey all
i know that the code is
ShellExecute(NULL, "open", "http://",NULL, NULL,SW_SHOWNORMAL);
but if i want to hide the window of the IE... is there any way?
|
|
|
|
|
Hi,
ShellExecute(NULL, "iexplore", "about:blank",NULL, NULL,SW_SHOWNORMAL);
Width CreateProcess() function can obtain more information about new process:
Visit this link to : Creating Processes(msdn)[^]
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
Try SW_HIDE rather than SW_SHOWNORMAL.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
if you want to hide or show it later you can do so using ShowWindow();
the problem is you will have to obtain a handle ot the window
example (hide)
ShowWindow( hWnd, SW_HIDE );
example (show)
ShowWindow( hWnd, SW_SHOW );
if im guessing correctly you want to get the user to go to a web-site, without them knowing it right?
if this is true i suggest just learning how to use sockets
Nishant (i think i spelled it right) has a very good artical on using sockets
|
|
|
|
|
you are right archer.. i want the user get the website without knowing it...i will try to find more info about socket.. and sure i will replay here for more info.
thanks : )
|
|
|
|
|
Instead of running IE, you could use UrlDownloadFile() to download a file or use my WebResourceProvider[^] class to write a crawler.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Dear all,
I'm writing an dialog based aplication, and i need erase and add any styles in a CCombobox bases class in runtime, example erase CBS_SORT style and add CBS_DROPDOWNLIST style:
void CItemsComboBox::ChageStyles()
{
ModifyStyle(0,CBS_DROPDOWNLIST);
ModifyStyle(CBS_SORT,0);
}
but it does not work!
I-m using VC++ 6.0 SP6 - Win98SE.
Thanks.
Ivan Cachicatari
|
|
|
|
|
Quite a few styles cannot be changed at run-time. How about creating a new control at run-time with the desired styles?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi there,
I posted previously about GDI objects and how I should be dealing with them. Well someone said something (which I have implemented thereafter) about deselecting the objects used in a DC "session". In order to understand what I mean by DC session, we'll have to consider the following:
void CClass::MyPaintProc(...)
{
CDC *pDC;
pDC = new CDC;
pDC -> Attach(GetDC() -> GetSafeHdc());
pOldPen = pDC -> SelectObject(myPen);
pOldBrush = pDC -> SelectObject(myBrush);
.
:
.
pDC -> SelectObject(pOldPen);
pDC -> SelectObject(pOldBrush);
ReleaseDC(pDC);
delete pDC;
}
What is the purpose of de-selecting the GDI objects? I really would like to know the reason behind it...
Now as for the second question. Is there any way of making the main thread (the app) receive and translate the keyboard accelerators which activate the menus regardless of the window that has the focus? I've tried using TranslateAccelerator but couldn't solve it.
And the third and final question... hope you're not bored just as yet . How can I get a CRegion (or something similar that Windows understands) of the visible area of the client area of a window? Imagine a dialog box hovering partially over a control. How can I know the visible area of the control?
For just being brave enough to take the time to read through all this, I thank you.
David
|
|
|
|
|
dNimrod#X wrote:
What is the purpose of de-selecting the GDI objects?
The Windows docs state that you should release the DC in the same state as it was when you got it, ie. it should have all the same GDI objects selected, ideally the same mapping mode, background colour etc. Most of the time, Windows can handle any changes, but sometimes it falls over in a giant steaming heap
dNimrod#X wrote:
CDC *pDC;
pDC = new CDC;
pDC -> Attach(GetDC() -> GetSafeHdc());
What is the reason for doing this? Why not just do
CDC *pDC = GetDC();
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
CDC *pDC = GetDC();
So this should be enough, do you think? Hmmm... I've always liked to complicate what's simple by nature...
Thanks for the tip!
What about the other questions? Can you think of anything?
|
|
|
|
|
Actually, you should use CClientDC instead of manual GetDC/ReleaseDC calls. It will call these functions for you in its constructor and destructor. Similarly, you can use CPaintDC in WM_PAINT-handling code.
Tomasz Sowinski -- http://www.shooltz.com
Alika masiaka!
|
|
|
|
|
Well, the problem is I need to put a bitmap on ListCtrl header with non-rectangular shape. So edge-smoothing parts should be the same color that system uses for highlighted/pressed/free states. I'm using Windows XP and my application should depict colors correctly in any color theme (olive, silver or even classic Windows styles.)
|
|
|
|
|
Have you looked at GetSysColor() ?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
And how can it help me? I need to put already prepared image but not draw it myself. Ok then let's formulate the task a little different: I've set these unnecessary parts' colors to transparent but they match system (window) colors only when being in unfocused state. I need them to be depicted correctly when control is focused/highlighted too. I guess my explanation is fine.
|
|
|
|
|
I'm working on a c++ win32 project and i need to create a floating dialog box...
Presently, I have to close the dialog box before I have access to the to the main window...How can I go abt going it?
THanks!
|
|
|
|
|
shihuik wrote:
...i need to create a floating dialog box
I think you are referring to a modeless dialog box.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I keep having a problem with the resources in use with my Menu, they keep reverting to numerical values in the .rc file. This results in the Help file not being displayed.
Also the ICON is not displayed either.
Has anyone seen this problem:-
<br />
IDM_MAINFRAME MENUEX <br />
BEGIN<br />
POPUP "&File", 65535,MFT_STRING,MFS_ENABLED<br />
BEGIN<br />
MENUITEM "&New Project", 32776,MFT_STRING,MFS_ENABLED<br />
MENUITEM "&Load Project", 32777,MFT_STRING,MFS_ENABLED<br />
MENUITEM "&Save Project", 32778,MFT_STRING,MFS_ENABLED<br />
MENUITEM "Save Project &As ...", 32779,MFT_STRING,MFS_ENABLED<br />
MENUITEM "Recent Files", 57616,MFT_STRING,MFS_GRAYED<br />
MENUITEM "E&xit", 32787,MFT_STRING,MFS_ENABLED<br />
END<br />
POPUP "&System", 65535,MFT_STRING,MFS_ENABLED<br />
BEGIN<br />
MENUITEM "Diagnostics", 32784,MFT_STRING,MFS_ENABLED<br />
END<br />
POPUP "S&cripts", 65535,MFT_STRING,MFS_ENABLED<br />
BEGIN<br />
MENUITEM "Run Scripts", 32786,MFT_STRING,MFS_ENABLED<br />
MENUITEM "View Logs", 22,MFT_STRING,MFS_ENABLED<br />
END<br />
POPUP "Test GUIs", 65535,MFT_STRING,MFS_ENABLED<br />
BEGIN<br />
MENUITEM "Simulation", 102,MFT_STRING,MFS_ENABLED<br />
MENUITEM "STAGE Tracks", 103,MFT_STRING,MFS_ENABLED<br />
MENUITEM "Generic Setup", 109,MFT_STRING,MFS_ENABLED<br />
MENUITEM "CD GUI", 106,MFT_STRING,MFS_ENABLED<br />
MENUITEM "I5I GUI", 108,MFT_STRING,MFS_ENABLED<br />
END<br />
POPUP "&Recording", 65535,MFT_STRING,MFS_ENABLED<br />
BEGIN<br />
MENUITEM "Record", 107,MFT_STRING,MFS_ENABLED<br />
MENUITEM "Reply", 107,MFT_STRING,MFS_ENABLED<br />
END<br />
POPUP "&Help", 65535,MFT_STRING,MFS_ENABLED<br />
BEGIN<br />
MENUITEM "Index", 57670, <br />
MFT_STRING | MFT_RIGHTJUSTIFY,MFS_ENABLED<br />
MENUITEM "About", 32788,MFT_STRING,MFS_ENABLED<br />
END<br />
END
If I replace 57670 with ID_HELP then my Help file is displayed.
I have via the properties box reset them to there correct ICD/ID values, but then revert back. Is this an IDE bug and waht can I do.
|
|
|
|
|
Are the IDs being added to the project's resource.h file?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|