|
Hello all,
I'm using a CMacButton that I got from http://codeguru.earthweb.com/controls/macbuttons.shtml The class doesn't automatically support transparency. However, I'm sure it can really easily because another programmer told me it could be done by commenting out the code that clears the area and draws the background. However, I couldn't figure out what to comment out. I'm new to owner drawn controls and I was wondering if someone could help. Thanks in advance.
|
|
|
|
|
Hi Trey,
I don't know the CMacButton class, but I think it's the same for all controls.
You can get a transparent control by:
- overriding OnEraseBackgnd (just return TRUE, without calling the base class implementation)
- if you have other controls below the button, adding WS_EX_TRANSPARENT to the extended style of the button (so that it is the last to be repainted)
Hope this is right, I used it with a CStatic with no problems.
Cheers,
Paolo.
|
|
|
|
|
Hi all, well I am trying to catch any keystroke (not system strokes) with the ON_CLICK_DOWN in the class wizard. It doesn't seem to be working for me though? Any suggestions on another way to do it? Or sample code?
Thanks.
p.s. I have a whole bunch of edit boxes on the CFormView that I am try to capture the text and convert it as it is typed.
|
|
|
|
|
I think it will be better to subclass an edit control and
give it the custom formatting capabilities you want. You can
handle the "WM_CHAR" message to control the edit's input.
Then use the subclassed control instead of the regular edit control in your formview.
Regards
Holger Persch
|
|
|
|
|
Guys
I don't have a toolbar image in my application. What I have is a resource file which has list of
bitmaps. These bitmaps are to be referred using their names and NOT IDs. I don't have any ids
available.
I looked at CToolBarCtrl()s AddBitmap() function. It only accepts bitmap id as an argument.
I don't know why there is no facility to specify bitmap names, especially since CBitmap's
LoadBitmap accepts image name as an argument.
Has anybody found a way out yet?
In my application, details about the toolbar button are read from a text file. One of the attributes
of button is the name of the bitmap which it uses. So there are no IDs available. While I can
write a utility to map these strings to ids, it is a huge pain. Also, I have bitmaps in excess of
2000 which need to be read in. So one can imagine.
Am I missing something here or is it just common control limitation.
Thanks
Regards
Shailesh
|
|
|
|
|
Hi,
I found that old projects containing windows or dialogs with small caption (WS_EX_TOOLWINDOW) don't display as expected on Win2000.
That is, windows with the WS_EX_TOOLWINDOW style have a small caption under Win95, but not under Win2k (the same executable, not recompiled).
At least, this is what I could see with some testing.
Does anyone know how to have small captions on Win2k?
Or is it by design?
Paolo.
|
|
|
|
|
Hi there,
I am using standard drawing routines for drawing. The same I use for printing. But each time it
comes to printing a bitmap the printer ignores it with no comment.
On standard printers there is no problem only with PostScript printers.
Thanks for help.
|
|
|
|
|
I need to be able to tell whether DHCP is enabled.
This needs to work on 95,98,NT4 and 2000.
I figured there must be registry settings for this and after digging around I've found what they are for 95 & 98.
However for NT and 2000 it's slightly different.
I believe that the registry key for NT is:
HKLM\System\CurrentControlSet\Services\"AdapterNameHere"\
Parameters\Tcpip
and the key value is "EnableDHCP".
The Adapter name is stored under
"HKLM\System\CurrentControlSet\Services\NetBT\Adapters"
so by using this I should be able to get the setting.
What I want to know is can anyone confirm this to be correct or is there an easier way?
Finally for 2000 it should be easier since I can use the "GetAdaptersInfo" function which returns information on each adapter and the information contains whether DHCP is enabled.
MSDN online says to use Iphlpapi.lib and Iphlpapi.h, does anyone know where these files come from, I presume there available within an SDK.
Thanks.
|
|
|
|
|
I need to create a UDP Packet to send to about 50 (anti-virus) Servers
simultaneously. The UDP Packet will basically act as if it is sending a
virus, which will trigger the anti-virus Server to Alarm us (at HQs). By
the notifications we receive from the servers, we will be able to determine
which Servers need immediate attention (basically the ones that didn't alert
us of the virus). This is currently being done with a batch file (sending a
dummy virus to the Servers), which takes entirely too long to run and get
the Stats! I am new at Socket programming (obviously), but do other
programming (data/file en(de)cryption, etc...).
Can anyone help me???
Dan
|
|
|
|
|
There anybody know anti-aliasing algorithm??
I want to make free-drawing application program.
and want to adopt there anti-aliasing algorithm..
to avoid jagged
How do am I??
|
|
|
|
|
The basic idea is this :
1) you calculate the percent coverage of each pixel when drawing the line.
2) you set the pixel color based on the percent coverage.
For example, if drawing a white line RGB(255,255,255) :
* if the pixel is 100 % covered, set the pixel color to RGB(255,255,255)
* if the pixel is 50 % covered, set the pixel color to RGB(127,127,127)
etc.
The hard part is step 1. The way to see what coverage means is to take a piece of graph paper - each grid cell represents a pixel. Draw a line from a start pixel to an end pixel. But the line is really a long rectangle, in which 2 of the sides are of unit length. You will see that some pixels are nearly fully covered, others on slightly covered. Unfortunately, the details of calculating these coverage values are complex. Maybe some OLD graphics text book will have more info on how to calculate the values.
What graphics package are you using ? I know that both openGL and Direct3D support antialiasing. I have not used Direct3D, but the openGL implementation is very easy to use.
|
|
|
|
|
Hi,
what is exact difference between aggragation and containment.
aggregation is 'has a' relationship between classes.
Inheritence is 'is a' relationship. is it correct?
what about containment?
thanks,
- Koteswara,
pkoti@staff.juno.com
|
|
|
|
|
As I understand it, aggregation is a form of containment where the aggregating object is dependent on, and derives its properties from, the objects it aggregates, i.e. it is the sum of its aggregate parts. In simple containment this is not the case, the container is not absolutely dependent on the objects it contains, nor are the parts dependent on the container.
There is also an implied linkage of object lifetimes in aggregation which is absent from simple containment. In aggregation, the lifetime of the aggregate object is dependent on the lifetime of the parts, but not vice-versa, unlike the otherwise similar 'composition', where the lifetime of the parts is tied to the lifetime of the composed object.
These links may be of some help:
http://pespmc1.vub.ac.be/ASC/Aggregation.html
http://ootips.org/uml-hasa.html
http://www.intellicorp.com/ooieonline/relation4.html
Dave
|
|
|
|
|
I am a new MFC programmer and I would like to know how to open and display a .tif image and get the 'matrix version' of it to do some Image processing...
Thanks to anybody who could help me,
|
|
|
|
|
You might look in
http://www.libtiff.org
There is a link for down-loading tiff library
software near the top of this page.
Near the bottom is a link "Building the software distribution" . That link has instructions for creating
the library on Windows using Visual C++.
p.s. I have code to open a bitmap file(BMP) and get the
"matrix version" of it. I use the bitmap file
as a texture in openGL.
Hope this helps.
|
|
|
|
|
Hi!
How do I create 'shapes' in VC++ 6?
Just like the ones in VisualBasic 6!
|
|
|
|
|
I developing a webbrowser using CHtmlView.
But this browser is not repaint properly.
That is, i want to use CView::Invalidate() for browser repaint.
But this function is not work.
Anybody have sample code.
Thanks in advance.
dooly
|
|
|
|
|
Hi
When I call InvalidateRect function my application
quits with error. Who can help me?
Hovo
|
|
|
|
|
I wish to make a virtual input/output port to simulate the action of a digital I/O card in the PC. Is there any way that I can "trap" the I/O operations from a Win32 application and return suitable responses to simulate an actual I/O card?
This will allow program development using the virtual I/O card until the actual card is ready for installation.
|
|
|
|
|
I really don't understand your question. You can't directly access I/O ports from Win32 applications (well, you can use a hack in 9x, but it's not portable to NT).
Generally you would write a device driver to access the ports. So, all you do is create a dummy device driver that does nothing.
|
|
|
|
|
I have a dialog box, that creates an instance of a class. This class has a CDaoDatabase and a CDaoRecordset object withen it.
Withen the class I open and close both those objects.
The first time I open this dialog box.. everything runs fine.. the SECOND time it causes an ASSERT to fail.. now upon debugging this I find the ASSERT is being caused in the CDaoWorkspace..
I've found a temporary solution to this (I think).. if I call AfxDaoInit() at the start of the class, and AfxDaoTerm() at the end.. it seems to run fine.. But I'm guessing this isn't the proper way to go about fixing this problem..
Any suggestions on how to fix this? or clues as to why this is happening?
Thanks in advanced..
|
|
|
|
|
This sounds like the problem described in
http://support.microsoft.com/support/kb/articles/Q145/9/92.asp
(knowledgebase article Q1459920)
The article offers two other 'workarounds', but you're quite right in that AfxDaoTerm is involved.
|
|
|
|
|
I haven't been using WTL before but have recently been finding more and more stuff that made me interested... But with all this new .net stuff, is there any real point in learning this or should I just wait until the release of .net and then learn the new microsoft way?
/XTSea
|
|
|
|
|
I'm trying to control an existing instance of Internet Explorer with DDE.
For example, I can change the URL, or close an existing window, but what i can't do is to retrieve the current URL.
A very small doc in msdn says that you must connect to the DEE service IExplore, with the topic name WWW_GetWindowInfo, and the item name WWW_GetWindowInfo. And it says that both an Execute or a Request should work. But it doesn't seem to work.
Can somebody send me an example of code to achieve what i said?
oh, btw, i'm not using MFC, and i'm using the DDEML library.
Gabriel Soubies, student in France
gabries.soubies@supelec.fr
|
|
|
|
|
Hi,
I successfully crea the .chm file. But i want GUI like MSDN help.
Like two panes, on clicking an item in the left pane should give its contents on
right pane.
Thanks,
- Koteswara
|
|
|
|