MFC Archives

MFC -- Microsoft Foundation Classes

MFC@LISTSERV.MSN.COM

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

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
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
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
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
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
<>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Dave Johnson
Thu, 12 Apr 2001 17:21:48 -0400
Reply
Environment: VC++ 6 SP3, Win98

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

Web Browser Class Declaration Trouble
Reply
No Replies
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
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
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
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
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
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
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
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
<>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
<>
Tue, 13 Feb 2001 12:56:18 +0100
Reply
Environment: VC++ 6, Windows 2000
Reply
Show Replies 3 Replies
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
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
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
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
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
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
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
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
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
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
Srinivas S
Wed, 31 Jan 2001 09:44:56 +0530
Reply
VC 6; NT 4; SP6
Reply
Show Replies 2 Replies
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
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
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
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
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
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
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
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
<>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Dave Johnson
Sat, 16 Dec 2000 10:25:17 -0500
Reply
Environment: VC++ 6, Win98

Bitmap Image Switching
Reply
Show Replies 2 Replies


ATOM RSS1 RSS2