Skip Navigational Links
LISTSERV email list manager
LISTSERV - COMMUNITY.LSOFT.COM
LISTSERV Menu
Log In
Log In
LISTSERV 17.5 Help - MFC Archives
LISTSERV Archives
LISTSERV Archives
Search Archives
Search Archives
Register
Register
Log In
Log In

MFC Archives

MFC -- Microsoft Foundation Classes

MFC@LISTSERV.MSN.COM

Menu
LISTSERV Archives LISTSERV Archives
MFC Home MFC Home

Log In Log In
Register Register

Subscribe or Unsubscribe Subscribe or Unsubscribe

Search Archives Search Archives
Language* NoHTML removed 20170222 NCB
Options: Use Classic View
Show Table of Contents

MFC dialog with Large Fonts settings
Shoshi Gutreich
Sun, 24 Jun 2001 19:40:10 +0200
Reply
Environment : VC++ 6.0 Windows NT4.0 ie 5.01

Hi,

I have a dialog with a bitmap on it (I have inserted it inside a static
control).
When opening this dialog on a machine with Large Fonts settings, the whole
dialog become larger, but the bitmap remains in the same size.

Do you have any idea how I can resolve this? (either make the dialog stay
small or make the bitmap enlarge).
I will appreciate any hint you may have.

[More ...]
Reply
No Replies
Fail to use CDatabase in a CGI for IIS
hiraga
Thu, 21 Jun 2001 20:05:26 +0900
Reply
Hi all,

Environment: VC++6.0, Windows NT4.0 Terminal Server Edition

I'm trying to use CDatabase in a CGI for IIS. The CGI runs perfectly from a
command line invoked by a user IUSR_HOST. But from a browser, a memory
access exception occurs in a IUSR_HOST session.

The exception seems to occur in a OpenEx(...).

Is there anyone who has a similar experience? or has solved the problem?

[More ...]
Reply
No Replies
CPropertySheet problems
Dave Aspinall
Tue, 19 Jun 2001 20:09:27 +0100
Reply
I am trying to debug some code that works fine on NT4 but crashes on win98.
When I call CPropertySheetEx::Create(), the program terminates! If I wrap the call in a try/catch(...) I see an exception is thrown , and looking at the debug output an access violation occurs in comctl32.dll. This appears to be a well known problem and is documented on MSDN (Q158552) - but it says the problem does not occur on later versions of comctl32 (4.7) which I am using (I have got latest comctl32/headers/libraries etc). The resources for the property sheet exist in a seperate resource

[More ...]
Reply
Show Replies 1 Reply
Re: CPropertySheet problems
Sef Tarbell
Fri, 22 Jun 2001 07:19:56 -0500
I am not at all sure that this is your problem, but is the boundaries
between exe and dll get kind of blurred for MFC sometimes and you have
to be very explicit when you are using resources that are stored
elsewhere. Try this

{ // the braces are necessary for scope
AFX_MANAGE_STATE(AfxGetStaticModuleState());

//your create that uses the resource goes here
}

[More ...]
R: what's the difference between disable debug and maximize spee d..
Bordignoni, Roberto
Tue, 19 Jun 2001 11:38:25 +0200
Reply
-----Messaggio originale-----
Da: Martin Bonner [mailto:[log in to unmask]]
Inviato: venerdì 26 febbraio 1999 9.39
A: [log in to unmask]
Oggetto: Re: what's the difference between disable debug and maximize
spee d..

> -----Original Message-----
> From: Richard Pickett [mailto:[log in to unmask]]
>
> The VC++ optimizing compiler should not generate buggy code
Can't argue with that!

> (I've been
> trying to tell that to the VC++ team since 4.0, but they
> think it is normal for a compiler to generate code that
> does not work!).
People have been complaining about the Microsoft C optimizer for a LOT
longer than that!

[More ...]
Reply
No Replies
<No subject>
Roy He
Tue, 19 Jun 2001 13:08:54 +0800
Reply
Environment : VC++ 6.0 Windows 2000 ie 5.0

Hello , everyone ,
i'm writing a sdi application .the view is derived from CHtmlView.
i want to save the web page showed in the view as a *.mht file . so i
overrode
the function "OnDocumentComplete" , the code was like this :

