|
You can create a pattern brush and then use that one pixel wide to generate a line.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Works great, thanks for the idea.
---
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|
Hi.
Conventionally speaking, do you declare and initialize variables at the beginning of a function or loop or right before usage.
For example:
int main()
{
char temp;
cin >> temp;
cout << "1234... & " << temp;
cin >> temp;
cout << temp;
int x;
cin >> x;
cout << temp << " & " << x;
return 0;
}
The arbitrary code above depicts declaration of variables right before usage (int x).
Which way is most convention is arguably better?
Thanks,
Kuphryn
|
|
|
|
|
|
Thanks!
As of today, I have begun to declare variable when:
1) there is something to initialize it with
int x = ...functure return, something added/subtract, etc, to other variables
2) right before its usage
int x = 3;
cout << x;
The only time I declare a variable at the top:
int x = 0;
is when it will be referenced to.
function(int &aboveX)
cout << aboveX;
So aboveX is a reference to x.
I began learning and practicing C++ about four months ago. I find something really interesting. I find that when you first learn C++ in college and reading beginner C++ books, the professor and author typically recommend declaring variables right at the top. They make it like it is imperative that we do that or the program may not work. Now, I feel that the programmer is in control of the program and that he/she can declare variables wherever is appropriate. As I mentioned, I feel it is much easier to recognize variable when the program declare them accord to the examples above.
Kuphryn
|
|
|
|
|
He folks!
I created a dialog based application and made it to a service. Not a big deal.
The service has a icon in the system tray.
If you click on the item, the dialog window pops up, so that the user can see some information about the current status of the service.
In that dialog window, i created a property sheet with two property pages in it. As fare i do NOT create that property stuff, everything works fine, but with the property stuff AND when the user loggs out, i always got a runtime error!!!!
WHY???
By the way, when i just start the service and then terminate it again, by the windows nt control manager, everything goes well, also!!??
Thanx in advance
Normen
|
|
|
|
|
He!
It's me again!
So far i found out, that the problem is neither placed in the property sheet
nor in the property pages BUT in the CListCtl, which is placed in one of my
property pages!!!!
When i take the CListCtrl out of my page, everything works fine.
So does anyone know what i shall do with that list control???
Greetings
Normen
|
|
|
|
|
- Thanks for the pals that had helped me before. Also say 'Good Luck' to the strangers.
- Hope my pals can help me next year, like before.
- Best regards,
BigMouth
|
|
|
|
|
Hello All,
Is it possible to do network programming with Standard C++ only and nothing else. I know you can do it with MFC, but is it possible with only Standard C++?
See, Java has built in networking capablities without using any third party libraries.
Quicksilver
|
|
|
|
|
You can use Winsock or regular sockets.
Todd Smith
|
|
|
|
|
Hello, the codegurus around the world.;)
When you use the standard C++ code with socket,
the code depends on OS library.
1) Windows -> WinSock or WinInet (FTP, HTTP)
2) Linux and Unix -> Berkley socket library.
3) Mac maybe has some library.
So, I don't think that we can write the socket code compatible with all OS
by C++.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Take a look at ACE library.
Unlike Java, C++ does not have network support in the standard library (which is a good decision, IMHO)
I vote pro drink
|
|
|
|
|
I am trying to set a dialog's font during WM_INITDIALOG but it is not working. E.g.
BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
HFONT hfont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
SendMessage(hwnd, WM_SETFONT, (WPARAM)hfont, (LPARAM)TRUE);
if(SendMessage(hwnd, WM_GETFONT, 0, 0) != hfont)
MessageBox(hwnd, "WTF", NULL, MB_OK);
return TRUE;
}
I know I have to send the WM_SETFONT message to the controls also (that part is working). Does anyone have any idea what's wrong?
|
|
|
|
|
You don't send WM_SETFONT messages yourself. Set the DS_SETFONT style of the dialog (you may have to edit the .RC file manually, I forget if that style is in the resource editor) and the OS will handle the WM_SETFONT stuff itself.
--Mike--
My really out-of-date homepage
"Why does anyone have a web page? Too much free time... not enough friends... justifying owning a computer." -- Noel Crane on Felicity
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
May be this will be OK for you: http://www.codeguru.com/dialog/ChangeDefaultDialogFont.shtml. I use this way in my application, it works.
|
|
|
|
|
Hi.
I am to the point where I can solve a problem using C++ "low-level" (i.e dynamic memory allocation) and "high-level" (i.e. using the string and STL container). Experienced programmers, even Stroustrup, recommend using library tools like string when possible because them are optimized.
First, what is the point of programming if almost everything is done for you and all you have to do is put the pieces together?
Under what circumstances do you prefer low-level C++ over high-level C++, and vic versa?
Hey, do not get me wrong. Based on my experience, C++ library tools (strings and STL) are unparalleled. I find using C++ library tools speeds up my programs, and they serve as the "missing" pieces to solutions to various programs especially when dealing with istream and ostream.
I fear that relying too much on C++ standard library will cause the programmer to lose sight of the big picture and begin to forget the low-level stuff. Does that happen to you? Thus, I try to implement C-Style when possible.
Kuphryn
|
|
|
|
|
Using the C++ standard library allows you to work more so on the problem, not the implimentation. You spend less time working on broiler plate code (memory management, algorithms, etc.).
I try to stay well versed in both. Always choose the best tool for the job.
|
|
|
|
|
|
I need to implement file dragging from a list control to the explorer. Is anyone able to outline what I need to do? (i.e. messages etc)
Thanks
|
|
|
|
|
|
I've an MDI app with two different html views and when I dynamicaly change content of first view, with for example:
CComPtr <IDispatch> pDisp = GetHtmlDocument();
if (pDisp)
{
CComQIPtr <IHTMLDocument2> pHtmlDoc2;
pHtmlDoc2 = pDisp;
if (pHtmlDoc2)
{
// ...
// some code here
// ...
}
}
and then I try to do something similar in second view, GetHtmlDocument() returns NULL. I don't know why? Please help.
Best regards
r2-r
|
|
|
|
|
hi- any body helps me
i want to make an application which will stop explorer popup adds.like popkiller.com noads.exe.
i am using vc++ 6 windows 2000.
Please Give an idea not code
Ibrar Ahmad
Softare Engr.
Comcept PVT LTD.
Islamabad
abrar_@yahoo.com
|
|
|
|
|
write it as an http proxy and deny the popup-ads
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I have write this but its not good for doing lot of work on small problem.It should filter entire conents so it slow down net speed.Look at popup add filetr.noadds they dont write any proxy but works fine.there size are just few k
Ibrar Ahmad
Softare Engr.
Comcept PVT LTD.
Islamabad
abrar_@yahoo.com
|
|
|
|
|
Writing a popup window killer is quite easy - write a browser helper object. IE creates an instance of all BHOs when a browser window is created. Your BHO can check the window properties, and make a judgement based on them. For instance, if there's no menu, toolbar, and status bar, chances are it's an ad window, so your BHO can close the window.
Doing good ad filtering requires a proxy so you can intercept the HTML and remove <img> tags and whatnot.
--Mike--
My really out-of-date homepage
"Why does anyone have a web page? Too much free time... not enough friends... justifying owning a computer." -- Noel Crane on Felicity
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|