|
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
|
|
|
|
|
Thanks for your interest.
Yes the ID are being added to the resource.h file.
Note ID_HELP is not present in the resouce, I assume that is part of the general envoronment. But the others associated say with the Save File Menu option etc are present. The numbers correspond to there IDC/IDs.
Note also if I replace the numbers with the resources (via properties window), they revert back to numbers again.
Is this an IDE bug or is something screwed up within the project.
Sweep
|
|
|
|
|
sweep123 wrote:
Is this an IDE bug or is something screwed up within the project.
It's definitely not normal behavior. Does it happen with all of your projects, or just one in particular? Have you tried deleting the project's temporary files (e.g., .ncb, .opt, .aps, .clw)?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Its just this project. I did try what you suggested and also I replaced the numbers with the ID/IDC's. I even tried to replace the ID/IDC's in both the properties box and in the <progam>.rc file also for a few items, as the numbers are in this file also.
But still they revert back to numbers.
Are they anything that can be done to corrct this problem, or should I raise a call with Microsoft (I am allowed two with my support level).
|
|
|
|
|
hello,
i need to know how to determine the total cpu usage expressed in percent. Is there any function which can provide this value ? Please help me it's urgent.
Thanks in advance!
|
|
|
|
|
See my response here.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|