void CBrowserView::OnDocumentComplete(LPCTSTR lpszURL)
{
// TODO: Add your specialized code here and/or call the base class
VARIANT varPath;

[More ...]
Reply
No Replies
OnKeydown and CTreeList
<>
Mon, 18 Jun 2001 12:14:41 +0200
Reply
Environment: Windows 2000 SP2, VC 6.0 SP3

I have added a OnKeydown function to a CTreeList class in i dialog box. One
of the keys I want to process is the spacebar. It work fine but each time I
press the spacebar key, my machine plays a beep.

It seems like the CTreeList is searching for a node in the tree that has a
name which begin with a space. Since it can't be found, it play a beep
sound.

[More ...]
Reply
Show Replies 1 Reply
Re: OnKeydown and CTreeList
<>
Thu, 28 Jun 2001 14:05:55 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: EB034927
From: Daniel Ezri <[log in to unmask]>
Subj: RE: OnKeydown and CTreeList
Date: Sun, 24 Jun 2001 14:34:20 +0200

>I have added a OnKeydown function to a CTreeList class in i dialog box. One
>of the keys I want to process is the spacebar. It work fine but each time I
>press the spacebar key, my machine plays a beep.

[More ...]
bitmaps appear not in place
Penina Weiss
Wed, 13 Jun 2001 11:55:59 +0200
Reply
Environment: VC++ 6.0 Windows 2000

I have a dialog based application, with a picture control.
Sometimes the image I draw using "Draw" function of DIB
does not draw the picture on the right place (the CDC of the picture
control).
It is drawn somewhere else on the screen.
At OnInitDialog, I get and save a pointer to the CDC and the corresponding
CWnd.

[More ...]
Reply
Show Replies 1 Reply
Re: bitmaps appear not in place
<>
Thu, 21 Jun 2001 19:40:09 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 5D28EEC2
From: D. J. WOODWARD <[log in to unmask]>
Subj: Re: bitmaps appear not in place
Date: Fri, 15 Jun 2001 07:59:21 -0000

>I have a dialog based application, with a picture control. Sometimes the image
>I draw using "Draw" function of DIB does not draw the picture on the right
>place (the CDC of the picture control). It is drawn somewhere else on the
>screen.

[More ...]
MFC Extension DLL fails to link
Ehsan Akhgari
Mon, 11 Jun 2001 18:10:16 +0430
Reply
MSVC++ 6.0 SP5 Win2k

I have an MFC extension DLL. It was originally a class inside my EXE
app, but I decided to move it into a DLL. I have included macro at the
beginning of all my functions, and havenÂ’t touched the generated
DllMain( ) function.

At link time, I get this error:

Linking...
LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO
specification
mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined
in URLProc1.obj
mfcs42d.lib(dllmodul.obj) : error LNK2005: __pRawDllMain already defined
in URLProc1.obj
mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined
in URLProc1.obj; second definition ignored
mfcs42d.lib(dllmodul.obj) : warning LNK4006: __pRawDllMain

[More ...]
Reply
No Replies
System integrity
Antonio Rocha
Fri, 1 Jun 2001 17:11:35 +0100
Reply
Windows 2000 , Visual C++ 6.0 SP3
Hi,
I've been trying to solve some memory allocation problems in my application,
and I found that memory seems not to be the only thing that I have to worry
about.
I've tried the same application in a computer with a lot of Virtual Memory
available, and the application shuts down after opening some windows, and I
seems to happend every time I open a certain number of windows.
I tried to seek some system resources indicators to see if one of them seems
to be full, but I didn't find out what

[More ...]
Reply
No Replies
How to disable text and object selecting in CHTMLView?
Alexander Tsarfin
Thu, 31 May 2001 12:59:37 +0200
Reply
Environment: Visual C++ 6.0, Windows 2000 SP2

I'm hosting the IE browser control within a Windows application and need
to display text and objects in a browser control that cannot be selected
and highlighted. At the present time I use JavaScript to do this work.
Any MFC solution?

Thanks in advance.

Alex.
Reply
No Replies
Choosing language dependent resource in Application
Kukulies, Benno
Wed, 30 May 2001 16:58:51 +0200
Reply
Environment: VC++6.0, WinNT4.0

I have an application, that contains resources for multiple languages. The
resource, that is loaded at runtime depends on the language setting of the
OS.
E.g. when country settings are set to English(US), the english(US) resource
is loaded, when the settings are set to German, then the german resource is
loaded etc.

Question: is there a way to choose the language ( from outside ) only for
this application and also for the attached DDLs without switching the
country settings ?

[More ...]
Reply
No Replies
Modeless Property sheet woes
Steve Beckett
Fri, 25 May 2001 16:22:10 -0400
Reply
Env: VC++ 6pro Windows NT4

Hi,

IÂ’m using VC++ 6 pro and have a large project that useÂ’s a property sheet
that is derived from CpropertySheet. This property sheet is displayed
modeless with the Ok, apply and cancel buttons displayed (using the
m_bModeless flag within OnInitDialog).

The problem is when I click any of the buttons nothing happens. IÂ’ve
overridden the appropriate event handlers for the above three buttons, IÂ’ve
even overridden the OnNotify handler to try and trap the messages there but
this is not working either (this handler never receives focus).

[More ...]
Reply
Show Replies 3 Replies
Re: Modeless Property sheet woes
Daniel Ezri
Wed, 30 May 2001 09:38:07 +0200
I had a similiar problem in my Property page...the buttons could not receive
mouse messages.
my problem was...i created the pages sending them the wrong parent(instead
the prop sheet ...i sent the appl dialog).
Check your "parent" to the prop page.
Hope it helps.

-----Original Message-----
From: Steve Beckett [mailto:[log in to unmask]]
Sent: Friday, May 25, 2001 10:22 PM
To: [log in to unmask]
Subject: Modeless Property sheet woes

[More ...]
Re: Modeless Property sheet woes
Jing Li
Mon, 11 Jun 2001 16:21:25 -0400
For Modeless property sheet, you need use Create function to display it
other than
DoModal function.

Jing

-----Original Message-----
From: Steve Beckett [mailto:[log in to unmask]]
Sent: Friday, May 25, 2001 4:22 PM
To: [log in to unmask]
Subject: Modeless Property sheet woes

Env: VC++ 6pro Windows NT4

Hi,

I'm using VC++ 6 pro and have a large project that use's a property sheet
that is derived from CpropertySheet. This property sheet is displayed
modeless with the Ok, apply and cancel buttons displayed (using the
m_bModeless flag within OnInitDialog).

[More ...]
Re: Modeless Property sheet woes
D. J. Woodward
Fri, 15 Jun 2001 07:59:21 -0000
On 25 May 01, at 16:22, Steve Beckett wrote:

> Env: VC++ 6pro Windows NT4
> IÂ’m using VC++ 6 pro and have a large project that useÂ’s a property sheet
> that is derived from CpropertySheet. This property sheet is displayed
> modeless with the Ok, apply and cancel buttons displayed (using the
> m_bModeless flag within OnInitDialog).

[More ...]
Static-library resources
Jeff Yates
Thu, 24 May 2001 17:26:48 +0100
Reply
Hi all,

VC++ 6 SP5, W98SE

I have a project that is a static library. It has an rc file. I have
another project that is a dll. it links to the static library and wishes to
use the static libraries resources. What do I do to get this working? I've
tried including the rc file in the rc2 of the dll project but although I
have got this compiling, the resources are not found so I end up without
bitmaps and strings. There are no clashes of resource IDs.

[More ...]
Reply
Show Replies 1 Reply
Re: Static-library resources
Andy Metcalfe
Wed, 30 May 2001 09:21:22 +0100
Jeff,
The implementation you're describing should work. If it appears not to
be working, I'd first try opening the compiled DLL itself in DevStudio for
resource editing, and see if your static library's resources are there.

If they are, they're not being loaded correctly at runtime. If the DLL is a
regular DLL it could be that it's trying to load the resources from the
wrong module. Adding an AFX_MANAGE_STATE(AfxGetStaticModuleState( ))
call to each exported function should cure that . If it's an extension DLL that shouldn't happen..

[More ...]
How to debug a CGI application
Ehsan Akhgari
Sun, 20 May 2001 19:30:32 +0430
Reply
My problem is I have a CGI application, and I cannot find anyway to
debug it. I have tried using all the ways I know of, but no use. Does
anyone know how should I debug a CGI application?

I am working with MSVC++ 6 SP5 and IIS 5 on a Win2K box. I am using MFC
in my application.

[More ...]
Reply
Show Replies 2 Replies
Re: How to debug a CGI application
<>
Tue, 29 May 2001 16:45:30 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: B5764637
From: PEDRO CORRAL <[log in to unmask]>
Subj: RE: How to debug a CGI application
Date: Tue, 22 May 2001 20:49:25 +0200

>My problem is I have a CGI application, and I cannot find anyway to debug it.

There is a little tricky. You must run the cgi in the same machine you have
your project. So you must have your web server in the same machine. Add as the
first line of your program “Sleep(10000);” and then you can attached the MSVC
to the cgi program while it is running. Put a break after

[More ...]
Re: How to debug a CGI application
Bradford Bruce
Thu, 31 May 2001 20:22:13 -0400
Check out http://support.microsoft.com/support/kb/articles/Q58/6/67.asp

1. Create a CGI program that writes all input to a file. This file will be
used for debugging in the next step

2. Add a few lines to the beginning of your code (this sample uses POST)
_putenv("CONTENT_TYPE=multipart/form-data");
_putenv("CONTENT_LENGTH=10421");
_putenv("REQUEST_METHOD=POST");

FILE *stream ;

stream = freopen(StdInFileName, "r", stdin);
stream = freopen(StdOutFileName, "w", stdout);

3. and a few at the end

[More ...]
Makehelp not working
Steve White
Fri, 18 May 2001 11:29:02 -0400
Reply
VC++ 6 Win2000

For some reason my MFC app has stopped executing my makehelp.bat file even
after changes have been made. Where in the Project settings is the command
to execute the makehelp.bat file?

Thanks

Steve White
www.VirtualMechanics.com
www.DHTMLMagic.com
www.SVGMagic.com
www.IMSWebTips.com
Reply
Show Replies 3 Replies
Re: Makehelp not working
<>
Mon, 21 May 2001 08:57:26 +0200
My problem is that I'm not able/have not found the way to add new rtf-files
to the projects. makehelp.bat file is only executed when one or both of the
standard help files are modified.

Could this be your problem?

---
Jørn Yngve Dahl-Stamnes
EDB Teamco, Trondheim
[log in to unmask]

> -----Original Message-----
> From: Steve White [mailto:[log in to unmask]]
> Sent: 18. mai 2001 17:29
> To: [log in to unmask]
> Subject: Makehelp not working
>
>
> VC++ 6 Win2000
>
> For some reason my MFC app has stopped executing my
> makehelp.bat file even
> after changes have been made. Where in the

[More ...]
Re: Makehelp not working
Steve White
Wed, 23 May 2001 14:28:16 -0400
I am aware of that. You should be able to make a minor change to AfxCore.rtf
to flag that the help files are rebuilt. But that is no longer happening in
my project. You can also rebuild the project directly (and add additional
RTF files) through Help Workshop which is part of the VC++ install. My
problem is that although the help files get rebuilt and linked, the topic
ID's for new resources are not being added so that context help for them
does not work. I suspect I can add the ID's myself but I don't have time to


[More ...]
Re: Makehelp not working
Seva Kaplunenko
Tue, 12 Jun 2001 13:17:57 -0700
There are two problems.
1. Automatic call for makehelp.bat after the rtf change
2. Adding new resources to help file.

A2. You have probably missed or corrupted makehelp.bat file. The simplest
(but not the best) way is to rename you folder with the project, and rename
makehelp.bat file there. Create new project with the same name and copy
makehelp.bat file to the old folder. Review your newproject.dsp file and
compare with the oldproject.dsp file. It will tell you if you have missed
link to makehelp.bat file. Delete new folder and rename the old one. The
better way is editing your

[More ...]
STL "Map" Object Member in a Class
Adams, Dick
Tue, 15 May 2001 10:35:06 -0500
Reply
Environment: VC++ 6.0, Win 95

I can't get a clean compile for a class with an STL "map" member. I used
the sample from the MSDN library as a model, but can't get it to work. The
sample program, when built by itself, compiles cleanly, but only if I don't
use #include stdafx.h. But when I try NOT including stdafx.h in my real
project, the compiler bombs because it can't find the precompiled header
directive.

[More ...]
Reply
No Replies
CSocket blocking problem
Kumar, Ashok (i-Deal)
Tue, 8 May 2001 17:30:33 -0400
Reply
Env: NT 4.0, SP6a, VC++6.0 SP5

Hi All,

I have an application which uses CSocket. I use the Receive(...) method to read from the socket,which is blocking. So my main thread waits till the read is completed.
I want to cancel the read operation if it has to wait for more than 5 seconds.

[More ...]
Reply
Show Replies 1 Reply
Re: CSocket blocking problem
<>
Thu, 17 May 2001 11:00:16 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: B400E91A
From: BRIAN HART <[log in to unmask]>
Subj: RE: CSocket blocking problem
Date: Mon, 14 May 2001 22:42:37 -0500

>I have an application which uses CSocket. I use the Receive(...) method to
>read from the socket,which is blocking. So my main thread waits till the read
>is completed. I want to cancel the read operation if it has to wait for more
>than 5 seconds.

[More ...]
Multiple inheritance
Srinivas S
Thu, 3 May 2001 15:39:00 +0530
Reply
VC 6.0 - WinNT 4.0

I want to have a class which is inheriting from CWinThread and CSocket.
This represents a connection to the server from a client in a separate
thread, and this class implements the protocol this connection observes.

Code looks like this...........

class CProtocol : public virtual CSocket, public virtual CWinThread
{
public:

CProtocol();
Reply
Show Replies 1 Reply
Re: Multiple inheritance
<>
Mon, 14 May 2001 14:11:55 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 7523D17B
From: ROBERTS, BRIAN M <[log in to unmask]>
Subj: RE: Multiple inheritance
Date: Fri, 4 May 2001 07:12:41 -0500

>I want to have a class which is inheriting from CWinThread and CSocket.

Short answer: Multiple inheritance with MFC classes is not worth the headache.
Use a CSocket member variable or some other method instead. Long answer: See
"TN016: Using C++ Multiple Inheritance with MFC" to get started. If you're
used to Java interfaces, forget all that when using MFC - the MFC class
structure just isn't designed that way.

[More ...]
Render Filter
Penina Weiss
Wed, 2 May 2001 16:03:29 +0200
Reply
Environment:
VC++ 6.0, Windows 98.

Hi,

I need to get a video stream frame by frame. (from capture)
The filters available, can only write the stream to a file
or present it on the screen (preview).

I wrote a render filter (derives from CBaseRenderer), in order
to get a hold of the IMediaSample interface.
(through the DoRenderSample function in the filter).

[More ...]
Reply
No Replies
What This?
Chris Green
Tue, 1 May 2001 12:02:38 -0700
Reply
Environment: Win NT4.0 VC++ 6.0

Noticed a strange MFC bug yesterday. Took me about 4 hours to figure this
one out. I have a property sheet application. Its really a tray program
with a property sheet as the only GUI for changing options. I create the
propetysheet in the cwinapp myself so that it isn't shown until my tray icon
is double-clicked. I had the all the defaults except WS_VISIBLE and then
added WS_MINIMIZEBOX. The contextual help "?" icon was there, but couldn't
be depressed. I knew all my code was good, even Shift-F1 worked. It drove
me crazy and

[More ...]
Reply
No Replies
2 questions, LPT port and close button
Ruben Jönsson
Mon, 30 Apr 2001 23:19:43 +0200
Reply
VC++ 6. Win98

Question 1.
What is the proper way to set and read individual bits int the LPT
port from a Windows program using MFC?

I have tried some DLLs that does some magic (for me anyway) to let me
directly access IO addresses in the hardware at a low level. This
works fine for real ports but doesn't work for USB connected ports,
even though I can find an address for it in the properties for the
LPT device (and at location 0:408 from a DOS window).

[More ...]
Reply
Show Replies 1 Reply
Re: 2 questions, LPT port and close button
<>
Mon, 14 May 2001 14:11:59 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 8C12633C
From: ROBERTS, BRIAN M <[log in to unmask]>
Subj: RE: 2 questions, LPT port and close button
Date: Fri, 4 May 2001 07:38:20 -0500

>What is the proper way to set and read individual bits int the LPT port from a
>Windows program using MFC?
>
>Is it possible to remove the top right close button from my MainFrame window
>without also removing the resizing buttons (as by removing the WS_SYSMENU
>style in PreCreateWindow())?

[More ...]
Printing multiple pages.
Vishal S
Sun, 29 Apr 2001 11:43:27 +0530
Reply
Environment: Win NT4.0 VC++ 6.0

I have sn SDI application where I want to print items from a list such that
each item in the list along with its details gets printed on a
different page.

In the function of MylstView class, I am setting the number of pages to be
printed = the number of items in the list

[More ...]
Reply
No Replies
AfxCreateDC causes access violation in empty MDI app
D. J. Woodward
Sat, 28 Apr 2001 22:10:21 +0100
Reply
Environment: NT4.0 SP6a, VC++5.0

Running a virgin MFC MDI app (no user code) through the debugger
(F5) causes access violation during AfxCreateDC() if HP Deskjet
950C is the default printer.

Execution stops with user breakpoint called from code at
0x77f762e8.

No interruption occurs if the debug version is run outside the
debugger.

Changing the default printer to Cannon BJ-230 does not cause the
problem.

[More ...]
Reply
Show Replies 1 Reply
Re: AfxCreateDC causes access violation in empty MDI app
D. J. Woodward
Mon, 30 Apr 2001 05:04:35 +0100
On 28 Apr 01, at 22:10, D. J. Woodward wrote:

> Environment: NT4.0 SP6a, VC++5.0
>
> Running a virgin MFC MDI app (no user code) through the debugger
> (F5) causes access violation during AfxCreateDC() if HP Deskjet
> 950C is the default printer.
>
> Execution stops with user breakpoint called from code at
> 0x77f762e8.
>
> No interruption occurs if the debug version is run outside the
> debugger.
>
> Changing the default printer to Cannon BJ-230 does not cause the
> problem.
>
> Call stack and debug output attached.
> Any comments/clues appreciated.


[More ...]
Dockable menubar
Ehsan Akhgari
Sat, 28 Apr 2001 10:18:14 +0430
Reply
Environment: Visual C++ 6.0 Enterprise Ed. SP5, Windows 2000 Professional
SP1

Does anyone there know any way to make a menubar dockable in MFC way, or any
other? Or, maybe someone has some piece of code || some places on the web,
that has done it.

Thanks in advance

Ehsan Akhgari

Email: [log in to unmask]
[log in to unmask]
http://www.rooz.net/
http://www.BeginThread.com/Contributors/ehsan/
Reply
Show Replies 1 Reply
Re: Dockable menubar
<>
Thu, 3 May 2001 17:32:31 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 9F272802
From: LUIS ABREU <[log in to unmask]>
Subj: RE: Dockable menubar
Date: Mon, 30 Apr 2001 11:13:57 +0100

>Does anyone there know any way to make a menubar dockable in MFC way,

www.codeguru.com

===== Digest Separator =====

Mesg: F56ABDEF
From: Anastas Ilchev <[log in to unmask]>
Subj: Re: Dockable menubar
Date: Wed, 02 May 2001 14:06:07 +0300

Look in http://codeguru.earthweb.com/menu/dockmenubar.shtml
http://codeguru.earthweb.com/menu/offMenu.shtml
http://codeguru.earthweb.com/toolbar/VCMenu.shtml

===== Digest Separator =====

[More ...]
Weird Problem... does any one know why ???
Arjun Prabhu K
Tue, 24 Apr 2001 22:41:46 +0530
Reply
hi there,

Well, this particular problem is bugging me for some time now..
ok..
Win98 ; VC 6;

I am developing a Dialog Based Application, which has a Tab Control,( using
property Sheet)
and a Tree Control in each of the tabs.

Now, the problem is, the program HANGS when I Minimize the Window..... Ok..
here is the Main Problem.
The program DOES NOT HANG if I select One of the Tab (first one) and then
minimize.
BUT, IT HANGS, if I click on the Tree Control, and then minimize.

[More ...]
Reply
No Replies
PreTranslateMessage and Tooltips
Fotios
Tue, 24 Apr 2001 12:02:40 +0100
Reply
Env: Win2K SP1, VC++ 6.0

Hi list!

I have the following problem: when I override PreTranslateMessage() (in
order to pre-process keystrokes) in my dialog based app, my tooltips stop
working. Other than that, everything works fine (i.e. the keystroke are
caught and processed the way they are supposed to, etc.)

I suppose that this is because the tooltip notifications are also caught by
the PreTranslateMessage() function and then for some reason they are not
forwarded to the system. Maybe it is because the function is fed an MSG
structure and not an NMHDR? If this is the case how can

[More ...]
Reply
Show Replies 1 Reply
Re: PreTranslateMessage and Tooltips
<>
Thu, 26 Apr 2001 11:11:32 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: E3755EB3
From: Phil Daley <[log in to unmask]>
Subj: Re: PreTranslateMessage and Tooltips
Date: Tue, 24 Apr 2001 13:21:44 -0400

>When I override PreTranslateMessage() (in order to pre-process keystrokes) in
>my dialog based app, my tooltips stop working.

I don't see any call to the base class.

===== Digest Separator =====

Mesg: DC30E34E
From: CHASE THOMAS <[log in to unmask]>
Subj: RE: PreTranslateMessage and Tooltips
Date: Tue, 24 Apr 2001 12:46:27 -0500

[More ...]
How to Eject Page???
Feroz
Mon, 23 Apr 2001 04:28:01 -0700
Reply
Env : WinNT4, VC++(6.0), SP4

Hi Dear List,

I have couple of 100 lines to be printed from the
default printer. My problem is I am not getting how to
eject the page after every 70 lines. I tried to use
StartPage() and EndPage().

Can anyone please give a code to automatically eject
the page.

TIA,
Feroz
Reply
Show Replies 1 Reply
Re: How to Eject Page???
Mike Wahler
Tue, 24 Apr 2001 09:30:13 -0700
> -----Original Message-----
> From: MFC -- Microsoft Foundation Classes
> [mailto:[log in to unmask]]On Behalf Of Feroz
> Sent: Monday, April 23, 2001 4:28 AM
> To: [log in to unmask]
> Subject: How to Eject Page???
>
>
> Env : WinNT4, VC++(6.0), SP4
>
> Hi Dear List,
>
> I have couple of 100 lines to be printed from the
> default printer. My problem is I am not getting how to
> eject the page after every 70 lines. I tried to use
> StartPage() and EndPage().
>
> Can anyone please give a code to automatically eject
> the page.

[More ...]
Help needed regarding Views resident in DLLS, is it possible to N OT use Extension DLLS
Andy Hitchins
Mon, 23 Apr 2001 10:42:58 +0100
Reply
VC 6
NT 4/Win 2000
MFC

Dear all,

I am part of team developing a modular application where optional
functionality is provided by means of DLLS. Each module has the ability to
install itself into the application framework. Most modules create CView
derivatives in order to display user information.

Up to now we have used "extension" DLLs as MFC does not allow the
installation of a CView into the application framework from a non-extension
DLL, (all sorts of ASSERTS when we tried). This has been ok up to now but
the need to band our resources is becoming a project

[More ...]
Reply
No Replies
Sending messages to an OCX
Jean Lavoie
Thu, 19 Apr 2001 12:48:09 -0400
Reply
Env.: VC++ 6 SP4, NT4, Win2K

Hi all,

I have a dialog hosting a custom OCX. I want to route a message captured by
the dialog to the OCX. How can I do it since all I have is the wrapper
class generated by the Components and Controls Gallery. Calling
SendMessage() on that CWnd derived class does nothing. Maybe I could be able
to do something with COleControlContainer and/or COleControlSite but it
looks like a dangerous path to me since these classes are undocumented and a
bit intimidating. Does anyone has an idea?

[More ...]
Reply
No Replies
Unable to Register the component
senthil kumar
Wed, 18 Apr 2001 18:12:57 -0700
Reply
Hello All

Env : VC++ 6.0, NT-SP4, ATL

Using ATL wizard I am creating the Component(DLL).
While adding the new class and trying to compile the
program i am getting the following error.

"RegSvr32: DllRegisterServer in .\Debug\Test.dll
failed.
Return code was: 0x80040154"

I went to error lookup and observed that "It gives
UnSpecified error". So I am bit confused, this is not
happening all the NT workstations. Some of them have
this kind of problem. What could be reason for this.

[More ...]
Reply
Show Replies 1 Reply
Re: Unable to Register the component
<>
Fri, 20 Apr 2001 17:00:27 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: AD2F950D
From: NAGI HANNA NAHAS <[log in to unmask]>
Subj: Re: Unable to Register the component
Date: Thu, 19 Apr 2001 15:50:41 +0200

>Using ATL wizard I am creating the Component(DLL). While adding the new class
>and trying to compile the program i am getting the following error.
>
>"RegSvr32: DllRegisterServer in .\Debug\Test.dll failed. Return code was:
>0x80040154"
>
>I went to error lookup and observed that "It gives UnSpecified error". So I am
>bit confused, this is not happening all the NT workstations. Some of them have
>this kind of problem. What could be reason

[More ...]
Amazing finding!!!!
Nish
Wed, 18 Apr 2001 12:03:59 +0530
Reply
Env : Windows 98 SE, VC++(6.0)/SP6

Hello again

This is an add-onto my previous mail titled "Regarding the attaching of a
CView derived view to a frame window".

I changed my configuration to release and the assertion error vanished!
Means now everything works out fine.

I am kinda unsatisfied with this situation.
Of course I could go on with my work but at the back of my mind I have this
feeling things are not all that well. I mean if it works under release mode
but asserts under debug mode something's awefully wrong.

[More ...]
Reply
Show Replies 1 Reply
Re: Amazing finding!!!!
<>
Fri, 20 Apr 2001 17:00:21 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 4864380C
From: CURTIS MCKIM <[log in to unmask]>
Subj: RE: Amazing finding!!!!
Date: Wed, 18 Apr 2001 23:43:21 -0400

>I changed my configuration to release and the assertion error vanished! Means
>now everything works out fine.

ASSERTs only execute in Debug builds. The problem that the ASSERT is checking
for is likely still there. The point of ASSERTs is to allow you to find and
fix problems when testing debug versions before you go to release and the
problem becomes hard to repeat/fix. You should continue to try to find the
source of the Assertion.

[More ...]
Regarding the attaching of a CView derived view to a frame window
Nish
Wed, 18 Apr 2001 09:14:04 +0530
Reply
Env : Windows 98 SE, VC++(6.0)/SP6

I am writing a program in which I require to have a window to which I need
to add a previously unknown number of controls (edit boxes, combos etc.).
Initially I thought I'd use a dialog box and then manually add the controls
to it. But the problem is that if the number of controls is more than a
certain limit I'll need to add scrolling features. Of course I could do this
easily by trapping the vertical scroll bar messages.

[More ...]
Reply
No Replies
Scrolling Listbox
Feroz
Mon, 16 Apr 2001 22:32:14 -0700
Reply
Env : WinNT 4, VC++(6.0), SP6

Hi Dear List,
I have a ListBox to which a Horizontal Scrollbar is
attached. I have a timer which fills the List with the
Current time after every second.

1#> I want the Scrollbar to move to downword when I
show the text on the window AUTOMATICALLY.

2#> I want the Window to be updated AUTOMATICALLY to
show the last text added.
Reply
Show Replies 2 Replies
Re: Scrolling Listbox
<>
Wed, 18 Apr 2001 19:42:55 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 614CC1B3
From: Gabriel Murillo <[log in to unmask]>
Subj: Re: Scrolling Listbox
Date: Tue, 17 Apr 2001 15:48:08 -0700 (PDT)

>I have a ListBox to which a Horizontal Scrollbar is attached. I have a timer
>which fills the List with the Current time after every second.
>1#> I want the Scrollbar to move to downword when I show the text on the
>window AUTOMATICALLY.
>2#> I want the Window to be updated AUTOMATICALLY to show the last text added.

[More ...]
Re: Scrolling Listbox
James Paul
Thu, 19 Apr 2001 10:13:59 +0530
>I have a ListBox to which a Horizontal Scrollbar is attached. I have a
timer
>which fills the List with the Current time after every second.
>1#> I want the Scrollbar to move to downword when I show the text on the
>window AUTOMATICALLY.
>2#> I want the Window to be updated AUTOMATICALLY to show the last text
added.

[More ...]
#pragma
Chris Green
Fri, 13 Apr 2001 12:55:09 -0700
Reply
Winnt v4.0 (sp6); VC 6.0 (sp3)

We have added a resource of type "TEXT" and included a number of txt files
we require in a program. However, we receive hundreds of warnings such as
the following:

Generating Code...
Linking...
.\ObjectSearchDB.def : warning LNK4017: export-version statement not
supported for the target platform; ignored
.\ObjectSearchDB.def : warning LNK4017: filter-query statement not supported
for the target platform; ignored
.\ObjectSearchDB.def : warning LNK4017: action statement not supported for
the target platform; ignored
.\ObjectSearchDB.def : warning LNK4017: set-field statement not supported
for the target platform; ignored
.\ObjectSearchDB.def : warning LNK4017: set-field statement not supported
for

[More ...]
Reply
Show Replies 1 Reply
Re: #pragma
<>
Tue, 17 Apr 2001 14:12:15 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 54355E75
From: CSABA SZELENYI <[log in to unmask]>
Subj: RE: #pragma
Date: Tue, 17 Apr 2001 08:15:20 +0200

>We have added a resource of type "TEXT" and included a number of txt files we
>require in a program. However, we receive hundreds of warnings such as the
>following:
>.\ObjectSearchDB.def : warning LNK4017: export-version statement not
>supported for the target platform; ignored

[More ...]
Assert valid when creating a new
ak daniel
Fri, 13 Apr 2001 09:38:19 -0700
Reply
All,

VC++6, WIN95

I'm trying to create a similar behavior to OnNew. When
I click on a push button I try to create a new
template with a different type of view (see below for
the reasons). However when I implemented the following
code I receive an Assertion error objcore.cpp
line 43...? How can I resolve this in such away that I
cancel this error. My application is an MDI and I'd
like to declare the code in the CMainframe.

[More ...]
Reply
Show Replies 1 Reply
Re: Assert valid when creating a new
Bruins, Perry
Tue, 17 Apr 2001 10:53:28 +0200
Hi,

I have experienced some similar problems, but then using CSingleDocTemplate.
I have solved these in the following way:

* First let the DocumentTemplate create a document:
CDocument* pDoc = (CDocument*) pMyTemplate->CreateNewDocument();
* Then create your new frame:
pMyTemplate->CreateNewFrame(pDoc, NULL);

Hope this can work for you

Perry Bruins ([log in to unmask])

> -----Original Message-----
> From: ak daniel [SMTP:[log in to unmask]]
> Sent: Friday, April 13, 2001 18:38
> To: [log in to unmask]
> Subject: Assert valid when creating a new
>
> All,
>
> VC++6, WIN95
>
> I'm trying to create a similar behavior to OnNew. When
> I click on a push

[More ...]
web browser problem
Dave Johnson
Thu, 12 Apr 2001 17:21:48 -0400
Reply
Environment: VC++ 6 SP3, Win98

Web Browser Trouble
Reply
No Replies
class problem
Dave Johnson
Thu, 12 Apr 2001 17:18:18 -0400
Reply
Environment: VC++ 6 SP3, Win98

Web Browser Class Declaration Trouble
Reply
No Replies
TitleBar
Anastas Ilchev
Thu, 12 Apr 2001 09:54:07 +0300
Reply
OS: Win9x, WinNT, Win2k
DEV: VC++ 6.0 SP4

Is there any way to catch the drawing on the title bar in SDI?
I want to draw my caption but OnNcPaint doesn't work when I have
Modal dialog over the mainframe!
10x!
Reply
No Replies
DISP_E_MEMBERNOTFOUND ?
Ehsan Akhgari
Wed, 11 Apr 2001 22:47:03 +0430
Reply
Another problem of mine:
When I run my app in debug mode, in the debug output I see the following
output (when I just run my app, and then close it):

Loaded 'C:\WINNT\System32\ntdll.dll', no matching symbolic information
found.
<snip>
Loaded 'C:\WINNT\system32\wininet.dll', no matching symbolic information
found.
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND
($80020003).
First-chance exception in URLBook.exe (KERNEL32.DLL): 0xE06D7363: Microsoft
C++ Exception.
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND
($80020003).
First-chance exception in URLBook.exe (KERNEL32.DLL): 0xE06D7363: Microsoft
C++ Exception.
Loaded 'C:\WINNT\system32\urlmon.dll', no matching symbolic information
found.
<snip>
Loaded 'C:\WINNT\system32\MSDBG.DLL', no matching symbolic information
found.
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND
($80020003).


[More ...]
Reply
Show Replies 1 Reply
Re: DISP_E_MEMBERNOTFOUND ?
anil
Mon, 30 Apr 2001 14:17:18 +0530
-----Original Message-----
From: Ehsan Akhgari [mailto:[log in to unmask]]
Sent: Wednesday, April 11, 2001 11:47 PM
To: [log in to unmask]
Subject: DISP_E_MEMBERNOTFOUND ?

Another problem of mine:
When I run my app in debug mode, in the debug output I see the following
output (when I just run my app, and then close it):

Loaded 'C:\WINNT\System32\ntdll.dll', no matching symbolic information
found.
<snip>
Loaded 'C:\WINNT\system32\wininet.dll', no matching symbolic information
found.
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND
($80020003).
First-chance exception in URLBook.exe (KERNEL32.DLL): 0xE06D7363: Microsoft
C++ Exception.
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND
($80020003).
First-chance exception in URLBook.exe (KERNEL32.DLL): 0xE06D7363: Microsoft
C++ Exception.
Loaded 'C:\WINNT\system32\urlmon.dll', no matching

[More ...]
How to proccess a WM_KEYDOWN in a dialog Application??
Alejandro Hurtado Turiño
Mon, 9 Apr 2001 16:44:44 -0400
Reply
OS: Win9x, Win2k
DEV: VC++ 6.0

Why are there some keys that don´t generate the WM_KEYDOWN message in a
Dialog based application?

How can I proccess that message then?
Reply
Show Replies 1 Reply
Re: How to proccess a WM_KEYDOWN in a dialog Application??
<>
Sat, 14 Apr 2001 15:06:27 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 4166D4AF
From: Phil Daley <[log in to unmask]>
Subj: Re: How to proccess a WM_KEYDOWN in a dialog Application??
Date: Wed, 11 Apr 2001 20:00:38 -0400

>Why are there some keys that don't generate the WM_KEYDOWN message in a Dialog
>based application? How can I proccess that message then?

Use PreTranslateMessage()

===== Digest Separator =====

[More ...]
CDialogBar
Lubomir Kordos
Sat, 7 Apr 2001 12:53:44 +-200
Reply
Visual C++ 6.0, Windows NT 4.0, service pack 5.0

I would like to make the Dialogbar like the one in the Visual C++. If I am
using the class CDialogbar I can not implement the "tips" for buttons like
the tooltips on the toolbar.

Can somebody say me what to do to have the "tips" for controls on dialogbar?

[More ...]
Reply
Show Replies 2 Replies
Re: CDialogBar
<>
Wed, 11 Apr 2001 09:40:15 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: ED06A8C3
From: Oleg Zhuk <[log in to unmask]>
Subj: Re: CDialogBar
Date: Mon, 9 Apr 2001 11:05:53 +0300

>I would like to make the Dialogbar like the one in the Visual C++. If I am
>using the class CDialogbar I can not implement the "tips" for buttons like the
>tooltips on the toolbar.

use CToolTipCtrl
The CToolTipCtrl class encapsulates the functionality of a tool tip control

[More ...]
Re: CDialogBar
D.M.
Wed, 11 Apr 2001 15:18:05 -0500
Lubos -

In .h file:

afx_msg BOOL GetToolTip(UINT id, NMHDR *pTTTStruct, LRESULT *pResult);
DECLARE_MESSAGE_MAP()

In .cpp:

BEGIN_MESSAGE_MAP(CMyDialogBar, CDialogBar)
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, GetToolTip)
END_MESSAGE_MAP()

BOOL CMyDialogBar::GetToolTip(UINT id, NMHDR *pNMHDR, LRESULT *pResult)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID = pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
nID = ::GetDlgCtrlID((HWND)nID);
switch(nID){
case IDC_MY_DIALOG_CONTROL1:
strcpy(pTTT->szText, "This is the tooltip");
pTTT->hinst = NULL;
return(TRUE);
break;
case IDC_MY_DIALOG_CONTROL2:
strcpy(pTTT->szText, "This is another tooltip");
pTTT->hinst = NULL;
return(TRUE);
break;
}
}

