|
I am not sure but i think i need the numeric interpretation.
The controller is a GPIB card (16 BIT connector) - to the receiver there is an initialisation string send to as char "N00,TH0,V0123456789:;<=>?\n" changing anything here will end up in errors.
...
ah i think i can do this like :
<br />
int hex = 0x2ABCDEF;<br />
cmd[0] = ((hex & 0x0F000000)>>24)+48;<br />
cmd[1] = ((hex & 0x00F00000)>>20)+48;<br />
cmd[2] = ((hex & 0x000F0000)>>16)+48;<br />
cmd[3] = ((hex & 0x0000F000)>>12)+48;<br />
...<br />
OK i try this
THX
Timen
|
|
|
|
|
a rgn, for easy, lets say a rect (10,10,100,100)
I hope all lines drawn are inside the rect with any thickness of pen.
FrameRgn works fine for the purpose on screen, but it is so ugly on printer.
My Q:
how to ensue Polygon() draws lines inside the rect with any thickness of pen?
|
|
|
|
|
Here's some code to get the wheels turning. I used a couple of different things and meshed them together.
For what it's worth...
CPen pen;
CPen* pOldPen;
LOGBRUSH logBrush;
logBrush.lbStyle=BS_SOLID;
logBrush.lbColor=RGB(255,0,0);
logBrush.lbHatch=NULL;
if (pDC->BeginPath()) { // Start defining Path
CRect rect(0,0,150,150);
pDC->Rectangle(&rect); // Define the shape for the path
if (pDC->EndPath()) { // Finish defining path
CRgn rgn;
rgn.CreateFromPath(pDC);
if (pDC->SelectClipRgn(&rgn,RGN_COPY)) { // New clipping region
for (int i=0;i<150;i+=15) {
pen.CreatePen(PS_SOLID|PS_ENDCAP_SQUARE|PS_GEOMETRIC,(i/15),&logBrush,0,NULL);
pOldPen=pDC->SelectObject(&pen);
pDC->MoveTo(CPoint(i,150));
pDC->LineTo(CPoint(i+150,0));
pDC->SelectObject(pOldPen);
pen.DeleteObject();
}
}
}
}
|
|
|
|
|
I hope nothing to be clipped.
|
|
|
|
|
includeh10 wrote: I hope nothing to be clipped.
Your first post sounded like you wanted the lines clipped. I apologize for the misunderstanding.
|
|
|
|
|
Hi again guys
a simple guestion how can i convert(assighn) a variable of type _bstr_t to string
Thanks a lot for everything so far
|
|
|
|
|
I actually know this is simple, but I forget the answer. I would repost this question in the COM forum if I was you.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
|
Cool Guide!!!!
very good has everything
thanks for showing me the way
|
|
|
|
|
Mr. Dunn already pointed you to his FAQ which is probably the best resource available on CP but just in case, here are some ways you can get it done. NOTE: These will only work if the BSTR does not contain embedded NULL's as would occur in a BYTE array. If you are sure you are dealing with null terminated strings in the BSTR like when using MSXML, these will get you by.
// Using the CString constructor
_bstr_t bstrTemp("This is a test\n");
CString sTemp1((BSTR)bstrTemp);
TRACE(sTemp1);
// For when you don't have the luxury of using the constructor
CString sTemp2;
sTemp2.Format("%s",(LPCTSTR)bstrTemp);
TRACE(sTemp2);
|
|
|
|
|
Thanks bob for the help and the info but u are right
that article Dunn gave me is more than helpful
Thanks again appreciate the help
|
|
|
|
|
antonaras wrote: Hi again guys
a simple guestion how can i convert(assighn) a variable of type _bstr_t to string
_bstr_t hi("alok");
std::string str((LPCTSTR)hi) ;
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
say I have
class A
{
int a;
int b;
A(int c, int d) { a=c; b=d;}
}
and <A a=2 b=3></A> tag in Xml
how can i simply parse the xml file that i get A(2,3) in my C++ program
which technology should i use? ms xml? is it good? can someone show a short example of using ms xml to the example above?
J
-- modified at 10:25 Saturday 3rd June, 2006
|
|
|
|
|
|
|
|
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
|
|
|
|