|
cedric moonen wrote:
Thanks for the response but I have a linker error: error LNK2001: unresolved external symbol __imp__TransparentBlt@44.
That means you are not linking to the right library for this function. Do you have VC7, or if you're using VC6, do you have a platoform SDK installed apart from the one that came with it ( you must do, otherwise you wouldn't get to the linking stage ). If the latter, perhaps your lib directory is not set up, but your include directory is.
cedric moonen wrote:
So maybe it can lead to problems if I mix CDC with HDC...
No - a CDC is just a wrapper around a HDC, they boil down to the same thing with some helper functions. TransparentBlt is not supported by W95, and VC6 did not come with TransparentBlt, etc, because they did not exist. therefore, VC6 users need to have a more recent platform SDK installed in order for the compiler to know how to call those functions. It sounds like your compiler can find the header files that define this function, but not the lib file required at linking time, therefore I think you have VC6 and a Platform SDK that is not installed properly.
And obviously, if you use TransparentBlt, your exe won't run on W95. If it needs to, I wrote a W95 compatible version of TransparentBlt and AlphaBlend years ago, it's hosted on the Windows Developer Journal site. If you google 'Graus AlphaBlend TransparentBlt', you're bound to find it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Do you have VC7, or if you're using VC6, do you have a platoform SDK installed apart from the one that came with it
That could be the problem: I'm using VC6 and I didn't install any extra SDK...
Christian Graus wrote:
If you google 'Graus AlphaBlend TransparentBlt', you're bound to find it.
Thanks, I found it, it seems interesting. I'll have a deeper look at it when I have time.
Thanks for your help
|
|
|
|
|
Search for article ExBitamp; I included a function called TransBlt in ExBitmap.cpp that works on Win31 and above (you can probably improve on it).
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
i have a a string (CString) of length 18 = "999999999999999.99" and i want to convet to a double value as 999999999999999.99 i have used the atof function but the value is getting truncated . i have tried in VC++ still the same value .
anup r nambiar
|
|
|
|
|
A double will always be an approximation. You're asking for too much precision on the left hand side, so it's rounding on the right.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
No - the problem is that the precision exceeds the 15 digit precision limit for a double.
The example had a 17 digit number (excluding the decimal point) and should be handled correctly by using a long double.
|
|
|
|
|
i have tried even that. i got the 15 digit in a int64 data type and the float value in a float type . the 2 were added in a long double type but the result was still rounded off
|
|
|
|
|
See my reply to Christian...
Doubles and long doubles are synonymous unless ... I seem to recall there is a true long (80 bit i.e. IEEE long double) library in the win32 sdk.
|
|
|
|
|
I have been reading an article about accessing USB devices via C# and the article states a GUID for a specific USB device driver. I was wondering how does one find that information for other USB device drivers.
I am the handsome one in the crowd.
|
|
|
|
|
Iam using MDI Doc - View Architecture . Iam creating MDI child windows at run time .But these child windows are not enabled for scrolling.
I did the following to enable the scroll bars.
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
cs.style = WS_CHILD|WS_OVERLAPPEDWINDOW|WS_CAPTION|WS_MINIMIZEBOX|WS_SIZEBOX|WS_VSCROLL|WS_HSCROLL;
//cs.dwExStyle = WS_EX_RIGHTSCROLLBAR;
return TRUE;
}
The first problem is that doing this causes the title of the child windows to vanish. But the scrolls are enabled.
Now the second problem is do I need to override the OnVScroll() and OnHScroll() functions to implement scrolling .If so how please let me know.
laiju
|
|
|
|
|
I'm afraid you have it around the wrong way - you obviously don't understand the DOC/VIEW architecture.
The frame (DOC) is merely a container for the view (VIEW) - so I suggest you read a little further (or back) into your class notes and see what type of VIEWS (C...View) are available.
trelliot
|
|
|
|
|
You need to add the scroll bars to your view, not to the frame.
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"
|
|
|
|
|
Along with doing this in the view and not the frame you should change the following:
cs.style = WS_CHILD|WS_OVERLAPPEDWINDOW|WS_CAPTION|WS_MINIMIZEBOX|WS_SIZEBOX|WS_VSCROLL|WS_HSCROLL;
to
cs.style |= WS_VSCROLL|WS_HSCROLL;
that way you do not have to know (nor care) what other creation flags are already set.
As for actual scrolling (w/o using CScrollView), you'll have to maintian a position indicator for the upper left hand courner (where drawing is supposed to start), then add or subtrack from that value (depending and direction of scroll). To do it right requires a bit more than that but it is a good starting position.
Good luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
how to set timeout value in programm using csocket class ?
thanks
|
|
|
|
|
What timeout do you want to set?
Don't try it, just do it!
|
|
|
|
|
[SetSocketOpt]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi,
I'm planning to develop a small doc/view MFC application that logs a lot of text. Much of the text will need to be in color. There will be a LOT of text being logged...so I'm wondering what the "line" limitations are on something like this.
Is the default "view" generated with MFC the best for something like this? Something better?
Any other tips you might have?
Thanks,
Phil
|
|
|
|
|
|
i need a system of personal affairs assistant like ATnotes,which can be used like a reminder,i need vc source badly,please help me!thanks!!!
|
|
|
|
|
I think you have this site confused with rentacoder - they write full solutions over there. Here, we help people who are trying to write their own.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Look at the sample code below, I've been seeing "far" for a while in
other sample code. Can anyone tell me what it is?
typedef struct tagPENRECORD {<br />
DWORD dwPenType;<br />
POINT PtsToDraw[NUMPOINTS];<br />
<br />
} PENRECORD, *PPENRECORD, FAR *LPPENRECORD; <br />
Thanks
|
|
|
|
|
Back with 16-bit Windows, memory was addressed as segment:offset. You had "far" memory and "near" memory. That is no longer the case with 32-bit Windows. The preprocessor redefines both near and far to empty.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks David. Could you be a little more specific about near and far? I'm interested to know the difference between them back in Win16. Does it differ in Win32 today?
Thanks
|
|
|
|
|
The near/far difference is related to real-mode memory addressing on x86 CPUs. Pointers were 16 bits but you also had a 16-bit "segment" that determined which 64K block of memory a pointer was referring to. A near pointer was just the 16-bit offset, and could only point within the same segment. A far pointer was a segment+offset together, and could hold the address of any place in memory.
In Win32 protected mode, all that goes away. A pointer is a plain 32-bit address and near/far are anachronisms now. Pointers are of course 64 bits in Win64.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
The Intel 8086 architecture used a segmented memory model, where each segment spans 64K bytes. "Near" pointers are two-byte values with an offset from a fixed segment pointer and can access only a single 64K segment. "Far" pointers are 4-byte values with a 2-byte segment pointer and a 2-byte offset and can access the lower 1 MB of memory (because the memory manager's address calculation shifts the segment pointer 4 bits before adding the offset). "Huge" pointers, which are four-byte values are actual four-byte addresses and can access any area of memory by copying through a window created by a memory manager.
In the old (20 years ago ) days, the Microsoft C compiler supported several executable targets: tiny (all code and data with in the same 64 K segment, required for COM format executables), small (code and data in separate 64 K segments), medium (far pointers for code, near pointers for data), compact (near pointers for code, far pointers for data), large (far pointers for both code and data), and huge (far pointers for code, data and static data).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|