return(FALSE);
}

HTH,
Drew

----- Original Message -----
From: Lubomir Kordos <[log in to unmask]>
To: <[log in to unmask]>
Sent: Saturday, April 07, 2001 9:53 AM
Subject: CDialogBar

[More ...]
Canceling print job while printing...
Srinivas Nallandighal
Mon, 2 Apr 2001 09:29:28 -0700
Reply
windows 2000,VC++6.0
Hello,
It may be a tough one.How Can I my view class can
determine whether user has canceled the print job
while printing is in progress(by
pressing cancel button)?I saw the MFC code in
CView::OnFilePrint in which CPrintingDialog is
shown.But Is there any way for my application to know
when the user cancels the print job by pressing cancel
button in that Dialog.
Any Ideas...
Thanks
Sri.
Reply
Show Replies 1 Reply
Re: Canceling print job while printing...
suresh s
Thu, 5 Apr 2001 09:42:02 -0700
Hi srinivas,
It is possible but I am not sure. I belive it
gives a message when the user clicks the CANCEL
button.
suresh

--- Srinivas Nallandighal <[log in to unmask]> wrote:
> windows 2000,VC++6.0
> Hello,
> It may be a tough one.How Can I my view class can
> determine whether user has canceled the print job
> while printing is in progress(by
> pressing cancel button)?I saw the MFC code in
> CView::OnFilePrint in which CPrintingDialog is
> shown.But Is there any way for my application to
> know
> when the user cancels the print job by pressing
>

[More ...]
Document Name
Steve White
Thu, 29 Mar 2001 16:12:28 -0500
Reply
VC++ 6. Win2000

