|
Thanks. I'll play around with this idea, but just one question:
If I have more than child frame open, wont the pointer 'point' to the most recently created one.
Actually forget this, I have just thought of adding the 'theApp.m_pViewX = this;' each time the child frame is selected. After all, only one can be shown at a time.
Thanks again,
David
|
|
|
|
|
I'm looking for API-functions to modify windows icons (like the startmenu icons or drives icons, ...). I'm also looking for function(s) to rebuild shell icons cache.
Please answer asap ! Help !
|
|
|
|
|
Hi,
SplitterWnd problem (Size of views !!!)
SplitterWnd-Problem in MFC-SDI-App in VC++.
What I want :
+-------------+------------+
| | |
| CTReeView ^ CFormView |
| | |
+----<---[Splitter]-->-----+
| |
| CLIstView |
| |
+--------------------------+
What I get :
The two upper views get very small. All splitters
are there, I just have to pull the middle splitter
downwards to get the View I want.
+-------------+------------+
+----<---[Splitter]-->-----+
| |
| CLIstView |
| |
+--------------------------+
This is the code I use. I have changed the size-parameter of CreateView serveral times but it did not help.
I even tried to change the size after the create. Nothing seemed to work.
Whats going wrong ?
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT , CCreateContext* pContext)
{
CRect rect;
GetClientRect(rect);
CSize sizeListView(rect.right,rect.bottom/2);
CSize sizeTreeView(rect.right/2,rect.bottom/2);
CSize sizeFormView(rect.right/2,rect.bottom/2);
if (!m_wndSplitterTopBottom.CreateStatic(this, 2, 1))
return FALSE;
if (m_wndSplitterTopBottom.CreateView( 1,
0,
RUNTIME_CLASS(CListView1),
sizeListView,
pContext)) {
if (m_wndSplitterLeftRight.CreateStatic(
&m_wndSplitterTopBottom,
1,
2,
WS_CHILD | WS_VISIBLE,
m_wndSplitterTopBottom.
IdFromRowCol(0, 0)))
{
if (m_wndSplitterLeftRight.CreateView(
0,
0,
RUNTIME_CLASS(CMyTreeView),
sizeTreeView,
pContext)
&&
m_wndSplitterLeftRight.CreateView(
0,
1,
RUNTIME_CLASS(CMyFormView),
sizeFormView,
pContext)
)
{
}
else {
m_wndSplitterLeftRight.DestroyWindow();
return FALSE;
}
}
else {
return FALSE;
}
}
else {
m_wndSplitterTopBottom.DestroyWindow();
return FALSE;
}
return TRUE;
}
Thanks
|
|
|
|
|
Hi Everyone,
I'm using Visual C++6 and have this problem and hope you can help me out!
What I'm trying to do is to read data from a TEXT FILE and plug the values into a CString, which will be used as a SQL statement.
For example, let's say I have the follwing data in a TEXT FILE:
CustomerName, ID, INTEGER, FirstName, STRING, LastName, STRING, etc...
How can I read the values from the TEXT FILE one by one so at the end, I'll come up with a statement such as:
SQL="CREATE TABLE CustomerName(ID INTEGER, FirstName STRING, LastName STRING, etc...)"
I would like to put the reading of the values from the TEXT FILE into a loop so that no matter how many FIELDS the text files contain, the loop will be able to handle it and put all the values into a SQL statment.
For example, if I have the following int the TEXT FILE:
(3 FILEDS and 3 VALUES OF THE FIELD)
CustomerName, ID, INTEGER, FirstName, STRING, LastName, STRING
I would like:
SQL="CREATE TABLE CustomerName(ID INTEGER, FirstName STRING, LastName STRING)"
BUT if I only have 1 FIELD AND VALUES:
CustomerName, ID, INTEGER
The reading of the TEXT FILE will be dynamic and the SQL would be:
SQL="CREATE TABLE CustomerName(ID INTEGER)"
Hope you can understand what I'm trying to do.
I've tried to do it in a loop myself but I had some trouble, so If anyone has any solutions, PLMK! Thanks!
Steve
|
|
|
|
|
Hi,
try this:
CString BuildSQL( const CString& sStringFromFile )
{
CString sSQL, sTemp1, sTemp2;
sSQL = _T("CREATE TABLE ");
if( AfxExtractSubString( sTemp1, sStringFromFile, 0, ',' ) )
{
sSQL += sTemp1;
sSQL += "( ";
for( int i = 1; ; i +=2 )
{
if( AfxExtractSubString( sTemp1, sStringFromFile, i, ',' ) &&
AfxExtractSubString( sTemp2, sStringFromFile, i + 1, ',' ) )
{
sSQL += sTemp1;
sSQL += sTemp2;
sSQL += _T(", ");
}
else
{
break;
}
}
sSQL.ReleaseBuffer( sSQL.GetLength() - 2 );
sSQL += _T(" )");
}
return sSQL;
}
Regards
Holger Persch
|
|
|
|
|
I want to call a windows NT service from a VC program.
Can any body tell me how can I do so?
Please guide
Thanks
Aasher
|
|
|
|
|
If "to call" means to start a service, just use
PJ Naughter's great "CNTService" classes (located in the
"System -> Services" section) to get access to NT services.
These classes will allow you to control (e.g. start, stop,
install, uninstall,...) services in any way you want.
Regards
Holger Persch
|
|
|
|
|
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
|
|
|
|
|