|
given a face colour for a windows 3d control (e.g. a button) how does one calculate the highlight and shadow colours programatically. I would like to be able to come up with the same values that windos itself callculates when using "display properties/appearance". I suspect that it will involve converting the rgb colour to hsl then doing a calc, then converting back but I need the numbers.
any ideas?
adam
|
|
|
|
|
Use GetSysColor(COLOR_3DLIGHT) or GetSysColor(COLOR_3DSHADOW). No need to perform 'manual' calculations.
|
|
|
|
|
Hi Guys !
I had the following problem !
I had a MFC Program which must start WORDPAD (for printing a Document)
how can i realise this ???
mfg
Joachim
|
|
|
|
|
Maybe ShellExecute can help you.
Grtx,
Berry
|
|
|
|
|
I have a Code which compiles well; But when I build the Exe file It gives me the following Link Errors:
***********************************************************************
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/testbug.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
testbug.exe - 2 error(s), 0 warning(s)
I have NO CLUE What is going wrong and How to Fix it................Please Help me !!
The Code of the program is as follows:
**********************************************************88
#include<iostream>
#include<fstream>
#include<string.h>
#include<stddef.h>
#include<ctype.h>
#include<utility>
// get the STL stuff
#include <vector>
#include <iterator>
// this turns off a useless compiler warning
#pragma warning(disable:4786)
// a namespace is a C++ way of hiding class names.it helps prevent name collisions in large
// projects. "using namespace std" says that you want to use classes that are in the "std" namespace.
using namespace std ;
// same thing here...
using namespace std::rel_ops ;
int main()
{
ifstream infile("in_file");
if(!infile)
{cerr<<"Error, unable to open inputfile";
return -1;
}
else { cout<<"Congrats !!";
return 0;}
};
|
|
|
|
|
See knowledge base articles Q125750 and Q131204 to help you with this problem.
Grtx,
Berry
|
|
|
|
|
Apparently your project settings are not in alignment with what you want to do.
When you created your project, you did not select "Win32 console application".
Since your program contains a main() function and does nothing windows-specific
(that is, displaying windows and stuff), your application is a console application.
Your project settings seem to be "Win32 application" or similar.
In such projects, the main entry point is a function named WinMain() and
*not* main().
Good luck anyway
|
|
|
|
|
Does somebody know how "send to tray" works ?
Like in NAPSTER: if i klick on the close ("x") button the programme doesn't close,
but it's minimized to tray ("beside the clock at the tasklist").
|
|
|
|
|
you must intercept the WM_CLOSE and hide you app instead of closing it. then use Shell_NotifyIcon to put an icon on the task bar. you should also allow some method to close your application.
adam
|
|
|
|
|
I'm trying to send the output to the printer. I found that the output on the printer is very very small..... For example, if I want to print everything on the whole screen, it will be printed on the left upper corner of the paper. Can I make it bigger and use the whole paper and change to position to Landscape?
|
|
|
|
|
What you've discovered is the difference between the DPI of your screen, and the DPI of your printer. Your screen is measured in pixels, but a printer is measured in TWIPS, which are some fraction of an inch ( I forget, but basically - there small ).
The whole print framework is too complex for me to cover thoroughly, I'd suggest you look in the main site under printing, there are a number of articles there that will get you going.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
What you've discovered is the difference between the DPI of your screen, and the DPI of your printer. Your screen is measured in pixels, but a printer is measured in TWIPS, which are some fraction of an inch ( I forget, but basically - there small ).
The whole print framework is too complex for me to cover thoroughly, I'd suggest you look in the main site under printing, there are a number of articles there that will get you going.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
1 twip = 1/1440 inch
1 pixel on avg = 1/72 inch
your output will be approx 20 times too small
look at the device context mapping modes you are using
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
go to www.maxcode.com
and then go to visual c++ toturials
you find free e-book abou visual c++6
and you find whole chapter about Printing and you find the answer
about your question...
AHMAD ALWASHALI
|
|
|
|
|
I have an application which can have its documents OLE embedded in other apps (Word/Excel etc). I'd like to know at the startup of my application if the application
has been started purely to serve the document to Word/Excel/whatever. The
startupInfo->b_runningEmbedded flag is always zero, so is not reliable.
I haven't got a document open at this time, so I can't call IsEmbedded() on the
COleWhateverDoc object that represents the documents.
CWinApp::IsEmbedded() has been deprecated in the documentation so I don't wish to use
that.
Any ideas?
Thanks
Stephen Kellett
|
|
|
|
|
I am trying to write an out of process com server that is capable of passing back to the client over the network a _ConnectionPtr. It is really a simple 2-tier application. But although the pointer I am getting back looks valid I get an error when I try and open a recordset using the connection returned.
Can anybody help.
I can post some sample code if that would help.
Cheers
AndyC
|
|
|
|
|
Hi all,
could someone please tell me how to do drawing on a dialog when the user presses a button. (for example draw a sine-wave or something)...
i'd be really grateful for a detailed example, on howto get the dc, and do the drawing stuff...i did not see through the examples on this page so please help me
|
|
|
|
|
when the user presses the button, call InvalidateRect(rect, TRUE) where rect is the place where your sine wave will be drawn.
then, in the dialog's OnPaint function, draw the sine wave in that rect. use the DC that OnPaint uses.
for drawing stuff, you'll need a brush (if you want to draw a background color) and a pen (to draw the wave).
CBrush myBrush;
myBrush.CreateSolidBrush(RGB(128,128,128));
CBrush *pOldBrush = dc.SelectObject(&myBrush);
dc.Rectangle(rect);
dc.SelectObject(pOldBrush);
myBrush.DeleteObject();
CPen myPen;
myPen.CreatePen(PS_SOLID, 1, RGB(0,0,0));
CPen *pOldPen = dc.SelectObject(&myPen);
dc.MoveTo(rect.left, rect.top);
dc.LineTo(rect.right, rect.bottom);
dc.LineTo(rect.right/2, rect.top);
dc.SelectObject(pOldPen);
myPen.DeleteObject();
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Well somehow it doesnt work, some strange page fault error occurs...
Can you please send me an example , where a simple line is drawn into a dialog ? or perhaps even in a static control... my email adress is : kixxass@gmx.net
|
|
|
|
|
well now the drawing stuff works, but not wenn i press the button, its drawed right at startup... at least i see that when i press the btn, the rect is redrawn.. where exactly do i have to put that stuff in the OnPaint ? into that part with IsIconic() ??? help me plz
|
|
|
|
|
Can anyone tell me where a good resource on InstallShield fo VC++ 6 is. The help files and me apparently don't get along. I'm looking for a good tutorial.
Thanks.
|
|
|
|
|
The website has a knowledge base and some forums, from memory. I migrated to Setup Factory ages ago.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Yea, but the knowledge base and me didn't get along either. I don't really know what to look for, hence I need a tutorial. But thx though...
|
|
|
|
|
Does anyone know of an add-in which will let me show line numbers on the left of the source lines in Visual Studio? It would help for debugging bison parsers.
Thanks,
Chris
|
|
|
|
|