I am trying to create a new document through the File New command.
Everything works fine except I cannot associate a new (or NULL) file with
the document. It keeps the name of the last file and overwrites it if I Save
(instead of popping up with the Save-As dialog.

I have tried overriding OnFileNew() to call OnNewDocument() or
theApp.OnFileNew() or theApp.OpenDocumentFile(NULL); but none of it works.
Any suggestions appreciated.

[More ...]
Reply
Show Replies 1 Reply
Re: Document Name
<>
Sat, 31 Mar 2001 18:32:32 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: F4352E89
From: SHEN LIPING <[log in to unmask]>
Subj: Re: Document Name
Date: Fri, 30 Mar 2001 08:14:18 +0900

>I am trying to create a new document through the File New command. Everything
>works fine except I cannot associate a new (or NULL) file with the document.
>It keeps the name of the last file and overwrites it if I Save (instead of
>popping up with the Save-As dialog.

[More ...]
dlls and resources...
Reza Razavipour
Wed, 28 Mar 2001 15:38:32 -0500
Reply
I am running VC6 SP4 on NT4 SP6.

I have an exe that has a resource file, I am using a CPropertyPage *
returned
from another DLL. When I run and I create this object that is a
CPropertyPage ptr
returned to me I crash and when I trace things down, I see a resource
handle
issue in CPropertyPage::CommonConstruct with a bad return from
AfxFindResourceHandle.

[More ...]
Reply
Show Replies 1 Reply
Re: dlls and resources...
Aneesh P
Fri, 30 Mar 2001 09:30:15 +0530
Hi,

I think this problem is due to a mismatch in resource handles and module
states. If the module state is that of the exe and you are trying to invoke
a resource that is not in the current module state you will get an invalid
handle and hence a crash. This is because by default MFC assumes the module
state to be that of the exe(main application) and If you have an exported
function in a DLL(in your case the property page in the DLL),the resource
template is actually stored in the DLL module. You need to switch the

[More ...]
Releasing CAsyncSockets
Alastair M. Paterson
Wed, 28 Mar 2001 21:24:42 +0100
Reply
Windows NT4, VC++5

Hi!

I have a problem doing a release build of an application containing a CAsyncSocket derived listening socket.

The application is designed to run on two PCs and either one can send information to the other using the socket connection.

The problem is, that when a release build is installed on a 'clean' machine that only has NT on it, the application can create a socket and send data, but will not allow an incoming socket connection. (The client gets a WSAECONNRESET error the first time then WSAECONNREFUSED on subsequent attempts [names may be different as this

[More ...]
Reply
Show Replies 1 Reply
Re: Releasing CAsyncSockets
Roberts, Brian M
Fri, 30 Mar 2001 06:26:03 -0600
Use the Dependency Walker, also called just "Depends". You can usually find
this under Start, VC, Tools menu. Note I do not mean the Tools menu within
VC -- this is from the pretty Windows Start button. It will list all DLL's
required by your EXE. It also lists the version and date of all required
DLL's on the current machine, so you can run it on both machines and
compare.

[More ...]
Is this likely to be a bug?
<>
Wed, 28 Mar 2001 13:43:43 +1200
Reply
I have come across what is, I think, a bug with Visual C++ running under
Windows NT4. The application is a console application supporting MFC.

Compiler : Visual C++ 6.0 SP5.
Operating System : Windows NT4 Service Pack 6a.

My code has the following structure:

#include statements

using namespace std;

int main()
{
A lot of computations, input & output operations using
streams..............

[More ...]
Reply
Show Replies 1 Reply
Re: Is this likely to be a bug?
Han Donghai
Fri, 30 Mar 2001 14:26:01 +0800
maybe you can try

outFile1 << (history + calcPeriod);
How one can make use of itemData in CMyListBox::MeasureItem()?
hiraga
Mon, 26 Mar 2001 16:25:44 +0900
Reply
VC++ 6.0 on Windows 9x, NT, 2000

Hello all,

In my understanding, when, and only when, one call CMyListBox::AddString(),
CMyListBox::MeasureItem() is called.

But, at that time, itemData should be NULL. So, I think, the itemData
is nonsense.

What I'd like to do is to modify both itemWidth and itemHeight of an item
in CMyListBox::MeasureItem(), according to a length of a string associated
with the item.

[More ...]
Reply
Show Replies 1 Reply
Re: How one can make use of itemData in CMyListBox::MeasureItem()?
<>
Thu, 29 Mar 2001 14:50:49 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: CF7DC86E
From: DAVID ELLIOTT <[log in to unmask]>
Subj: Re: How one can make use of itemData in CMyListBox::MeasureItem()?
Date: Tue, 27 Mar 2001 07:32:21 -0800

In my understanding, when, and only when, one call CMyListBox::AddString(),
CMyListBox::MeasureItem() is called. But, at that time, itemData should be
NULL. So, I think, the itemData is nonsense. What I'd like to do is to modify
both itemWidth and itemHeight of an item in CMyListBox::MeasureItem(),
according to a length of a string associated with the item.

[More ...]
FindFile ?
Patrick Davis
Sun, 25 Mar 2001 03:35:34 -0500
Reply
Env : Win98, VC 6.0

Hi,

I'm trying to use the FindFile() function to retrieve
the file size and other info of specific files selected
in a CTreeCtrl.

ie

CFileFind find;
find.FindFile(pathStr);

find.FindNextFile();
m_dwByteCount = find.GetLength();

the problem is that you must first call
FindNextFile() before you can call
GetLength()

Ofcourse calling FindNextFile() steps
it to the next file and not the one thats selected
in the CTreeCtrl

[More ...]
Reply
Show Replies 1 Reply
Re: FindFile ?
<>
Sun, 25 Mar 2001 20:07:58 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 0B24691F
From: pgerhart <[log in to unmask]>
Subj: Re: FindFile ?
Date: Sat, 24 Mar 2001 18:52:47 -0500

>I'm trying to use the FindFile() function to retrieve the file size and other
>info of specific files selected in a CTreeCtrl.

You are confusing two things. CFileFind simply wraps the Win32 FindFirstFile
and FindNextFile - search MSDN for WIN32_FIND_DATA for more info. The Win32
function know nothing about your app's TreeControl (or CTreeView).

[More ...]
Release and debug difference.
Hylton Tregenza
Fri, 23 Mar 2001 08:46:25 +0200
Reply
Windows 95, VC5 SP3

Hi all

I have a funny happening between release and debug build.
My app consists of an SDI app with a horizontal splitter window dividing the
screen into 2 panes.
The lower pain has a CListView derived class in it, the upper has a grid
class in it. (al la codeproject)
The other pane is a CView class. The grid is created as a child of this
pane/window.
The GetFocus function is written to pass focus to the grid control when the
view gets focus.

[More ...]
Reply
No Replies
Placing Icons(bitmap) in second column in a listControl
Rajesh Thattakath
Thu, 22 Mar 2001 23:19:17 -0500
Reply
Hi All,

Env : NT4.0, VC 6.0

Is it possible to place a an icon(Bitmap) in the second column in a
listControl ?

I have a ListControl(Report style) in a dialog box.
I have loaded the Images using SetImageList(). In my first column a normal
text is to be set and in the second column an Icon and a text.
But always the icon comes in the first column.

[More ...]
Reply
Show Replies 1 Reply
Re: Placing Icons(bitmap) in second column in a listControl
Phil Daley
Fri, 23 Mar 2001 07:31:09 -0500
At 03-22-2001 11:19 PM, Rajesh Thattakath wrote:

>Is it possible to place a an icon(Bitmap) in the second column in a
>listControl ?

You would have to owner draw that column.

There is some good code at CodeGuru.com

Phil Daley < AutoDesk >
http://www.conknet.com/~p_daley
Problem with CFtpFileFind::FindFile
Christian Haas
Thu, 22 Mar 2001 11:29:38 +0100
Reply
Environment: VC++ 6.0 SP3 / NT 4.0 SP6

Hi,

I have a problem using the method FindFile of CFtpFileFinder. If I call FindFile with a distinct file name (no wildcards), either
with full path or not, the method always returns TRUE, regardless if the file exists on the FTP site or not.

If this is a known behavior of the method then I would need a solution for the task of checking if a single file is on the FTP site.

[More ...]
Reply
Show Replies 1 Reply
Re: Problem with CFtpFileFind::FindFile
<>
Sat, 24 Mar 2001 14:10:50 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 716153B7
From: Phil Daley <[log in to unmask]>
Subj: Re: Problem with CFtpFileFind::FindFile
Date: Fri, 23 Mar 2001 07:35:05 -0500

>I have a problem using the method FindFile of CFtpFileFinder. If I call
>FindFile with a distinct file name (no wildcards), either with full path or
>not, the method always returns TRUE, regardless if the file exists on the FTP
>site or not.

[More ...]
Removing a file from a project?
ak daniel
Tue, 20 Mar 2001 09:15:57 -0800
Reply
VC++ 6, Win 95.

I removed/deleted two files from a project (.h and
.cpp). Since i deleted them I cannot run anymore a
project because of this error:

Element.cpp
fatal error C1083: Cannot open source file:
'C:\mfc\Element.cpp': No such file or directory
Generating Code...
Error executing cl.exe.

I was given some help to do the following:

When you look in the directory that holds all the
files (using Explorer) there is a .clw file - delete
this file. Then, back in VC++, open up the classwizard
- you will be prompted to rebuild the class list. Now
click on all

[More ...]
Reply
No Replies
"&" character in strings
Vanvliet
Mon, 19 Mar 2001 21:17:20 -0800
Reply
OS: Win9x, WinNT, Win2k
DEV: VC++ 6.0 SP4

In an MFC-based application I am displaying web page titles on a tab
(CTabCtrl). When the web page title contains the "&" character, it is
displayed as an underscore character (behaving like a menu item's
accelerator key). Currently I am using something like this:

CString csTitle;
...
csTitle.Replace(_T("&"), _T("&&"));

This is, and feels like, a kludge. It is not a perfect solution because in
other UI controls (like listboxes), "&&" is displayed as "&&". Does anybody
know of a style bit that would make Windows not treat "&" characters as
some sort

[More ...]
Reply
Show Replies 1 Reply
Re: "&" character in strings
Mike Blaszczak
Tue, 10 Apr 2001 16:48:55 -0700
At 21:17 3/19/2001 -0800, Vanvliet wrote:
>OS: Win9x, WinNT, Win2k
>DEV: VC++ 6.0 SP4
>
>In an MFC-based application I am displaying web page titles on a tab
>(CTabCtrl). When the web page title contains the "&" character, it is
>displayed as an underscore character (behaving like a menu item's
>accelerator key). Currently I am using something like this:
>
> CString csTitle;
> ...
> csTitle.Replace(_T("&"), _T("&&"));
>
>This is, and feels like, a kludge. It is not a perfect solution because in
>other UI controls (like listboxes), "&&" is displayed as "&&". Does anybody
>know of a style

[More ...]
Capturing the mouse
Andreas Ögren
Thu, 15 Mar 2001 14:35:08 +0100
Reply
Environment: VC++ 6SP4, Win 2000

When the user of my application presses the left button, I'm capturing
the mouse with CWnd::SetCapture() to get the mouse position whereever it
is moved. When I receive a left button up message, I call
ReleaseCapture(). Simple, and it works fine most of the time, but there
is an exception. If the user presses Alt-Tab to change application
during my mouse capture, the new application will receive the left
button up message, that I wanted. What should I do?

[More ...]
Reply
Show Replies 1 Reply
Re: Capturing the mouse
<>
Mon, 19 Mar 2001 10:47:49 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: E958D869
From: Wayne Coles <[log in to unmask]>
Subj: RE: Capturing the mouse
Date: Fri, 16 Mar 2001 11:11:45 -0000

>When the user of my application presses the left button, I'm capturing the
>mouse with CWnd::SetCapture() to get the mouse position whereever it is moved.
>When I receive a left button up message, I call ReleaseCapture(). Simple, and
>it works fine most of the time, but there is an exception. If the user presses
>Alt-Tab to change application during my mouse capture, the new application
>will receive the left button up message, that I wanted. What

[More ...]
How to draw an image or icon in a combo box?
Koichi HIRAGA
Thu, 15 Mar 2001 20:53:50 +0900
Reply
VC++6.0, Windows 9x, NT

Could anybody tell me how to draw an image or icon in a combo box?

I think it can be drawn in each item in a drop-down list by adding my
own code in a DrawItem, but I have no way to do that in a combo box,
more precise, in an edit ctrl.

[More ...]
Reply
Show Replies 1 Reply
Re: How to draw an image or icon in a combo box?
<>
Mon, 19 Mar 2001 10:47:45 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 3E7E4173
From: Oleg Zhuk <[log in to unmask]>
Subj: Re: How to draw an image or icon in a combo box?
Date: Fri, 16 Mar 2001 10:44:16 +0200

>Could anybody tell me how to draw an image or icon in a combo box?

use MFC class CComboBoxEx or CommonConrol ComboBoxEx (you can read more in
MSDN >> Platform SDK >> User Interface Service >> Windows Common Controls >>
ComboBoxEx Controls)

[More ...]
Detecting memory leaks...
Ajay K Sanghi
Wed, 14 Mar 2001 10:07:35 +0530
Reply
Hello:

Environment: VC++ 6.0, SP4, Win NT 4.0 workstation

I get following memory leak:

Detected memory leaks!
Dumping objects ->
{15298} normal block at 0x009FA5F0, 12 bytes long.
Data: < | | Pz > 80 7C 9F 00 80 7C 9F 00 50 7A 9F 00

The memory allocation number in curly brackets and memory address keeps
changing but the data is always same.

[More ...]
Reply
Show Replies 1 Reply
Re: Detecting memory leaks...
<>
Mon, 19 Mar 2001 10:47:47 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 5E2F794B
From: AJAY K SANGHI <[log in to unmask]>
Subj: RE: Detecting memory leaks...
Date: Fri, 16 Mar 2001 16:13:56 +0530

>I get following memory leak:
>Detected memory leaks!
>Dumping objects ->
>{15298} normal block at 0x009FA5F0, 12 bytes long.
>Data: < | | Pz > 80 7C 9F 00 80 7C 9F 00 50 7A 9F 00
>The memory allocation number in curly brackets and memory address keeps
>changing but the data is always same.

[More ...]
Wrapper files were changed.
Vladimir Komarov
Tue, 13 Mar 2001 11:14:27 -0600
Reply
VC++ 6.0 (SP3), W2K (SP1)

Hi,

I have the MFC ActiveX control, which was originally created in 1998.
I've made some minor changes in the drawing methods recently (interface was
NOT changed) and I've decided to regenerate the wrapper files, just in case.

Surprisingly, the result files were different from the original wrapper
files.

The ODL file (identical for both versions):
......
[id(25)] void AddItem(bool selected, BSTR text);
Reply
Show Replies 1 Reply
Re: Wrapper files were changed.
Phil Daley
Fri, 16 Mar 2001 07:18:04 -0500
At 03-13-2001 12:14 PM, Vladimir Komarov wrote:

>As you can see, several types were changed from BOOL to long.
>
>First of all, I beleive that BOOL was equvalent to Int, but even that was

And an int is equivalent to long.

Phil Daley < AutoDesk >
http://www.conknet.com/~p_daley
Strange ListView display!!!
Feroz
Sun, 11 Mar 2001 08:04:13 -0800
Reply
Hi List,

Environment: VC++ 6.0 with SP3, WinNT

I am facing a very strange problem with ListView. I
have a Mainframe Window splitted into two, Both the
views are derived from CListView. But One view shows
the list in "LST_LIST" way and the other shows in
"LST_REPORT" way...

The first view(LST_LIST styled) should show 20 items
in one screen, if the items are getting increased then
it should add to the last and there should be a
'Vertical Scrollbar' attached, but here I am getting a
problem that the items are should in the columns and
the 'Horizontal Scrollbar' is

[More ...]
Reply
Show Replies 1 Reply
Re: Strange ListView display!!!
Terence Lein
Fri, 16 Mar 2001 05:21:47 -0500
The MSDN help for CListCtrl explains that this is how LST_LIST works. Change
the style of FirstView to LST_REPORT|LVS_NOCOLUMNHEADER to get the effect
you want.

----- Original Message -----
From: "Feroz" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Sunday, March 11, 2001 11:04 AM
Subject: Strange ListView display!!!

> Hi List,
>
> Environment: VC++ 6.0 with SP3, WinNT
>
> I am facing a very strange problem with ListView. I
> have a Mainframe Window splitted into two, Both the
> views are derived from CListView. But One view shows
> the list in "LST_LIST" way and the other shows in
>

[More ...]
File "Save As .."
H. Ted Lin
Thu, 8 Mar 2001 09:02:52 -0500
Reply
VC 6.0 SP4, WIN 2k

Hi,

I have a question about the File "save as". In the DOC class
OnSaveDocument(LPCTSTR lpszPathName), how can I tell it is from the "Save
As" message ? I could not find info about this from the MSDN. The reason I
need this is I need to save additional data then just the regular data when
"Save As" is called. Thanks.

[More ...]
Reply
No Replies
What's up with LoadImage?
Shawn Fessenden
Tue, 6 Mar 2001 22:24:12 -0600
Reply
VC++ 5.0 SP3 W9x/NT/2K -- CImageList related.

Here's a poser. At least, I hope so.

THE POINT:
CreateIconFromResource succeeds where both LoadIcon and LoadImage fail.
GetLastError returns 0. Maybe somebody has run into this and can explain
what's going on (Feng, this means you! ;)

BACKGROUND:
Using LoadLibraryEx to load a file as a data file, I build a linked list of
resources using EnumResourceTypes and EnumResourceNames. The idea is to
ultimately add images to a CImageList for display in a CListCtrl.

[More ...]
Reply
No Replies
Scrolling follows view updates
Mike Hammar
Tue, 6 Mar 2001 09:19:51 -0600
Reply
Environment: Visual Studio 6.0, sp4, VC++ 6.0, WinNT 4.0, sp6

What is the easiest way to have the view continually scroll as events are
added to it so the newest addition is always in view? I haven't seen an
example of this although I've seen programs that do this. Does anyone have
a code sample that accomplishes this?
Reply
Show Replies 1 Reply
Re: Scrolling follows view updates
<>
Wed, 7 Mar 2001 21:54:51 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: FA773F82
From: JON KYLE <[log in to unmask]>
Subj: RE: Scrolling follows view updates
Date: Tue, 6 Mar 2001 23:49:26 -0800

>What is the easiest way to have the view continually scroll as events are
>added to it so the newest addition is always in view?

Always put the most recent event at the top...

[More ...]
Right-justifying CListView's first column???
Daniel Ben-Ezri
Mon, 5 Mar 2001 13:08:26 -0500
Reply
Environment: VC++ 5.0 (SP3), Windows 98 4.10.1998

Hi!
I have a view derived from CListView. It's a simple list (intended to be
displayed in the LVS_REPORT style) made of 3 columns. I want all 3 columns
to be right justified (they list integers). However, for some reason, only
the last 2 columns get formatted correctly - the 1st column remains left
justified - regardless of what I do...

[More ...]
Reply
Show Replies 2 Replies
Re: Right-justifying CListView's first column???
<>
Tue, 6 Mar 2001 22:13:55 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 0202CD0B
From: [log in to unmask] (Steve Spencer)
Subj: Re: Right-justifying CListView's first column???
Date: Tue, 6 Mar 2001 17:09 +0000 (GMT)

>I have a view derived from CListView. It's a simple list (intended to be
>displayed in the LVS_REPORT style) made of 3 columns. I want all 3 columns to
>be right justified (they list integers). However, for some reason, only the
>last 2 columns get formatted correctly - the 1st column remains left justified
>- regardless of what I do...

[More ...]
Re: Right-justifying CListView's first column???
Martin Bonner
Wed, 7 Mar 2001 09:29:16 -0000
> -----Original Message-----
> From: Daniel Ben-Ezri [mailto:[log in to unmask]]
> Sent: 05 March 2001 18:08
> Subject: Right-justifying CListView's first column???
>
> I have a view derived from CListView. It's a simple list
> (intended to be displayed in the LVS_REPORT style) made
> of 3 columns. I want all 3 columns to be right justified.

> I read the MSDN documentation more thoroughly and discovered
> that by design "...The leftmost column is always left
> justified and contains the small icon and label..."

[More ...]
Is it legal to get ID of a control in a CFileDialog?
Koichi HIRAGA
Mon, 5 Mar 2001 21:59:45 +0900
Reply
VC++ 6.0 Win9x, NT, 2000

Is it legal to get ID of a control in a CFileDialog and operate the control
using it?
e.g. EnableWindow(FALSE);

If it is, please tell me how to get each ID.

Thank you
hiraga
Reply
No Replies
CToolBarCtrl::EnableButton problem
Mike Hammar
Fri, 2 Mar 2001 07:53:25 -0600
Reply
Environment: VC++ 6.0, sp4, WinNT 4.0 sp6, SDI application without DOC
support

Due to user interaction I would like to disable some buttons. My member
variable, m_wndToolBar, is of class CToolBar
so I did this to disable a button with id = ID_ERASE and the button stayed
enabled.

CToolBarCtrl& toolbarCtrl = m_wndToolBar.GetToolBarCtrl();
int what = toolbarCtrl.EnableButton(ID_ERASE, FALSE);

[More ...]
Reply
No Replies
Strange ListView...
Feroz
Fri, 2 Mar 2001 05:04:41 -0800
Reply
Hi List,

Environment: VC++ 6.0 with SP3, WinNT

I am facing a very strange problem with ListView. I
have a Mainframe Window splitted into two, Both the
views are derived from CListView. But One view shows
the list in "LST_LIST" way and the other shows in
"LST_REPORT" way...

The first view(LST_LIST styled) should show 20 items
in one screen, if the items are getting increased then
it should add to the last and there should be a
'Vertical Scrollbar' attached, but here I am getting a
problem that the items are should in the columns and
the 'Horizontal Scrollbar' is

[More ...]
Reply
No Replies
CToolBarCtrl member function EnableButton
Mike Hammar
Thu, 1 Mar 2001 14:31:22 -0600
Reply
Environment: VC++ 6.0, sp4, WinNT 4.0 sp6, SDI application without DOC
support

Due to user interaction I would like to disable some buttons. My member variable, m_wndToolBar, is of class CToolBar
so I did this to disable a button with id = ID_ERASE and the button stayed enabled.

CToolBarCtrl& toolbarCtrl = m_wndToolBar.GetToolBarCtrl();
int what = toolbarCtrl.EnableButton(ID_ERASE, FALSE);

[More ...]
Reply
Show Replies 1 Reply
Re: CToolBarCtrl member function EnableButton
<>
Sat, 3 Mar 2001 13:11:01 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: E91C0E4D
From: STKH (STEEN KROGSGAARD) <[log in to unmask]>
Subj: RE: CToolBarCtrl member function EnableButton
Date: Fri, 2 Mar 2001 11:58:38 +0100

>Due to user interaction I would like to disable some buttons. My member
>variable, m_wndToolBar, is of class CToolBar so I did this to disable a
>button with id = ID_ERASE and the button stayed enabled.
> CToolBarCtrl& toolbarCtrl = m_wndToolBar.GetToolBarCtrl();
> int what = toolbarCtrl.EnableButton(ID_ERASE, FALSE);
>The integer, what, is set to 1 (non-zero signifying that the EnableButton
>function worked?) but I must be missing something because I couldn't get the
>button to

[More ...]
String dimensions calculating
Petr Dokoupil
Thu, 1 Mar 2001 15:44:32 +0100
Reply
VC++ 6.0 SP4, WNT 4.0 SP6a

I need to resize window (for example static window) in my dialog according
the used font and string.
Is there any way how to calculate string width and height.
I tried to use:
HDC hDC = ::GetDC(hWnd);
SIZE size;
::GetTextExtentPoint32(hDC, szCA, nLen, &size);
::MoveWindow(hWnd, 10, 10, size.cx, size.cy, false);

But size.cx is not correct. It is always longer than is needed.

[More ...]
Reply
Show Replies 3 Replies
Re: String dimensions calculating
<>
Sat, 3 Mar 2001 13:11:04 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 3C56C070
From: EHSAN AKHGARI <[log in to unmask]>
Subj: RE: String dimensions calculating
Date: Sat, 3 Mar 2001 10:48:43 +0330

>I need to resize window (for example static window) in my dialog according the
>used font and string. Is there any way how to calculate string width and
>height.

try this, maybe it helps...

TEXTMETRIC tm;
::GetTextMetrics(hDC, &tm);
/* use tm properties. more info can be found at MSDN. */

[More ...]
Re: String dimensions calculating
Zinggl Alois
Tue, 6 Mar 2001 09:58:47 +0100
I have got some strange results from GetTextExtentPoint if the SIZE was not
initialized.

Luis Zinggl

-----Original Message-----
From: Petr Dokoupil [mailto:[log in to unmask]]
Sent: Donnerstag, 01. März 2001 15:45
To: [log in to unmask]
Subject: String dimensions calculating

VC++ 6.0 SP4, WNT 4.0 SP6a

I need to resize window (for example static window) in my dialog according
the used font and string.
Is there any way how to calculate string width and height.
I tried to use:
HDC hDC = ::GetDC(hWnd);
SIZE size;
::GetTextExtentPoint32(hDC, szCA, nLen, &size);
::MoveWindow(hWnd, 10, 10, size.cx, size.cy, false);

[More ...]
Re: String dimensions calculating
Petr Dokoupil
Fri, 9 Mar 2001 17:39:04 +0100
Thank you all,
I did have to select the font in the DC before the calculating.
But I created the DC from the static vindow with the font already set. So I
did not see any reason to select the font into the such created DC. I
thought it would be autonaticaly set.
My mistake. Now it works fine, and the resulting code looks like this, in
case you are interested.

[More ...]
Checked menu option with sub-menu?
Andrew Johnson
Wed, 28 Feb 2001 13:49:17 -0000
Reply
Env: Visual C++ 6.0 SP3 on NT4 SP5

Is it possible to have a popup menu option that is both checked
and has a sub-menu? Calling CMenu::CheckMenuItem() seems to be
having no effect in this situation. I've failed to find anything
in MSDN that says that this is not possible, but I've also not
found an app that does it. Can anyone confirm whether this is
or isn't possible?

[More ...]
Reply
Show Replies 1 Reply
Re: Checked menu option with sub-menu?
Craig Henderson
Fri, 2 Mar 2001 09:59:38 -0000
Andrew, this is true that a popup menu CANNOT be checked. No error will
occur if you try, it just will not have any effect.

-----Original Message-----
From: MFC -- Microsoft Foundation Classes
[mailto:[log in to unmask]]On Behalf Of Andrew Johnson
Sent: 28 February 2001 13:49
To: [log in to unmask]
Subject: Checked menu option with sub-menu?

Env: Visual C++ 6.0 SP3 on NT4 SP5

[More ...]
Printing a Bitmap
Prof. Dr. Siegfried Staiger
Wed, 28 Feb 2001 13:30:31 +0100
Reply
Environment: VC++ 6.0 with SP3, Win2000

I tried to print a bitmap by writing an MFC-EXE-Application with SDI,
Doc/View-Architecture, Print and Printpreview.

The Preview shows correctly the text and the bitmap from the View.

The printed paper shows only the text, not the bitmap. On the place, where
the bitmap should be, is only a little dot in the upper left corner.

[More ...]
Reply
Show Replies 1 Reply
Re: Printing a Bitmap
<>
Sat, 3 Mar 2001 13:10:59 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 992CA9AA
From: CRAIG HENDERSON <[log in to unmask]>
Subj: RE: Printing a Bitmap
Date: Fri, 2 Mar 2001 10:05:31 -0000

>I tried to print a bitmap by writing an MFC-EXE-Application with SDI,
>Doc/View-Architecture, Print and Printpreview. The Preview shows correctly the
>text and the bitmap from the View. The printed paper shows only the text, not
>the bitmap. On the place, where the bitmap should be, is only a little dot in
>the upper left corner.

[More ...]
Change Font ActiveX
Schmidt-Ott, Susanne
Fri, 23 Feb 2001 14:54:33 +0100
Reply
Platform: Win NT 4.0 SP6, VC++ 6.0 SP4

I created a ActiveX-Control with MFC-ActiveX-Assistant derived from
"SysTreeView32". I want to change the font in the TreeCtrl to "Trebuchet
MS". Can anyone give me a little code example?

Yours
Susanne
Reply
No Replies
four way splitters
Sujit Nayak
Thu, 22 Feb 2001 18:52:15 -0500
Reply
Environment: VC6, NT4

Hi

I am trying to create a 4 way splitter in the OnCreateClient method of my
Frame window. The code that I have is something like this -

m_wndSplitter.CreateStatic(this, 1, 2));
m_wndSplitter1.CreateStatic(&m_wndSplitter, 2, 1,WS_CHILD | WS_VISIBLE |
WS_BORDER, m_wndSplitter.IdFromRowCol(0, 0));

m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(View1),
CSize(100, 40), pContext));
m_wndSplitter1.CreateView(1, 0, RUNTIME_CLASS(View2),
CSize(100, 100), pContext));

m_wndSplitter2.CreateStatic(&m_wndSplitter, 2, 1, WS_CHILD | WS_VISIBLE |
WS_BORDER, m_wndSplitter.IdFromRowCol(0, 1));

[More ...]
Reply
Show Replies 1 Reply
Re: four way splitters
<>
Sat, 24 Feb 2001 19:32:22 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: EB420C3E
From: [log in to unmask]
Subj: Re: four way splitters
Date: Fri, 15 Oct 1999 08:37:16 +0530

>I am trying to create a 4 way splitter in the OnCreateClient method of my
>Frame window. The code that I have is something like this [snip] Although the
>splitters are created correctly, the left hand pane width is always zero and
>when the window comes up the user has to manually resize it to make it
>visible.

