|
|
|
|
Hi
I am new to vc++. I want to know what is "resources" in vc++ context.
how can this be used with vc++ program I create.
waiting for reply
|
|
|
|
|
You know I am not sure, there is so many meanings that it boarders on the ridiculous.
1) Windows programming: memory, icons, bitmap, dialog boxes, I/0, and strings.
2) C++: memory, I/O.
Oh, 1 applies to Mac programming too.
A resource is anything that you must draw on to accomplish the goal, including dependency on outside resources such as the Web.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
In a Visual C++ program, visual elements in your program (menus, dialog boxes, bitmaps, icons, and some strings) are defined in a source file with the extension .RC, which is referred to as a resource script. This file is compiled and 'linked' into your program. The term "resources" refers to these visual elements.
Software Zen: delete this;
|
|
|
|
|
the DC functions: Ellipse, Rectangle ... are filled by current brush.
I hope they are draw only without been filled.
any idea to do this?
|
|
|
|
|
You can use from Graphic like this
<br />
SolidBrush Brush(Color(255,0,120,120));<br />
Pen pen(&Brush, 4.0f);<br />
Graphics graphics(GetDC()->m_hDC) ;<br />
graphics.DrawEllipse(&pen,100,100,200,200);<br />
whitesky
|
|
|
|
|
|
Can you be more specific
and you need to using namespace Gdiplus;
whitesky
|
|
|
|
|
|
I have vs2003 and you can see MSDN for Graphics
whitesky
|
|
|
|
|
I seen the reference to ‘graphics’ and understand we are at a crossroads between systems of programming for windows. That being said ignore it and select a NULL brush before drawing the ellipse.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi John R. Shaw,
you said that create null brush before draw ellipse in CDC
but in graphics if you run this code you see a ellipse with one stroke
whitesky
|
|
|
|
|
we target to win95/98 and use VC6.
NULL brush, I tried it before in this way:
CBrush*pb=0;
dc.SelectObject(pb);
but the select is ignored (previous brush is still working).
any comment about null brush?
|
|
|
|
|
That's not what he meant by null brush.
dc.SelectObject(GetStockObject(NULL_BRUSH));
|
|
|
|
|
Thanks hfry, I have been away and you and others pointed out what I was saying.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
|
how to select a null brush?
|
|
|
|
|
<br />
CPaintDC dc(this);
dc.SelectObject((HBRUSH)GetStockObject(NULL_BRUSH));<br />
dc.Ellipse(100,100,200,200);<br />
<br />
whitesky
|
|
|
|
|
thx.
it works fine on screen - hope the same for printer.
|
|
|
|
|
My project was been written in VS 6, when I build it in VS 8 :
error C2872:'unary_function' ambiguous symbol.
How can I resolve this problem?
Thanks forward...
Petro
|
|
|
|
|
As a first step I would suggest googling on the topic "Breaking changes in Visual C++" and see what turns up. Between version 6 and 8 MS have increased C++ standards compliance, so some older code may well be broken.
Kevin
|
|
|
|
|
Hi,
Having a little trouble with FindFirst File function.... heres what ive got...
include "stdafx.h"
#include <string>
#include <direct.h>
//#include "dirent.h"
#include <winsock2.h>
#include <fstream>
#include <vector>
#include <iostream>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <sys/stat.h>
#include <stdio.h>
#pragma comment(lib,"ws2_32")
using namespace std;
// Stuff.......
char fileFound[256];
strcpy(fileFound, path1);
WIN32_FIND_DATA FindFileData;
HANDLE hp;
hp = FindFirstFile(fileFound, &FindFileData);
printf ("The first file found is %s\n", FindFileData.cFileName);
FindClose(hp);
The error i recieve is...
error C2664: 'FindFirstFileW' : cannot convert parameter 1 from 'char [256]' to 'LPCWSTR'
I know sometimes when compiling the error is not always what it seeems.. but have no idea..
Please help.
TIA
-- modified at 7:45 Saturday 3rd June, 2006
|
|
|
|
|
can you tell me what type of application are you working on?
MFC , Console or On something else because I tried executing your code in MFC application and apart from a very minor change I was able to get the result.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|