|
How can I make a grid control cell multiline so that I can edit it like I would normally, with pressing enter between lines etc.? I have a grid control created at runtime and have tried changing the dwStyle flags in the create function but nothing happens.
|
|
|
|
|
|
What code should I put in a handler for CButton in order to close SDI application? I tried with PostMessage(WM_QUIT) , but
CDocument::OnCloseDocument() doesn't get called in this case.
CButton is created in a CFormView class.
|
|
|
|
|
|
|
The menus in the project I am working on come up in response to Alt key functionanlity but the underlined characters in the menu do not respond.
(Alt-F brings up the file menu but Alt-F X does not Exit the program). The arrow keys move me up and down and expand sub menus but the mnemonic keys just don't work. Any ideas?
|
|
|
|
|
I'm trying to write a simple C++ GUI-less app that will be activated through an IE button - the code will do one thing and one thing only, but it involves placing text into fields of another program that is already running. what I need to know is: How do I code it so I can place the appropriate text in the appropriate fields of the other application? Specifically, I am trying to work with Remedy software, and I'm trying to automate the task of creating a new profile based off the information displayed in a webpage. all i need it to do is chug through the HTML for the needed info, then put it in the appropriate fields in Remedy and save the profle. I'm looking to learn, so any guidance would be more appreciated than unexplained code. send emails to joe_public34@yahoo.com Thanks!
|
|
|
|
|
Hi,
I have a visual C++ program with a couple menus. Upon entering each menu, I have something along the lines of this:
ttc_toolTips = new CToolTipCtrl();
ttc_toolTips->Create( this);
ttc_toolTips is a CToolTipCtrl pointer. And this is called within an overriden dialog class thus the reason for the "this" parameter to Create().
I tested this program on several machines running Windows 2000. The program seems to work on most systems except just one machine. On the machine that crashes, the program will work fine at first, but when I enter, exit about 10 menus which create tool tips like the code above, The CToolTipCtrl->Create function will fail and return 0.
When Create fails I get a message in the Visual C++ debug window along the lines of "Warning: Create window failed, GetLastError returned 0x00000000". Its true I don't deallocate the CToolTipCtrl objects created from the last 10 menus, but this machine has at 512MB of memory which is double the amount of memory some of these other machines have, and on these machines with less memory the program doesn't crash after like 50+ menus.
This seems strange to me and I can only ask under what conditions the Create function of CToolTipCtrl class can fail. Does it fail when I run out of memory? Could it be a result of hardware failure or bad video drivers? Note: I stepped through in the debugger and the "this" parameter passed to Create alawys has a valid dialog pointer, however the check ASSERT(::isWindow(hwnd)) within CToolTipCtrl class fails.
I also perform memory leak detection and _ASSERTE( _CrtCheckMemory( ) ); checks in many places of my code to make sure I'm not corrupting the heap anywhere. This is driving me nuts.
Any hints?
Thanks for reading this long message!
|
|
|
|
|
What version of IE is on the 2k machine this is failing with?
|
|
|
|
|
Hi,
The version number for IE is Version 6.0.2800.1106CO. This is actually on all the machines. However, I made my program clean up after itself right away and it seems to work on that machine now even after 50+ menus. That is I deleted the CToolTipCtrl objects immediately after use.
Something I should have done before anyway but you would think it would work without deleting right away since the system has at least 512 MB of ram and thats at least 2x more ram the other more stable machines. Which I find really weird. Perhaps more memory could mean that pages are swappde from memory to disk at a slower rate and that somehow affects things.
It would be interesting to find out why create would fail though, just for future reference. Perhaps MFC keeps track of the number of windows (hwnd's) you can create?
Thanks in advance.
|
|
|
|
|
Hello,
I'm having trouble with the MS Toolbar Editor provided with VS6.0 . I'm now working on a new release of an old program, and I need to delete some buttons on the toolbar.
The problem is, I can't delete the buttons in the Bitmap itself, because the toolbareditor prompts that the Bimap file needs to be adjusted.
Besides that, I can't delete the buttons in the toolbar editor either! I don't know why and it's been eating me up all day now...
Does anyone know a simple toobar editor which can EDIT toolbars?
Thanks in advance.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
it's ok
you need left click on button that you want to remove and drag it away from IDE, the button tool bar will disappear.
|
|
|
|
|
Thanks!
To bad that you can't r-click on the toolbar...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Is there a use for enumerating registered windows messages?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I need to write a web query in C++ to obtain a stock price. The code will be used in an Excel Add-In. I can do this easily in VB using: QueryTables.Add( ... ), but cannot find a reference to a C++ implementation.
Any help appreciated.
Regards.
GWG
|
|
|
|
|
I have created a new dialog-based Project using MFC. Then I added a few other .cpp-files from older projects to this new Project.
But now I have the problem that member variables from the files created by MFC are not avaiable in the old files i added myself, although I included all avaiable headers in these files.
When I try to use them, the error "C2065: 'm_member' not declared" occurs.
All Files (both old and new) have headers like this:
#include "stdafx.h"
#include "ApplicationName.h"
#include "ApplicationNameDlg.h"
#include "DlgProxy.h"
Thank you for your help,
Ronin.
|
|
|
|
|
Like topic says... DnsQuery is only available for NT/2000/XP...
Thanks!
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® and Outlook Express®
http://www.inboxshield.com
|
|
|
|
|
are you asking how to get an ip address from a host name? if so use the gethostbyname() function
|
|
|
|
|
Thanks! I'll take a look at gethostbyname()...
---------------
Tired of Spam? InboxShield for Microsoft® Outlook® and Outlook Express®
http://www.inboxshield.com
|
|
|
|
|
I'm logging errors to a text file, and the text has the 'r\n\' escape characters in there, but it still keeps writing to one continuous line. How do I stop this?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Hi,
I just tried this
CString s = "First line\r\n";
CFile file("c:\\test.txt", CFile::modeCreate | CFile::modeWrite);
file.Write(s, s.GetLength());
s = "second line";
file.Write(s, s.GetLength());
and this is what I see in the text.txt file
First line<br />
second line
Do you see something I did differently?
Fabian
|
|
|
|
|
yes, you're writing one line at a time, whereas I was writing the whole string at once. But since I wanted to keep the previous contents of the file, I specified CFile::modeNoTruncate as one of the flags, but whatever I write is still appended to the end of the line that was previously there.
If it's broken, I probably did it
bdiamond
|
|
|
|
|
The seek to end may be truncating the \r\n on the final line.
Try adding a \r\n pair to the beginning of your string.
Brad
|
|
|
|
|
Hi,
How about this?
CString s = "\r\none more line";
CFile file("c:\\test.txt", CFile::modeCreate | CFile::modeWrite | CFile::modeNoTruncate);
file.SeekToEnd();
file.Write(s, s.GetLength());
Fabian
|
|
|
|
|
thank you BradBruce and f64!! that worked!!
If it's broken, I probably did it
bdiamond
|
|
|
|