[More ...]
RDO and Active - X controls
Paradkar Sameer
Wed, 21 Feb 2001 08:53:01 +0530
Reply
Dear All,

Environment: VC++ 6.0/ Win NT 4.0

I am used install shield for making an installable program
for my VC++ application. I have used some active-x controls and RDO (remote
data objects ) in this application. When I run the setup.exe for my
application on machines with the VC++ installation it works as expected but
the same program does not work on machines w/o VC++ installation. I am
taking care of registering these Active - X controls using regsvr32 and have
taken care of tracing out the dependencies using the depends.exe. More
specifically when I call the DoModal API

[More ...]
Reply
Show Replies 1 Reply
Re: RDO and Active - X controls
Syed D'Great
Wed, 21 Feb 2001 21:00:44 -0800
--- Paradkar Sameer <[log in to unmask]>
wrote:
> Dear All,
>
> Environment: VC++ 6.0/ Win NT 4.0
>
> I am used install shield for
> making an installable program
> for my VC++ application. I have used some active-x
> controls and RDO (remote
> data objects ) in this application. When I run the
> setup.exe for my
> application on machines with the VC++ installation
> it works as expected but
> the same program does not work on machines w/o VC++
> installation. I am
> taking care of registering these Active - X controls
> using

[More ...]
<No subject>
Vishal S
Mon, 19 Feb 2001 16:44:31 +0530
Reply
Environment: Win NT4.0 VC++ 6.0

I am having a class (class CMyCls, not derived form any MFC class) in my
AppWizard generated application.

The definition of the class is as below:

class CMyCls

{

public:

// constructor, destructor etc.

int m_iA;

String m_str1, m_str2;

float m_fF1;

void Read(CArchive ar);

void Write(Carchive ar);

};

The member functions Read/Write simply use the >> and << operations to read
from and Write to CArchive object. e.g. -

[More ...]
Reply
No Replies
CRichEdit control with Vertical Scrolling
Leung, Chris
Thu, 15 Feb 2001 16:29:39 -0500
Reply
Environment - NT4.0 SP5, VC++ 6.0 SP4

I am using CRichEdit control member function LineScroll() passing the number
of line and number of characters.
It look like the control scroll vertically but not scroll horizontally. I'm
using default edit styles with multilines and horizontal scroll and vertical
scroll windows styles.
Does anyone have any idea?

Chris Leung
Highland Technologies, Inc. http://www.htech.com
301-306-2890 (direct) 301-306-8201 (fax)
Email: [log in to unmask]
Reply
No Replies
How to get the WinMsg(s) using Custom Controls???
Feroz
Wed, 14 Feb 2001 20:12:19 -0800
Reply
Hi List,

Env: VC++ (6.0), WinNT-SP6.

I have a Custom Control in my Dialog. I Attach a CWnd
class to the Customize Control. Now my problem is I
want the Control to handle the User Requests...
(somthing like the Windows Common Controls).

Can you please suggest me how to workout with handling
the User Messages in my Custom Control Class.

[More ...]
Reply
Show Replies 1 Reply
Re: How to get the WinMsg(s) using Custom Controls???
Ruben Jönsson
Thu, 15 Feb 2001 08:18:20 +0100
Add the standard control that this custom control is based on in your
dialog template with the dialog template editor. If it's just a CWnd
you can use the picture control (CStatic class), if so edit the
properties to suit your needs. The properties sets what styles your
control should be created with. For example, change Frame to
Rectangle, color to white and extended style to client edge to make
it look like an edit box. Also change the ID to something else than
ID_STATIC.

[More ...]
Owner-Drawn Menu: enforce call of "OnMeasureItem()"
Schmidt-Ott, Susanne
Tue, 13 Feb 2001 15:09:02 +0100
Reply
Platform: NT 4.0 SP6, VC++ 6.0 SP4

In a SDI-Application I have a owner-drawn menu in order to change the font.
When the application gets started it displays the default font because
"OnMeasureItem()" and "OnDrawItem()" have not yet been called. Clicking a
menu-item leads to the call of both methods and the Owner-Drawn Menu is
displayed. Does anyone know how I can enforce the call of "OnMeasureItem()"
and "OnDrawItem()", so that the menu is displayed right away at the start of
the application?

[More ...]
Reply
Show Replies 1 Reply
Re: Owner-Drawn Menu: enforce call of "OnMeasureItem()"
Andre Romanov
Tue, 13 Feb 2001 23:02:37 -0400
Try to create your menu dynamically and don't load it from resources. Or
load menu from resources and replace menu items. In the case
OnMeasureItem() and OnDrawItem() must be called.

Andre

From: Schmidt-Ott, Susanne <[log in to unmask]>
> Platform: NT 4.0 SP6, VC++ 6.0 SP4
>
> In a SDI-Application I have a owner-drawn menu in order to change the
font.
> When the application gets started it displays the default font because
> "OnMeasureItem()" and "OnDrawItem()" have not yet been called. Clicking a
> menu-item leads to the call of both methods and the Owner-Drawn Menu is
> displayed. Does anyone

[More ...]
ATL object in IIS
David Hyde
Tue, 13 Feb 2001 12:47:00 -0000
Reply
MSVC++ 6, IIS, winnt4

Hi,

I've built an ATL object which is intended to be able to be used in any sort
of client. Its working great everywhere that I've tried (VB etc.) except
for IIS. I know that it is due to the way that I have had to architecture
my control, but can I tell at run time whether I am running in IIS or on a
web page or in a "plain" type of client. If I can get this information I
might be able to work around my problem.

[More ...]
Reply
Show Replies 1 Reply
Re: ATL object in IIS
Mike May
Wed, 14 Feb 2001 06:45:39 -0000
You can call GetModuleFileName() to see the process you are running in. If
this is dllhost.exe or equivalent then you will know it is IIS.

Mike
-----Original Message-----
From: David Hyde <[log in to unmask]>
To: [log in to unmask] <[log in to unmask]>
Date: 14 February 2001 02:50
Subject: [MFC] ATL object in IIS

>MSVC++ 6, IIS, winnt4
>
>Hi,
>
>I've built an ATL object which is intended to be able to be used in any
sort
>of client. Its working great everywhere that I've tried (VB etc.) except
>for IIS. I know that it is due to the way that I have had to architecture
>my

[More ...]
Using the Help button in property sheets
<>
Tue, 13 Feb 2001 12:56:18 +0100
Reply
Environment: VC++ 6, Windows 2000
Reply
Show Replies 3 Replies
Re: Using the Help button in property sheets
<>
Wed, 14 Feb 2001 20:39:17 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 05520021
From: SWADHA BHAT <[log in to unmask]>
Subj: Re: Using the Help button in property sheets
Date: Wed, 14 Feb 2001 08:55:54 -0800

>I got a dialog sheet with several dialog pages and I whish to use the
>Help-button in the dialog sheet to get help about the current dialog page. The
>problem is that the Help-button is disabled.

[More ...]
Re: Using the Help button in property sheets
<>
Thu, 22 Feb 2001 10:42:36 +0100
What I needed to do was to add an empty handle in the application class for
ID_HELP. I then added a handle for the property sheet for the ID_HELp, which
actually handles the Help button. This work great... for the property sheet
where I want help.

However, after I added the CMyApp::OnHelp() handle, all property sheets now
got the help button enabled. In the constructors for the property sheets
where I don't want help, I have added:

[More ...]
Re: Using the Help button in property sheets
<>
Sat, 24 Feb 2001 19:32:24 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 3B7B76B3
From: BRIAN HART <[log in to unmask]>
Subj: RE: Using the Help button in property sheets
Date: Fri, 23 Feb 2001 00:43:24 -0600

>What I needed to do was to add an empty handle in the application class for
>ID_HELP. I then added a handle for the property sheet for the ID_HELp, which
>actually handles the Help button. This work great... for the property sheet
>where I want help. However, after I added the CMyApp::OnHelp() handle, all
>property sheets now got the help button enabled.

[More ...]
Closing an MFC application
Xanh
Mon, 12 Feb 2001 15:09:49 -0600
Reply
Environment: VC 6.0 SP4, W2K

I have an MFC application that can be run either in interactive or batch
mode.
My question is in batch mode, what functions to call and where to call them
to have
the app exits gracefully?

-Try to quit in Doc object:

CMyAppDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
//....

if(m_doExit) // set to TRUE if batch input file
{
// Exit app, but never call ~CMyAppDoc() to clean up allocated
memory
PostQuitMessage(0);
// or
// PostMessage(NULL, WM_QUIT, NULL, NULL);
}
}

[More ...]
Reply
Show Replies 2 Replies
Re: Closing an MFC application
Brian Hart
Mon, 12 Feb 2001 23:14:49 -0600
To close your MFC application, use the call:

if (AfxGetMainWnd() != NULL)
{
AfxGetMainWnd()->SendMessage(WM_CLOSE);
}

Sending the WM_CLOSE windows message to the main window of your MFC program
is the proper way to shut down the program. Your application has a main
window if, in InitInstance(), the code initializes the m_pMainWnd member to
point to a window. If no such code is there, then the only way to exit is
to call

[More ...]
Re: Closing an MFC application
<>
Wed, 14 Feb 2001 20:39:12 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 9832AD5F
From: PJ Naughter <[log in to unmask]>
Subj: Re: Closing an MFC application
Date: Wed, 14 Feb 2001 10:08:40 +0000

>I have an MFC application that can be run either in interactive or batch mode.
>My question is in batch mode, what functions to call and where to call them to
>have the app exits gracefully?

[More ...]
CWinThread and Document Templates....
Feroz
Fri, 9 Feb 2001 20:20:40 -0800
Reply
Env : VC++(6.0), WinNT,SP4,

Hi list,

I have created a User-Interface Thread and called a
CWinThread object which inturn calls a CFrameWnd's
Create function to create a Frame. But my problem is I
want a complete set of Document/View/Mainframe to be
called when I run the thread. I have seen MSDN and
found that I can do so using the
CSingleDocTemplate.......AddDocTemplate. I could able
to create the DocTemplate....but when I am trying to
call the AddDocTemplate it is giving me error that
AddDocTemplate is a member function of CWinApp..

[More ...]
Reply
Show Replies 1 Reply
Re: CWinThread and Document Templates....
<>
Sun, 11 Feb 2001 11:19:40 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: FE650C41
From: RANI MUKHARJEE <[log in to unmask]>
Subj: Re: CWinThread and Document Templates....
Date: Sun, 11 Feb 2001 12:31:22 +0530

>I have created a User-Interface Thread and called a CWinThread object which
>inturn calls a CFrameWnd's Create function to create a Frame. But my problem
>is I want a complete set of Document/View/Mainframe to be called when I run
>the thread.

[More ...]
F10 and CListView
Hylton Tregenza
Fri, 9 Feb 2001 07:01:10 +0200
Reply
Hi all
Win 95, VC5 SP3.

How can I get an application that consists of a cListView to not process the
F10 key. By that I mean, not take focus to the menu when F10 is pressed.

Hylton
Reply
No Replies
Changing Page in Printing
Vishal S
Tue, 6 Feb 2001 17:01:05 +0530
Reply
Environment: Win NT4.0 SP3, VC6.0

I have a ListView in my aplication, which displays a list of items in
Report format.
While printing, I want to print each item in the List view on a separete
sheet of paper.

For this I tried the following, in the function OnPrint()

void CMyLstView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
...
...

for(int i=0; i < numListItems; i++)
{
PrintItem(i, pDC, pInfo);
/* where PrintItem() is my function which prints the i-th item of
the list.
thereafter I try to increment the current page in CPrnitInfo
object */

[More ...]
Reply
Show Replies 2 Replies
Re: Changing Page in Printing
<>
Fri, 9 Feb 2001 17:57:52 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 3A53FC20
From: Terence Lein <[log in to unmask]>
Subj: Re: Changing Page in Printing
Date: Fri, 09 Feb 2001 05:38:17 -0500

>I have a ListView in my aplication, which displays a list of items in Report
>format. While printing, I want to print each item in the List view on a
>separete sheet of paper. [snip] What I want is that after printing one item,
>it should go to the next page. It prints all items in the same sheet.

[More ...]
Re: Changing Page in Printing
Richard
Mon, 26 Feb 2001 00:07:47 -0600
There is a "better" way if you want to use it. Firstly make sure that your print
function calls pDc->EndPage to print the current page then set the
pInfo->m_bContinuePrinting member of the CPrintInfo to TRUE if you want to print
additional pages regardless of the page setting used in OnPreparePrinting.

Richard

[log in to unmask] wrote:

> Moderator's Direct Message/Digest
> William Dempsey [log in to unmask]
>
> Mesg: 3A53FC20
> From: Terence Lein <[log in to unmask]>
> Subj: Re: Changing Page in Printing
> Date: Fri, 09 Feb 2001 05:38:17 -0500
>
> >I have a ListView in my aplication, which displays a list of items

[More ...]
statusbar update
Aneesh P
Tue, 6 Feb 2001 10:16:45 +0530
Reply
Environment: NT SP4, MFC, VC6

Hello,

I am facing a problem regarding update of a status bar. I have an
exe which owns the main frame and a DLL which has a dialog resource.
I have a timer which updates the statusbar periodically.
The problem is that when the modal dialog box of the DLL is active, the
statusbar update asserts. This is because curently the module
state(resource) is that of the DLL (because dialog is active) and the timer
tries to update status bar which is not a part of the DLL. I am using
AFX_MANAGE_STATE(...) in the DLL.

[More ...]
Reply
Show Replies 1 Reply
Re: statusbar update
Jeff Nygren
Fri, 9 Feb 2001 07:58:54 -0600
I'd recommend not worrying about the status bar while the dialog is active.
KillTimer before DoModal, then call OnTimer and restart your timer when the
dialog returns.

Jeff Nygren

Aneesh P <[log in to unmask]>@LISTSERV.MSN.COM> on 02/05/2001
10:46:45 PM

Please respond to MFC -- Microsoft Foundation Classes
<[log in to unmask]>

Sent by: MFC -- Microsoft Foundation Classes <[log in to unmask]>

To: [log in to unmask]
cc:
Fax to:
Subject: statusbar update

Environment: NT SP4, MFC, VC6

[More ...]
CPropertySheet Size
Steve White
Mon, 5 Feb 2001 13:35:42 -0500
Reply
VC++ 6 Win2000

I am creating a Modeless property sheet with several dialog. The
documentation suggests that the property sheet should be large enough to fit
the largest CPropertyPage but in fact the Width is twice the size of the
largest page. I can set the size of the property sheet manually with a call
to SetWindowPlacement(&wp) or MoveWindow(winRect). This still has two
problems. First the right side of the property sheet is Cut as are the Tabs
even though I called EnableStackedTabs( FALSE ) in the Create function.
Second and more problematic, the new size is only correct for

[More ...]
Reply
No Replies
CTreeCtrl
Penina Weiss
Mon, 5 Feb 2001 08:43:00 +0200
Reply
Environment: VC++ 6.2, Win NT SP4.0

Hi,

I'm using a CTreeCtrl with the option: "Check boxes" selected.
(from the controls properties).
How do I know if the check box of an HTREEITEM is marked?
How can I mark it myself?
How can I control the color of the check? (I want it gray
and not black if not all the sub items were checked too).
Reply
Show Replies 1 Reply
Re: CTreeCtrl
Antony R L
Tue, 6 Feb 2001 23:33:11 +0530
hi,
You have the member fn. GetItemState and SetItemState to set or get the
state of the item.

but, i dont know how to change the color of the check.

>From: Penina Weiss <[log in to unmask]>
>Reply-To: MFC -- Microsoft Foundation Classes <[log in to unmask]>
>To: [log in to unmask]
>Subject: CTreeCtrl
>Date: Mon, 5 Feb 2001 08:43:00 +0200
>
>Environment: VC++ 6.2, Win NT SP4.0
>
>Hi,
>
>I'm using a CTreeCtrl with the option: "Check boxes" selected.
>(from the controls properties).
>How do I know if the check box of an HTREEITEM is marked?
>How can I mark it myself?
>How can I control the

[More ...]
Resizing Header in CListCtrl
Masoud Qurashi
Fri, 2 Feb 2001 10:09:53 -0500
Reply
VC 6; NT 4; SP6

Hi All,
In my application I have put a CListCtrl control on a dialog. When the dialog is resized the CListCtrl is resized as well. However, the header of the CListCtrl in the dialog doesn't resizes properly. It stays smaller when the CListCtrl is enlarged along with the dialog. As a result a portion of the CListCtrl doesn't have the header at all.
Note: I don't see this problem on my development machine that has VC++6 installed on it. On the target test machine that has only NT4 with SP6 shows the problem.
What wrong

[More ...]
Reply
Show Replies 1 Reply
Re: Resizing Header in CListCtrl
Roberts, Brian M
Mon, 5 Feb 2001 07:19:08 -0600
Check the version of the common controls DLL (COMCTL32.DLL), which contains
the actual list control code. There are many versions of this, with
differing features and some with just plain old bugs. It is updated by
installations of Internet Explorer, Visual C++, and lots of other software.
In the past this was a restricted DLL, but I believe you can now
redistribute it with your application. On either www.codeproject.com or
www.codeguru.com there is some sample code to check the version of this DLL
from within your application.

[More ...]
Synchronizing CRecordset with SQL DDL commands
Peter Sherwood
Fri, 2 Feb 2001 01:18:21 -0500
Reply
VC 6, SP3, W98

Summary: An Access 97 table is being created and populated using SQL DDL (data
definition language) statements, then opened and read using a CRecordset
object. The program behaves as if the CRecordset fetches the data before the
DDL statements have executed. I need to know how to synchronize these.

Details:
(1) I create an Access table using DDL:
CTables tb;
The CTables class is from a MS sample pgm, tableset.cpp; it calls the
ODBC catalog function
tb.m_strNameParam=tempTableName;
tb.Open();
pDatabase=tb.m_pDatabase; // the data source used for the SQL
connection
in Tables
strSQL="CREATE TABLE "+tempTableName+" ("+columnNames+")";
pDatabase->ExecuteSQL(strSQL);

[More ...]
Reply
No Replies
Printing in Split View - Please Help
Vishal S
Thu, 1 Feb 2001 12:38:42 +0530
Reply
Someone please respond

Environment: Windows NT4.0 VC++ 6.0

I am developing a small SDI VC++ application which I started using
VisualStudio MFC AppWizard, including Split view feature and Print/Preview
features.
Initially I specifid the Derived class for my App's View class as
CScrollView.
Since I wanted a split view, I did the following in
CMainFrame::OnCreateClient(...)

BOOL brVal = m_wndSplitter.CreateStatic(this, 2, 1);

[More ...]
Reply
Show Replies 3 Replies
Re: Printing in Split View - Please Help
<>
Sat, 3 Feb 2001 18:17:31 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 880C01A9
From: Brian MacKay
Subj: RE: Printing in Split View - Please Help
Date: Fri, 2 Feb 2001 09:45:43 -0800

>I am developing a small SDI VC++ application which I started using
>VisualStudio MFC AppWizard, including Split view feature and Print/Preview
>features. [snip] Now the Framework by default maps File/Print and
>File/PrintPreview menu items to only CFirstView and NOT to CSecondView. So
>when the focus in on CSecondView, these Menu Items are grayed.

[More ...]
Re: Printing in Split View - Please Help
Sanjay
Tue, 6 Feb 2001 11:21:47 +0530
Hi
I think the art is again available on MSJ now,
"Meandering Through the Maze of MFC Message and Command Routing,"
Regards
Sanjay

[log in to unmask] wrote:

> Moderator's Direct Message/Digest
> William Dempsey [log in to unmask]
>
> Mesg: 880C01A9
> From: Brian MacKay
> Subj: RE: Printing in Split View - Please Help
> Date: Fri, 2 Feb 2001 09:45:43 -0800
>
> >I am developing a small SDI VC++ application which I started using
> >VisualStudio MFC AppWizard, including Split view feature and Print/Preview
> >features. [snip] Now the Framework by default maps File/Print and
> >File/PrintPreview menu items to only

[More ...]
Re: Printing in Split View - Please Help
Lalgudi V. Venkat
Fri, 9 Feb 2001 12:36:10 +0530
-----Original Message-----
From: MFC -- Microsoft Foundation Classes
[mailto:[log in to unmask]]On Behalf Of Sanjay
Sent: Tuesday, February 06, 2001 11:22 AM
To: [log in to unmask]
Subject: Re: Printing in Split View - Please Help

Hi
I think the art is again available on MSJ now,
"Meandering Through the Maze of MFC Message and Command Routing,"
Regards
Sanjay

[log in to unmask] wrote:

> Moderator's Direct Message/Digest
> William Dempsey [log in to unmask]
>
> Mesg: 880C01A9
> From: Brian MacKay
> Subj: RE: Printing in Split View - Please Help
> Date: Fri, 2 Feb 2001 09:45:43 -0800
>
> >I am developing a small SDI VC++ application which

[More ...]
ListView
Srinivas S
Wed, 31 Jan 2001 09:44:56 +0530
Reply
VC 6; NT 4; SP6
Reply
Show Replies 2 Replies
Re: ListView
<>
Sat, 3 Feb 2001 18:17:33 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: F977FAAE
From: PROGRAMMER <[log in to unmask]>
Subj: RE: ListView
Date: Sat, 3 Feb 2001 13:28:55 +0330

>I want to use CListView class insttead of the normal view class which is
>derived from the CWnd supplied by the Appwizard. [snip] Problem is I am
>getting the column headers but not the data in the list!

[More ...]
Re: ListView
<>
Mon, 5 Feb 2001 17:24:50 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 6243D35C
From: B.S.BETAGERI. <[log in to unmask]>
Subj: Re: ListView
Date: Sun, 04 Feb 2001 10:58:45 +0530

>I want to use CListView class insttead of the normal view class which is
>derived from the CWnd supplied by the Appwizard. [snip] Problem is I am
>getting the column headers but not the data in the list!

[More ...]
Profile .ini or registry profile control
H. Ted Lin
Tue, 30 Jan 2001 20:49:17 -0500
Reply
Environment: Windows WIN2K & WIN98/NT VC++ 6.0

I have tried very hard to find out how to write to the *.ini file instead
of the registry for the application profile setting WINAPI
GetProfileString() and WriteProfileString().

I have two applications, and they use the same exact GetProfileString() and
WriteProfileString(), but one writes to the *.ini, and the other one writes
to registry. What is the control to switch them ? I created one, and the
other one (write to the *.ini) is from the MSDN sample.

[More ...]
Reply
Show Replies 1 Reply
Re: Profile .ini or registry profile control
<>
Sat, 3 Feb 2001 18:17:29 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: B7369248
From: XANH <[log in to unmask]>
Subj: Re: Profile .ini or registry profile control
Date: Thu, 1 Feb 2001 15:40:08 -0600

>I have tried very hard to find out how to write to the *.ini file instead of
>the registry for the application profile setting WINAPI GetProfileString() and
>WriteProfileString().

If I remember correctly, there is a key in the registry that tells
GetProfileString() and WriteProfileString() to either write to the registry or
a file. Anyway, why don't you use WritePrivateProfileString(), and
GetPrivateProfileString()? These functions will write to a file whose name is
passed in as

[More ...]
CDialog problem
Hamoudi Haddad
Tue, 30 Jan 2001 16:58:30 +0100
Reply
Environment: Windows 2000Pro VC++ 6.0

Hi everybody,

I have a problem with CDialog, specifically CFileDialog. I have the flag
OFN_ALLOWMULTISELECT added to the dialog creation. when the user selects
more than 11 files, the dialog returns IDCANCEL (2) regardless of whether
the user clicks OK or Cancel. I read in the MSDN that for multiple
sellection, I should have my own filename buffer, by setting the value of
m_ofn.lpstrFile, also I should set the number of characters in the
m_ofn.lpstrFile string in m_ofn.nMaxFile.

[More ...]
Reply
Show Replies 1 Reply
Re: CDialog problem
<>
Sat, 3 Feb 2001 18:17:25 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: B118EBB1
From: Phil Daley <[log in to unmask]>
Subj: Re: CDialog problem
Date: Thu, 01 Feb 2001 16:27:44 -0500

>I tried to do so by adding the following 2 lines of code after constructing
>the file dialog and before calling DoModal on it:
> dlgFile.m_ofn.lpstrFile = &osFileBuffer;
> dlgFile.m_ofn.nMaxFile = 1000;

What does osFileBuffer look like?
char osFileBuffer[1000];
or
char* osFilebuffer;
osFileBuffer = malloc(1000);
????

[More ...]
ImageList Ghost Problems
Luke Marshall
Tue, 30 Jan 2001 10:20:07 +1000
Reply
Environment : VC++ 6.0 SP4, Win2k, MFC/C++

Hello,

I am using ImageLists as a way of implementing Drag 'n' Drop in some
controls I am extending. However if I drag an item (say called "Foo")
and then drag an item called "Bar" - I can see "Foo" as a ghost like
image in the background of the "Bar" item.

[More ...]
Reply
No Replies
Launching Application
Schmidt-Ott, Susanne
Mon, 29 Jan 2001 13:51:05 +0100
Reply
Platform: Windows NT 4.0 (SP 5), Visual C++ 6.0

I want to start "Windows Imaging" from a SDI-Application. I there an easy
way to create the object (Prog-ID: WangImage.Application) in order to be
able to use its methods?
Thanks
Susanne
Reply
Show Replies 2 Replies
Re: Launching Application
<>
Thu, 1 Feb 2001 13:21:50 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 4C481094
From: LAW, NEIL A <[log in to unmask]>
Subj: RE: Launching Application
Date: Tue, 30 Jan 2001 07:51:49 -0500

>I want to start "Windows Imaging" from a SDI-Application.

The wang image control is an OCX so you create it they way you would any
control. Insert into your project (Project | Add To Project | Components and
Controls) and create an object. You can create the object by explicit
declaration (e.g., CWangCtrl imgControl) or by embedding it into a resource
and declaring a member variable.

[More ...]
Re: Launching Application
Rick M
Thu, 1 Feb 2001 21:44:33 -0000
Do you want to launch the imaging application in a separate process or
do u want to load in-process?
1. Separate process
Use "CreateProcess" API. You cannot use any of the imaging methods here.
2. In-process
Load the imaging DLL or the activeX control or Ocx, thru OLE.

let me know if u need more info,
thanks,
rick

[More ...]
CRichEditCtrl and OnEnterIdle
Ruben Jönsson
Mon, 29 Jan 2001 13:12:43 +0100
Reply
Environment: VC++ 6.0 sp3, win98.

I have a modal dialog box which contains a CRichEditCtrl control. I
use the RichEdit control to display text files (read only) which are
selected from a ComboBox. The textfiles could be fairly large (a
couple of megabytes) so I don't want to load the entire textfile at
once while displaying a Wait cursor since it can take up to 10
seconds+ to load the file, at which the user can't select another
file or another (cancel) button for the dialog.

[More ...]
Reply
No Replies
Printing in Split View
Vishal S
Mon, 29 Jan 2001 14:32:22 +0530
Reply
Environment: Windows NT4.0 VC++ 6.0

I am developing a small SDI VC++ application which I started using
VisualStudio MFC AppWizard, including Split view feature and Print/Preview
features.
Initially I specifid the Derived class for my App's View class as
CScrollView.
Since I wanted a split view, I did the following in
CMainFrame::OnCreateClient(...)

BOOL brVal = m_wndSplitter.CreateStatic(this, 2, 1);

[More ...]
Reply
No Replies
drag and drop architecture
Mike May
Sat, 27 Jan 2001 18:44:39 -0000
Reply
NT4 SP5, VC6 SP3, MFC42

I have developed an ActiveX conrol which acts as an OLE drop target. One of
our customers has a container where the control is wrapped in one of their
own wrapper controls which is also an OLE drop target. Their intention is
that when data is dropped with their proprietary clipboard format their
wrapper can take some appropriate action.

[More ...]
Reply
No Replies
Duplicate 'delete' function during linking
Jan Straegaard
Wed, 24 Jan 2001 13:23:06 +0100
Reply
Environment VC6, SP4

I have developed an MFC application using shared MFC DLLs.
In order to avoid DLL version problems when distributing it to my friends
I have switched to static MFC libs. During linking I now the following
(modified) output:

--------------------Configuration: TCS - Win32 Debug--------------------
Linking...
LINK : warning LNK4075: ignoring /INCREMENTAL due to /FORCE specification
Start Pass1
Processed /DEFAULTLIB:libcpmtd
Processed /DEFAULTLIB:nafxcwd.lib
Processed /DEFAULTLIB:libcmtd.lib
Processed /DEFAULTLIB:kernel32.lib
Processed /DEFAULTLIB:user32.lib
Processed /DEFAULTLIB:gdi32.lib
Processed /DEFAULTLIB:comdlg32.lib
Processed /DEFAULTLIB:winspool.lib
Processed /DEFAULTLIB:advapi32.lib
Processed /DEFAULTLIB:shell32.lib
Processed /DEFAULTLIB:comctl32.lib
Processed /DEFAULTLIB:uuid.lib
Processed /DEFAULTLIB:odbc32.lib
Processed /DEFAULTLIB:odbccp32.lib
Processed /DEFAULTLIB:oledlg.lib
Processed /DEFAULTLIB:ole32.lib
Processed /DEFAULTLIB:olepro32.lib
Processed /DEFAULTLIB:oleaut32.lib
Processed /DEFAULTLIB:urlmon.lib
Processed /DEFAULTLIB:daouuid.lib
Processed

[More ...]
Reply
Show Replies 1 Reply
Re: Duplicate 'delete' function during linking
Roberts, Brian M
Thu, 25 Jan 2001 06:47:30 -0600
How did you switch from the MFC DLL to static linking? I do this with the
Project Setting dialog, General tab, first combo box. Never seen any
messages about duplicate definitions or had to use the /FORCE parameter. I
suspect that either this change was done incorrectly, or you are also using
some MFC extension DLL that requires the MFC DLL.

[More ...]
Dialog box problems
<>
Mon, 22 Jan 2001 13:11:49 +0100
Reply
Environment: Windows 2000 SP1, Visual C++ 6.0 SP3

To try to share code between to almost identical dialog boxes, I
manually created a class CMyDialog:

CDialog
|
+- CMyDialog
| |
| +- CFirstDialog
| |
| +- CSecondDialog

I modified the constructors and the OnInitDialog, so that
CFirstDialog constructor call the CMyDialog's contructor
with it's ID, which again call the CDialog constructor.
CFirstDialog::OnInitDialog calls CMyDialog::OnInitDialog
(which again call CDialog::OnInitDialog).
Also the DoDataExchange and BEGIN_MESSAGE_MAP has been modified.

[More ...]
Reply
No Replies
Continuing OnIdle calls when in modal dialogs
Ruben Jönsson
Mon, 22 Jan 2001 08:14:10 +0100
Reply
Environment: VC++ 6.0 sp3, win98.

I have a number of routines linked to my aplications OnIdle function.
However, I don't get any calls when I am in a modal dialog. What is
the easiest way to keep getting these OnIdle calls when a modal
dialog has the focus but is idle?

Do I override DoModal() and dispatch my own OnIdle from the dialog
message loop?
Reply
Show Replies 2 Replies
Re: Continuing OnIdle calls when in modal dialogs
Andrei Romanov
Tue, 23 Jan 2001 08:15:58 -0400
Override OnEnterIdle(UINT nWhy, CWnd* pWho) in main window of your
application.

> I have a number of routines linked to my aplications OnIdle function.
> However, I don't get any calls when I am in a modal dialog. What is
> the easiest way to keep getting these OnIdle calls when a modal
> dialog has the focus but is idle?
>
> Do I override DoModal() and dispatch my own OnIdle from the dialog
> message loop?
Re: Continuing OnIdle calls when in modal dialogs
Hinchy, Martin
Thu, 25 Jan 2001 13:47:23 +1000
To ensure that things like the caps lock and num lock states are kept up to
date in the status bar of your main app while a modal dialog has the focus,
call
SendMessageToDescendants(WM_IDLEUPDATECMDUI, (WPARAM)TRUE, 0, TRUE, TRUE)
from within
OnEnterIdle() of your main window.

-----Original Message-----
From: Andrei Romanov [mailto:[log in to unmask]]
Sent: Tuesday, 23 January 2001 10:16 PM
To: [log in to unmask]
Subject: Re: Continuing OnIdle calls when in modal dialogs

[More ...]
IUnknown to IDispatch
Ron
Fri, 19 Jan 2001 11:43:29 -0500
Reply
Environment: VC6 sp4, NT4 sp6

How can I convert an *IUnknown to the corresponding *IDispatch?
Reply
Show Replies 2 Replies
Re: IUnknown to IDispatch
Tommy Quitt
Sat, 20 Jan 2001 23:20:22 +0200
Hi Ron,

Well, you can not convert any IUnknown interface to IDispatch.
You can do it only if your object supports IDispatch. So, the best thing
will be to call QueryInterface on your IUnknown interface with the CLSID of
IDisaptch as parameter.
If you recieve a positive response that's your "Iunknown as IDispatch".

Tommy

-----Original Message-----
From: MFC -- Microsoft Foundation Classes [mailto:[log in to unmask]]On
Behalf Of Ron
Sent: Friday, January 19, 2001 6:43 PM
To: [log in to unmask]
Subject: IUnknown to IDispatch

[More ...]
Re: IUnknown to IDispatch
Martin Bonner
Mon, 22 Jan 2001 11:21:45 -0000
> -----Original Message-----
> From: Ron [mailto:[log in to unmask]]
> Sent: 19 January 2001 16:43
> Subject: IUnknown to IDispatch
>
> How can I convert an *IUnknown to the corresponding *IDispatch?
>
QueryInterface
(I wonder how many replies saying the same thing this post will generate?)
MFC platforms
Steve White
Thu, 18 Jan 2001 10:33:06 -0500
Reply
Does Microsoft have any flavors of MFC Visual C++ on none MS platforms such
as Unix and Mac. How much work (open ended question) is involved in a port
if MFC is or is not available?

Thanks

Steve
www.VirtualMechanics.com
Reply
Show Replies 3 Replies
Re: MFC platforms
<>
Sat, 20 Jan 2001 15:25:55 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: B21BC823
From: MIKE MAY <[log in to unmask]>
Subj: Re: [MFC] MFC platforms
Date: Sat, 20 Jan 2001 06:37:11 -0000

>Does Microsoft have any flavors of MFC Visual C++ on none MS platforms such
>as Unix and Mac.

There are two third party products, Mainsoft's MainWin and Bristol
Technology's Wnd/U, that allow you to port MFC programs to Unix. (Mainsoft
are responsible for porting IE to Solaris, using the Mainsoft toolkit). There
was at least one other product out at the time but it may not have made it
past beta.

[More ...]
Re: MFC platforms
Caerwyn Pearce
Mon, 22 Jan 2001 22:14:08 +0100
>Does Microsoft have any flavors of MFC Visual C++ on none MS platforms such
>as Unix and Mac.

Sorry to but in at the end of the conversation.

There was a Microsoft version of MFC for the Mac. AFAIK, it's been dropped,
I believe that it was a healthy subset of MFC not the full class. For
instance I'm sure that it didn't support some of the MFC database
functionality.

[More ...]
Re: MFC platforms
Erik Thomas
Sun, 28 Jan 2001 20:16:12 -0700
I noticed on my friend's Mac that the very latest MS Office for Mac
has all the regular MFC runtime DLLs installed, including mfc42.dll,
msvcrt.dll, etc. Even if they don't provide the VC++ (devstudio) IDE
on Mac, there must be a way to port MFC apps from PC to Mac using
runtime libraries, or else MS is doing some voodoo they won't share
with the rest of us.

[More ...]
Capturing keystrokes
Dewey Harris
Thu, 18 Jan 2001 05:16:00 -0800
Reply
Environment: Win95/NT4.0 (sp3) VC++6.0 (sp5)

I have an application where I need to grab every
keystroke (both down and up) in a dialog and in a
CScrollView derived class in a CMDIChildFrame. When I
just overrode
OnKeyDown/OnKeyUp/OnSysKeyDown/OnSysKeyUp in the
dialog, I captured almost everything except the
Windows key (which, by the way, doesn't seem to
generate a WM_KEYUP message). By overriding
PreTranslateMessage for the dialog and not calling the
base class, I even grabbed this key exclusively for my
app.

[More ...]
Reply
Show Replies 3 Replies
Re: Capturing keystrokes
Stuart F Van Weele
Mon, 22 Jan 2001 11:31:21 -0500
I don't think there is any reasonable way to completely capture the keyboard
just using PreTranslateMessage. The keyboard input model in the platform
SDK shows keystrokes passing through the keyboard device driver and system
message queue before reaching the application message queue. My guess is
that the system sends its own messages whenever a windows keydown message is
sent to its queue. You might be able to completely capture the keyboard if
you used DirectInput, which bypasses the system message queue.

[More ...]
Re: Capturing keystrokes
Shawn Fessenden
Sun, 28 Jan 2001 15:43:32 -0600
Hi Dewey.

> I have an application where I need to grab every
> keystroke (both down and up) in a dialog and in a
> CScrollView derived class in a CMDIChildFrame.

In this instance, I'd say a thread specific keyboard filter would be ok
(look for SetWindowsHookEx & KeyboardProc). I generally shy away from these
hooks because they tend to slow things down. I can't see where even 300WPM
would tax a Pentium though :)
-SHAWN-
"Geek use to be a four letter word. Now it's a six figure one."
Re: Capturing keystrokes
Erik Thomas
Sun, 28 Jan 2001 20:30:18 -0700
If you want to use an easy-to-use 'hook' for all messages throughout
your application, check out CWinApp::ProcessMessageFilter. If you do
something like the following, you can intercept every message in
your app:

BOOL CYourApp::ProcessMessageFilter(int code, LPMSG lpMsg)
{
if (lpMsg->message == WM_KEYDOWN || lpMsg->message == WM_KEYUP)
... // etc.
}

I've used this technique with great success to intercept messages
before they are routed anywhere else in your applicaiton. It may or
may not be reliable for what you want to do, but it's more efficient
than a system or journal hook because it's confined to your
application, i.e., it's

[More ...]
Dropping out document and view
Mario Pereira
Thu, 18 Jan 2001 11:03:43 -0000
Reply
Env: VC5sp3, NT, 9x, Me, 2k

Hello all,

Well, after almost four years doing MFC apps, this had to come: I need to make a simple app which should use MFC but don't need nothing like docs and views...

I've started with the MFC Wizard, selected a SDI app and then tryed to modify CMyApp::InitInstance() to remove the doc and view classes and create the CMainFrame, but I don't know how to create the CMainFrame. The docs only say that is possible, but don't give examples nor they explain how to do it...

[More ...]
Reply
Show Replies 4 Replies
Re: Dropping out document and view
David Elliott
Sat, 20 Jan 2001 08:32:48 -0800
Have you considered making a dialog-based app? You can add a menu to a dialog, and still use a lot of the other MFC functionality.

David Elliott - [log in to unmask]
"I have one right here...!"
Visit me at http://www.dcell.com
----- Original Message -----
From: "Mario Pereira" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Thursday, January 18, 2001 3:03 AM
Subject: Dropping out document and view

[More ...]
Re: Dropping out document and view
Roberts, Brian M
Mon, 22 Jan 2001 07:25:05 -0600
MFC does support very simple applications, but as you've discovered, it is
not clear how. Even the VC6 AppWizard still adds a lot of unnecessary
pieces. I learned how to do this from a book called "Programming Windows 95
with MFC" (I think), however I can't remember the author.

The smallest MFC application with a simple window is shown below. Note that
there are *many* missing pieces -- but this will display a window with menu,
icon, title etc. You can also use a CWnd instead of a CFrameWnd, which is
probably more appropriate for your bitmap only needs.

[More ...]
Re: Dropping out document and view
Peter Sherwood
Wed, 24 Jan 2001 20:22:47 -0500
At 07:25 AM 1/22/01 -0600, you wrote:
>MFC does support very simple applications, but as you've discovered, it is
>not clear how...I learned how to do this from a book called "Programming
Windows 95
>with MFC" (I think), however I can't remember the author.

Jeff Prosise (Microsoft Press). A new (1999) edition is called "Programming
Windows with MFC" (2nd ed); it's about 300 pages longer.
Re: Dropping out document and view
Shawn Fessenden
Sun, 28 Jan 2001 15:35:23 -0600
Hey Mario.

> come: I need to make a simple app which should use MFC but
> don't need nothing like docs and views...

My advice would be to skip MFC altogether in that case. It's VERY doc/view
oriented. If you want to use stuff like CString & CRect & all, just include
afxwin.h in your .cpp.
Send data to printer driver with a change in font height (10 points) using Escape PASSTHROUGH function
Srinivas Chebolu
Wed, 17 Jan 2001 12:40:11 -0800
Reply
Environment - NT4.0 SP5, VC++ 6.0 SP4

I am trying to send formatted text data (with carriage returns, form feeds,
...) to printer driver.
The problem I am having here is that the font height is not changing. The
document is always printing with standard 12 points.

I have to use Escape() function. Has anyone had any ideas about this
problem.
Any help would be greatly appreciated.

[More ...]
Reply
Show Replies 1 Reply
Re: Send data to printer driver with a change in font height (10 points) using Escape PASSTHROUGH function
Peter Sherwood
Sat, 20 Jan 2001 11:15:42 -0500
At 12:40 PM 1/17/01 -0800, you wrote:
>I am trying to send formatted text data (with carriage returns, form feeds,
>...) to printer driver.
>The problem I am having here is that the font height is not changing. The
>document is always printing with standard 12 points.
>
>I have to use Escape() function.

I suggest you not write your printer code using the pass-through (Escape
function). Instead, use CreateFont to make the size and typeface you want,
then use TextOut calls to print the text. It's much easier, and your code
will work with any printer.
Change Font of Menu
Schmidt-Ott, Susanne
Wed, 17 Jan 2001 07:26:16 +0100
Reply
Environment: VC++ 6.0 with SP4, Windows NT 4.0

Does anyone know how to change the Font of a menu. I have an SDI application
with a menu resource and I want to change the Font for the complete menu. A
code example would be very helpful.

Thanks,
Susanne
Reply
Show Replies 1 Reply
Re: Change Font of Menu
<>
Fri, 19 Jan 2001 21:52:36 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 0144876F
From: Farhan Noor Qureshi <[log in to unmask]>
Subj: RE: Change Font of Menu
Date: Wed, 17 Jan 2001 14:23:01 -0800

>Does anyone know how to change the Font of a menu.

You have to owner draw it. See codeguru for examples.

===== Digest Separator =====

Mesg: BC75947C
From: JON KYLE <[log in to unmask]>
Subj: Re: Change Font of Menu
Date: Wed, 17 Jan 2001 17:19:18 -0500

[More ...]
Constant Assigned Strings
Simon Holman
Wed, 17 Jan 2001 16:56:24 +1100
Reply
Environment: VC++ 6.0, Windows NT 4.0

I'm trying to write a app that talks to a database
via Embedded SQL statements. The app is designed to run
continuously, looping through a small amount of code.
The Problem is that while generating the SQL statements,
memory is leaked by Constant Assigned Strings.
eg. CString fred = "fred";

[More ...]
Reply
Show Replies 3 Replies
Re: Constant Assigned Strings
Martin Bonner
Thu, 18 Jan 2001 10:27:29 -0000
> -----Original Message-----
> From: Simon Holman [mailto:[log in to unmask]]
> Sent: 17 January 2001 05:56
> Subject: Constant Assigned Strings
>
>
> Environment: VC++ 6.0, Windows NT 4.0
>
> I'm trying to write a app that talks to a database
> via Embedded SQL statements. The app is designed to run
> continuously, looping through a small amount of code.
> The Problem is that while generating the SQL statements,
> memory is leaked by Constant Assigned Strings.
> eg. CString fred = "fred";
>
> The following code written to check memory usage:
>
> void CTestSQLStringDlg::OnButton1() {


[More ...]
Re: Constant Assigned Strings
Peter Sherwood
Sat, 20 Jan 2001 11:11:24 -0500
At 10:27 AM 1/18/01 +0000, you wrote:
>> The Problem is that while generating the SQL statements,
>> memory is leaked by Constant Assigned Strings.
>> eg. CString fred = "fred";
...
>> The Results (irrelevant data removed) were, after two loops:
>> mdiff - Total allocations: 18 bytes.
>> m1 - Total allocations: 7240 bytes.
>> mdiff - Total allocations: 18 bytes.
>> m1 - Total allocations: 7258 bytes.
>>
>> As can be seen, each time through the loop, the Total Memory
>> Allocations
>> increases by 18 bytes.

[More ...]
Re: Constant Assigned Strings
Shawn Fessenden
Sun, 28 Jan 2001 14:40:24 -0600
Ah, Simon.

> void CTestSQLStringDlg::fred(){
> CString string ="hello";
> }

Your analysis is flawed. In this function, string is an automatic variable
on the stack. As soon as the function exits, it goes out of scope and
storage space is deallocated by the dtor. There's no leak at all.
HTTPS Connection
f-invest
Tue, 16 Jan 2001 15:16:24 -0200
Reply
Environment: VC++ 6.0, Windows NT 4.0

I'm using the class CInternetSession to make a
request to a HTTPS site (in the Intranet). But when I
use the method OpenURL an error occurs (The certificate
authority is invalid or incorrect). I tried to use
another functions but the same error occurs. I tried to
use the flag INTERNET_FLAG_IGNORE_CERT_CN_INVALID but
the error still happens.
I'm providing the code below. I hope some help.

[More ...]
Reply
Show Replies 2 Replies
Re: HTTPS Connection
<>
Wed, 17 Jan 2001 14:14:41 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: F51CBD2E
From: ENRICO QUERCI <[log in to unmask]>
Subj: Re: HTTPS Connection
Date: Wed, 17 Jan 2001 10:14:27 -0000

>I'm using the class CInternetSession to make a request to a HTTPS site (in the
>Intranet). But when I use the method OpenURL an error occurs (The certificate
>authority is invalid or incorrect).

If you define fResp as CStdioFile*, the OpenURL method expects an URL type
like "file://something.somethingelse". In order to use an URL like
"http://somewhere.somewhereelse", try defining fResp as CHttpFile* !

[More ...]
Re: HTTPS Connection
David Elliott
Wed, 17 Jan 2001 14:58:46 -0800
I don't quite understand the first answer. My C++ may be a little rusty, but I'm pretty sure there's nothing wrong with declaring
fResp as a CStdioFile *, as long as you aren't accessing the HTTP-specific members of the class.

David Elliott - [log in to unmask]
"I'm equally as famous!"
Visit me at http://www.dcell.com
----- Original Message -----
From: <[log in to unmask]>
To: <[log in to unmask]>
Sent: Wednesday, January 17, 2001 2:14 PM
Subject: Re: HTTPS Connection

[More ...]
OnBeginDrag() of my tree control is not being called
Farhan Noor Qureshi
Mon, 15 Jan 2001 15:18:17 -0800
Reply
Hi,

Env: VC++ 6 SP4, Windows NT 4 SP5, IE 5.5

I have derived a class from CTreeCtrl and want to handle OnBeginDrag() in my
class. In the parent (property page) I have included
ON_NOTIFY_REFLECT(TVN_BEGINDRAG, OnBeginDrag) and corresponding header and
cpp file modifications. I have also made sure that my tree control *DOES
NOT* have TVS_DISABLEDRAGDROP and checked with SPY++. I also added
COleDropTarget::Register(this) in CMyTreeCtrl::OnCreate(LPCREATESTRUCT
lpCreateStruct) and it returns TRUE.

[More ...]
Reply
Show Replies 3 Replies
Re: OnBeginDrag() of my tree control is not being called
Teemu Piiroinen
Wed, 17 Jan 2001 11:20:30 +0200
Have you called AfxOleInit() in your InitInstance??

----- Original Message -----
From: "Farhan Noor Qureshi" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Tuesday, January 16, 2001 1:18 AM
Subject: OnBeginDrag() of my tree control is not being called

> Hi,
>
> Env: VC++ 6 SP4, Windows NT 4 SP5, IE 5.5
>
> I have derived a class from CTreeCtrl and want to handle OnBeginDrag() in
my
> class. In the parent (property page) I have included
> ON_NOTIFY_REFLECT(TVN_BEGINDRAG, OnBeginDrag) and corresponding header and
> cpp file modifications. I have also made sure that my tree control *DOES
> NOT* have TVS_DISABLEDRAGDROP

[More ...]
Re: OnBeginDrag() of my tree control is not being called
<>
Fri, 19 Jan 2001 21:52:39 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 0A5AB2FD
From: VYTLA, VENUGOPALA KRISHNA <[log in to unmask]>
Subj: RE: OnBeginDrag() of my tree control is not being called
Date: Wed, 17 Jan 2001 14:20:49 -0800

>I have derived a class from CTreeCtrl and want to handle OnBeginDrag() in my
>class. In the parent (property page) I have included
>ON_NOTIFY_REFLECT(TVN_BEGINDRAG, OnBeginDrag) and corresponding header and cpp
>file modifications. I have also made sure that my tree control *DOES NOT* have
>TVS_DISABLEDRAGDROP and checked with SPY++. I also added
>COleDropTarget::Register(this) in CMyTreeCtrl::OnCreate(LPCREATESTRUCT
>lpCreateStruct) and it returns TRUE. I need to handle the begin-drag inside
>the tree.

[More ...]
Re: OnBeginDrag() of my tree control is not being called
Michael Carruth
Sat, 20 Jan 2001 02:33:00 -0500
Replace your message map entry with:
ON_NOTIFY_REFLECT(TVN_BEGINDRAGA, OnBeginDrag) // ascii
ON_NOTIFY_REFLECT(TVN_BEGINDRAGW, OnBeginDrag) // unicode

----- Original Message -----
From: <[log in to unmask]>
To: <[log in to unmask]>
Sent: Saturday, January 20, 2001 12:52 AM
Subject: Re: OnBeginDrag() of my tree control is not being called

> Moderator's Direct Message/Digest
> William Dempsey [log in to unmask]
>
> Mesg: 0A5AB2FD
> From: VYTLA, VENUGOPALA KRISHNA <[log in to unmask]>
> Subj: RE: OnBeginDrag() of my tree control is not being called
> Date: Wed, 17 Jan 2001 14:20:49 -0800
>
> >I have derived a class from CTreeCtrl and want to handle OnBeginDrag() in
my
> >class. In the parent (property

[More ...]
OnCtlColor() problem
Dave Johnson
Sun, 14 Jan 2001 02:09:30 -0500
Reply
Environment: Windows 98, VC 6.0

Question with OnCtlColor()
Reply
Show Replies 2 Replies
Re: OnCtlColor() problem
<>
Wed, 17 Jan 2001 14:14:44 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: F9797DF0
From: HUGO CARVAJAL M. <[log in to unmask]>
Subj: RE: OnCtlColor() problem
Date: Wed, 17 Jan 2001 14:33:19 -0400

>I need to be able to change the background color of a specified Edit Control
>when a certain condition exists,

You can do this:

MyDlgClass::OnCtlColor(..., Cwnd *pWnd, ...)
{
CWnd *pMySpecificControl;
pMySpecificControl = GetDlgItem(MY_SPECIFIC_CONTROL_ID)
if(pWnd == pMyspecificControl)
{
.... here change the background color of your edit ...
}
}

[More ...]
Re: OnCtlColor() problem
Shawn Fessenden
Sun, 28 Jan 2001 13:54:35 -0600
Hey Dave.

> i dont exactly know how to
> compare the window handle
> passed in the second parameter
> of OnCtlColor() with ONLY the
> single control that i want to change.

Any class derived from CWnd has a member, m_hWnd, that is the window handle
of the associated Windows window. This is how you can tell what's what:

[More ...]
Dialog mysteriously exits immediately-solved
Peter Sherwood
Sat, 13 Jan 2001 19:03:30 -0500
Reply
My original question was

>>In my application with two dialogs, the second one disappears immediately
with
>>no user interaction. Why?

The correct answer is that when a dialog is the main window, and it is
destroyed, Windows sends a WM_QUIT message to shut down the application.
The Wizard generates code makes the first dialog the main window with the
statement "m_pMainWnd = &dlg;". Although MS says this behavior is "by
design", it seems pretty stupid to me, since you might want to do something
after the dialog window is closed (such as process the data!).

[More ...]
Reply
No Replies
Unresponsiveness while Transferring Large Files
Adams, Dick
Thu, 11 Jan 2001 14:37:52 -0600
Reply
Environment: VC++ 6.0, Windows 2000

I have an FTP application that uses CFtpConnection. When transferring a very
large file, the system is unresponsive to the mouse and keyboard, apparently
because messages are not being pumped. I tried using
CInternetSession::OnStatusCallback, but it doesn't seem to make any calls
*during* the file transfer, only before & after.
Does anyone know how to make the system respond during a length file
transfer with CFtpConnection?
Reply
Show Replies 1 Reply
Re: Unresponsiveness while Transferring Large Files
PJ Naughter
Sat, 13 Jan 2001 13:46:22 +0000
On Thu, 11 Jan 2001 14:37:52 -0600, you wrote:

>Environment: VC++ 6.0, Windows 2000
>
>I have an FTP application that uses CFtpConnection. When transferring a very
>large file, the system is unresponsive to the mouse and keyboard, apparently
>because messages are not being pumped. I tried using
>CInternetSession::OnStatusCallback, but it doesn't seem to make any calls
>*during* the file transfer, only before & after.
>Does anyone know how to make the system respond during a length file
>transfer with CFtpConnection?
>

[More ...]
Dialog mysteriously exits immediately
Peter Sherwood
Tue, 9 Jan 2001 15:34:34 -0500
Reply
VC 6, SP3, W98

Summary: In my application with two dialogs, the second one disappears
immediately with no user interaction. Why?

Deatils: I created a dialog-based application. The Wizard-generated code looks
like

BOOL CABCDFrontEndApp::InitInstance()
{
...
CMyDialog dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
etc.

Everything works fine. Now I added code for a second dialog, to be displayed
after the first one is dismissed. The added code is

[More ...]
Reply
Show Replies 1 Reply
Re: Dialog mysteriously exits immediately
muayyad
Thu, 1 Feb 2001 01:02:44 +0200
You can create Hidden Window
m_pMainWnd = &(CMyHiddenWindow);

Then Create A thread that will create the first dialog
and when u exist the first dialog,let the ExitInstance to send a message to
the CWinApp to Create A second Thread that will create the second dialog

And when u want to exit the Application Send WM_CLOSE to CWinApp

[More ...]
ODBC database path ?
Patrick Davis
Sat, 6 Jan 2001 22:30:32 -0500
Reply
MSVC++ 6.0, MFC

I'm using an Access type ODBC database in an MFC
application. When the application is installed , the user can select
any location for the database file. InstallShield registers the database
on the system.

I need to extract the path to the ODBC based database file
(Access type) thats installed the system at installation.. I have checked
documentation
but am unable to find a method. There must be a way to do this since its
a system regsistered database. Any help would be greatly appreciated.

[More ...]
Reply
No Replies
Combining 2 Projects (Resources)
Matt Harmon
Tue, 2 Jan 2001 09:09:32 -0800
Reply
I am trying to combine two projects together. What is the best way to
combine the resources, since they are most likely using some of the same
Resource ID #s?

Most Sincerely,
matt

ps: VisualC++6.0,Windows200Pro,all the latest SPacks and SDKs..
Reply
Show Replies 3 Replies
Re: Combining 2 Projects (Resources)
<>
Wed, 3 Jan 2001 20:02:57 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 5443130D
From: Phil Daley <[log in to unmask]>
Subj: Re: Combining 2 Projects (Resources)
Date: Wed, 03 Jan 2001 08:17:16 -0500

>I am trying to combine two projects together. What is the best way to combine
>the resources, since they are most likely using some of the same Resource IDs?

Renumber one of the files, either by hand, if it is small, or load it into
excel and renumber it with a formula, if it is large. We assign a range of
resource ids for each of our projects so that they never conflict.

[More ...]
Re: Combining 2 Projects (Resources)
Sankalp Ahuja
Thu, 4 Jan 2001 14:13:43 +0200
I think, it can also be done by other than resource id modification. I have
two projects in my workspace, one as a static library and other as exe and
exe is linked with static library and I am able to use static library
resources.

Let us say exe is ProjectA then its resource files are resource.h and
resource.hm and projectA.rc, and res directory
Let us say library is ProjectB then its resource files are resource.h and
resource.hm and projectb.rc and res directory, you can rename your projectB
resource header and help ids as projectBres.h( a unique name) and
projectBres.hm(

[More ...]
Re: Combining 2 Projects (Resources)
Andy Metcalfe
Mon, 15 Jan 2001 11:51:23 +0000
I have a free utility/ VC6 add-in which can renumber resources for you.
Visit www.resorg.co.uk for details.
Closing a CAsyncSocket object in another thread
Mehdi Kavousian
Tue, 2 Jan 2001 10:34:17 +0330
Reply
Hi All,

Environent: NT 4.0 SP4, VC++ 6.0 SP3

I am using CAsyncSocket class to make Sever/Client TCP/IP link.

As I want to check if the socket connection for the client can be done,
I put the Connect function in a "while" loop. I don't want this capture my
main thread so I put connect method in another thread.
The problem is: when I want to close my Socket object in the main
thread, I get to an ASSERT error in "sockcore.cpp" MFC source file.
(There is no problem in compile and link). As I traced the error it cannot

[More ...]
Reply
Show Replies 2 Replies
Re: Closing a CAsyncSocket object in another thread
<>
Wed, 3 Jan 2001 20:02:55 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: BE1A2506
From: =?ISO-8859-1?Q?RUBEN_J=F6NSSON?= <[log in to unmask]>
Subj: Re: Closing a CAsyncSocket object in another thread
Date: Wed, 3 Jan 2001 08:01:11 +0100

>I am using CAsyncSocket class to make Sever/Client TCP/IP link. As I want to
>check if the socket connection for the client can be done, I put the Connect
>function in a "while" loop. I don't want this capture my main thread so I put
>connect method in another thread. The problem is: when I want to close my
>Socket object in the main thread, I get to an ASSERT error in "sockcore.cpp"


[More ...]
Re: Closing a CAsyncSocket object in another thread
<>
Fri, 5 Jan 2001 12:29:14 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: B967AC21
From: Sreejith Sreedhar <[log in to unmask]>
Subj: Re: Closing a CAsyncSocket object in another thread
Date: Thu, 4 Jan 2001 08:39:26 +0530 (IST)

>I am using CAsyncSocket class to make Sever/Client TCP/IP link. As I want to
>check if the socket connection for the client can be done, I put the Connect
>function in a "while" loop. I don't want this capture my main thread so I
>put connect method in another thread. The problem is: when I want to close my
>Socket object in the main thread, I get to an ASSERT error

[More ...]
Removing images from a tree dynamically
Rajesh Thattakath
Sat, 30 Dec 2000 22:50:26 -0500
Reply
Hi Friends,

Platform: NT 4.0 SP4, VC++ 6.0 SP3

I have a CTreeCtrl derived class in one of my dialog box. The tree has
images (Using image list)and text.

On a button click I would like to remove all the images on the tree.
And also on another action to add back the images.

I am checking to see if this kind of dynamic loading/removing of images is
possible or not ? (Without recreating the whole tree, again).

[More ...]
Reply
Show Replies 1 Reply
Re: Removing images from a tree dynamically
Craig Henderson
Tue, 2 Jan 2001 12:23:33 -0000
Hi Rajesh,

I have not tried this, but in theory you should be able to call
CTreeCtrl::SetImageList(NULL, TVSIL_NORMAL);

Good Luck
Craig
[log in to unmask]

-----Original Message-----
From: MFC -- Microsoft Foundation Classes
[mailto:[log in to unmask]]On Behalf Of Rajesh Thattakath
Sent: 31 December 2000 03:50
To: [log in to unmask]
Subject: Removing images from a tree dynamically

Hi Friends,

Platform: NT 4.0 SP4, VC++ 6.0 SP3

I have a CTreeCtrl derived class in one of my dialog box. The tree has
images (Using image list)and text.

[More ...]
GDI resource leak CDC::CreateCompatibleDC,DeleteDC
Peter Sherwood
Fri, 22 Dec 2000 22:55:50 -0500
Reply
VC 6, SP3, W98

I have code in a function called by OnPaint that looks like
function m(...args...)
{
...
CDC maskDC; maskDC.CreateCompatibleDC(pDCSrc);
maskDC.SetMapMode(pDCSrc->GetMapMode());
CBitmap mask; mask.CreateBitmap(widthSrc,heightSrc,1,1,NULL); // 1
plane, 1 bit/pixel
CBitmap *pOldBitmapMask=maskDC.SelectObject(&mask);

[operations with the bitmap 'mask']

maskDC.DeleteDC(); <------- why is this necessary?
return;
}

What I have found is that if the maskDC.DeleteDC() is omitted, GDI resources
are used up after about 700 calls to function m. If it is included, there is no
GDI resource leak. Yet Proise says "If the CDC object to which you attach the
DC is created on the stack, deletion is

[More ...]
Reply
Show Replies 1 Reply
Re: GDI resource leak CDC::CreateCompatibleDC,DeleteDC
Craig Henderson
Tue, 2 Jan 2001 12:08:10 -0000
Hi Peter,
I am confused by your observations, but offer my comments in the hope that
they will be of use.
Try replacing the (apparently unnecessary) line
maskDC.DeleteDC();
with
maskDC.SelectObject(pOldBitmapMask);

I think I am right in saying that if you do not deselect the image out of
the DC then the CBitmap destructor will fail to delete to bitmap and that
could be the source of your resoure leak. However, that does not explain why
the maskDC.DeleteDC(); removes the resource leak. Like you say, the
destructor of the DC, as with all GDI wrapper classes, should destroy the
GDI object,

[More ...]
Print PreView Buttons
Ron
Thu, 21 Dec 2000 12:32:53 -0500
Reply
Platform: NT 4.0 SP6, VC++ 6.0 SP4

Is there any way to access the Print Preview Buttons Programatically? I
want to enable-disable certain buttons and maybe hide others from
within my program.

Thanks
Reply
Show Replies 1 Reply
Re: Print PreView Buttons
Evgeny Berezkin
Thu, 4 Jan 2001 21:08:38 +0100
During PrintPreview special CDialogBar is created as child of MainFrame.
So, it can be easily retrieved:

CDialogBar* pBar = STATIC_DOWNCAST(CDialogBar,
AfxGetMainWnd()->GetDlgItem(AFX_IDW_PREVIEW_BAR));

Having pointer to pBar, you can do anything with it's buttons:
For instance, you can hide Next button:

pBar->GetDlgItem(AFX_ID_PREVIEW_NEXT)->ShowWindow(SW_HIDE);

Note, that this code will work properly only during PrintPreview mode!
Before and after PrintPreview mode GetDlgItem(AFX_IDW_PREVIEW_BAR) will fail
(return NULL).

[More ...]
Dialog
Sreejith Sreedhar
Thu, 21 Dec 2000 13:51:22 +0530
Reply
Env winnt 4.0
VC 6.0
Hi all,
I want to create a modeless dialog which always remeains on the
top.i.e if word application and my application are running and my
application is minimized then dialog should be shown over word
application.
Is this possible?
Thanks in advance
Sreejith
Reply
Show Replies 1 Reply
Re: Dialog
swadha Bhat
Tue, 26 Dec 2000 09:56:46 -0800
Hi Sreejith,
We cannot do this with Win98 and higher as MS took this feature out. The
following lines of code will do the trick but MS says it does not comply with
their UI guidelines. Hence, they will not support it.

#include <winuser.h>
if
(SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT,0,&dwTimeOut,SPIF_SENDWININICHANGE))

{

SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT,0,0,SPIF_SENDWININICHANGE);
SetForegroundWindow(hDlg);

SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT,0,&dwTimeOut,SPIF_SENDWININICHANGE

);
}

You will have to add these lines depending on the version you are using.
#define SPI_GETFOREGROUNDLOCKTIMEOUT 0x2000
#define SPI_SETFOREGROUNDLOCKTIMEOUT 0x2001

[More ...]
Slow drawing with StretchDIBits
Stanislav Koncebovski
Thu, 21 Dec 2000 08:42:04 +0100
Reply
Environment: VC++ 6.0 WinNT 4.0 SP 4

Hallo,
I've been writing an app, one of the tasks of which is to read images from
files or from
a grabber and to show them on the screen.

The drawing function of my image class uses the ::StretchDIBits (...)
function;
with relatively big images (say >= 256 * 256 pix) the screen picture can be
seen
being redrawn (e.g. while resizing the window), even in release mode .

[More ...]
Reply
Show Replies 2 Replies
Re: Slow drawing with StretchDIBits
Stas Desy
Sun, 24 Dec 2000 14:25:48 -0800
Hi Stanislav,
The difference has to do with the way StretcBlt is invoked.
If it is invoked in the paint message then Windows deletes the background
with WM_ERASE_BACKGROUND msg and then calls paint msg.
In order to prevent that you can put your drawing code into
WM_ERASE_BACKGROUND handler.
One other thing to watch is the compatability to the device context you are
using i.e. the bit depth of your bitmap shoould be identical
to those of the DC in use.
If you use 256 color mode there is a special technique as to how you can
speed (5times) your blitting

[More ...]
Re: Slow drawing with StretchDIBits
Craig Henderson
Tue, 2 Jan 2001 12:17:15 -0000
To avoid flicker, see Keith Rule's excellent article on Code Project at
http://www.codeproject.com/gdi/flickerfree.asp. Check the DC compatibility
as well, if StrechDIBits has to resize and colour map, then this will slow
the process down. Finally BitBlt works faster when the window is Byte
Aligned. It don't know if this is the same for StretchDIBits, but it would
be worth a try. Override CWnd::PreCreateWindow() and set the class name to
one with CS_BYTEALIGNCLIENT, eg

[More ...]
Annoying behaviour of a RichEdit control
Mike Hammar
Wed, 20 Dec 2000 10:21:38 -0600
Reply
Platform: NT 4.0 SP4, VC++ 6.0 SP3
I inherited a project that is a tabbed dialog. On two of the dialogs there
are Rich Edit controls that load text files that my users are allowed to
edit. When I look at the properties of each of these controls they look
identical. When my users load a file into one of the controls and then
immediately scroll down with the vertical scroll bar they can start to edit
the file. In the the other control if they load a file and then scroll
down and try to mouse click inside the

[More ...]
Reply
Show Replies 1 Reply
Re: Annoying behaviour of a RichEdit control
Martin Bonner
Fri, 22 Dec 2000 11:12:30 -0000
> -----Original Message-----
> From: Mike Hammar [mailto:[log in to unmask]]
> Sent: 20 December 2000 16:22
> Subject: Annoying behaviour of a RichEdit control
>
> I inherited a project that is a tabbed dialog. On two of the
> dialogs there are Rich Edit controls that load text files
> that my users are allowed to edit. When my users load a file
> into one of the controls and then immediately scroll down
> with the vertical scroll bar they can start to edit the file.
> In the the other control if they load a file and then scroll


[More ...]
ClassWizard Bug? - int value member variable for a listbox not av ailable via ClassWizard
Joe Etzel
Tue, 19 Dec 2000 12:27:32 -0800
Reply
Hello,

I am using VC 6.0 enterprise/SP4.

In previous versions of VC I was able to add an integer member variable for
a listbox control using the ClassWizard.

Recently I was starting a new application and was not able to do this. Is
this a bug?

Has anyone else encountered this?

Thanks

Joe
Reply
No Replies
automation getobject call to mfc app fails
Pete MacLiesh
Sun, 17 Dec 2000 00:06:29 -0800
Reply
Environment: VC++ 6.0, Windows ME, Windows 2000

Venturing into automation land for the first time here ... I created a
little almost default MFC app and added the bits (appwizard) so the Document
class was "automation enabled" (DISPATCH_MAP, INTERFACE_MAP etc).

Then, as a test I tried a couple of javascript programs:

1) CreateObject:
var o = WScript.CreateObject("Oea1.Document");
...

[More ...]
Reply
No Replies
Bitmaps
Penina Weiss
Sun, 17 Dec 2000 09:02:44 +0200
Reply
Environment: VC++ 6.0, NT 4.0

Does anyone know if there is a limitation
to the number of Bitmaps I can add to the resource
of a Dialog based MFC application?

Thank-you.
Reply
Show Replies 2 Replies
Re: Bitmaps
Stas Desy
Mon, 18 Dec 2000 09:22:52 -0800
Hi Pnina,
I've managed to add ~100 bitmaps to my project.
I haven't heard of any limit imposed by VC environment.
But if you stumble into a limit (which I presume is pretty big) you can
always load bmps from disk.
Regards,
Stas
----- Original Message -----
From: "Penina Weiss" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Saturday, December 16, 2000 11:02 PM
Subject: Bitmaps

[More ...]
Re: Bitmaps
<>
Wed, 20 Dec 2000 21:27:03 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: 6A796AC5
From: MRITUNJAY KUMAR RAI <[log in to unmask]>
Subj: Re: Bitmaps
Date: Wed, 20 Dec 2000 09:29:45 +0530

>Does anyone know if there is a limitation to the number of Bitmaps I can add
>to the resource of a Dialog based MFC application?

long back(NT4,VC5.0) we were stuck after adding arround 128/258 control on a
dialog. So we used splitter window. So in my view the limits on the number of
control(be a bitmap,..) on a dialog resource is max 256.

[More ...]
Can't set pixels in memory device context
Simon Robinson
Sun, 17 Dec 2000 04:15:33 -0000
Reply
I wonder if anyone can help with this problem (on Visual
Studio 6, Windows 98), MFC SDI application.

In my CProjectView::OnDraw() function, I do the drawing by
setting a large number of pixels individually, using the
CDC::SetPixel() method - I don't do anything else while drawing
(which means I never need to select any GDI object into the device
context). This
works fine when I set the pixels directly in the display device
context. However, to improve performance I'd rather set
the individual pixels in a memory DC and do a BitBlt into the
display DC - and I can't

[More ...]
Reply
Show Replies 1 Reply
Re: Can't set pixels in memory device context
<>
Mon, 18 Dec 2000 16:16:36 -0800
Moderator's Direct Message/Digest
William Dempsey [log in to unmask]

Mesg: F0514882
From: Stuart F Van Weele <[log in to unmask]>
Subj: RE: Can't set pixels in memory device context
Date: Mon, 18 Dec 2000 10:29:30 -0500

>In my CProjectView::OnDraw() function, I do the drawing by setting a large
>number of pixels individually, using the CDC::SetPixel() method - I don't do
>anything else while drawing (which means I never need to select any GDI object
>into the device context). This works fine when I set the pixels directly in
>the display device context. However, to improve performance I'd rather set the
>individual pixels in a memory DC

[More ...]
Bitmap Image Switching
Dave Johnson
Sat, 16 Dec 2000 10:25:17 -0500
Reply
Environment: VC++ 6, Win98

Bitmap Image Switching
Reply
Show Replies 2 Replies
Re: Bitmap Image Switching
Craig Henderson
Tue, 19 Dec 2000 16:15:09 -0000
I suspect it is a resource leak problem. From your load snippet, you
repeated load the Bitmap from the binary's resource but never seems to free
the memory. Load the image once and store the handle in a global variable
(even better, create a class a store the handle as a member variable). Use
the DeleteObject() Win32 API to destroy the bitmap handle when you are thru.

[More ...]
Re: Bitmap Image Switching
Chase Thomas
Sat, 23 Dec 2000 00:21:08 -0600
That is exactly what the problem is. I wrote a poker game about a year ago
and had this same problem using GDI bitmaps in an SDI application.
So what I did was load the resouce in OnInitialUpdate() and then simply blt
the bitmaps whenever i needed to in my drawing methods. This completely
eliminated
all the assertions. Another thing to note, the reason that I suspected a
memory leak was the fact that if I ignored the assertion or simply ran
the project in release mode, the bitmaps would start to disappear after
about 50 plays. So your best

[More ...]


ATOM RSS1 RSS2

COMMUNITY.LSOFT.COM CataList Email List Search Powered by LISTSERV