|
It is in your App clas. Look for the class that says CSomeApp, with Some replaced with the name you chose. If it is a SDI it looks like
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME // Change this to NULL
RUNTIME_CLASS(CFlightTracerDoc),
.
.
.
J.
----------------------------
|
|
|
|
|
You must also override PreCreateWindow in CMainFrame and insert the following code
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.hMenu = NULL; // Insert this code
.
.
.
J.
----------------------------
|
|
|
|
|
I have some code that I get the following error when
Run-Time Check Failure #2 - Stack around the variable 'rasterizer' was corrupted. This only happens in debug. And it ONLY happens if i turn on the Basic Runtime Checks setting for C++ has Stack frames turned on (/RTCs).
The rasterizer variable is a stack based template class from the AGG[^] graphics lib, which makes HEAVY use of template classes.
The code in question is in the else branch of an if statement, and at runtime is NOT getting executed, and since the variable is within the scope of the else block, it's not getting instantiated either.
If I comment the chunk out, then everything is hunk dory. If I use the default settings for Basic Runtime Checks then everything is OK as well.
Is this something to be concerned about? Whoudl I just use the default settings? Is this some new behaviour introduced into the VC7 C++ compiler?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
In a debug build, the compiler generates stack frame setup code to account for every variable separately. In a release build, the optimiser works out which variables have overlapping lifetimes and allocates only enough space for the variables that can't share the same memory locations.
If you enable /RTCs, the compiler adds additional padding around any variables that it thinks could be subject to buffer overrun errors, and fills it with particular values. At the end of the function, the generated code checks to see if the values have been modified - if they have, it generates the runtime check dialog you saw.
You should leave this option turned on, and fix the buffer overflow that it detected. It could easily mean that a different variable had the overflow. To detect which variable, generate a listing file (/FAs or /FAcs) and examine the resulting .asm or .cod file to see where the compiler allocated each local variable. Alternatively you could inspect the addresses in the debugger.
If you can work out which area of memory is being corrupted, you can use the debugger's Data Breakpoint facility to discover which piece of code is writing to that address.
|
|
|
|
|
Help!
I am using Winexec to call another C++ compiled program. All at once the button won't execute the program, but I CAN start the program by double clicking it's icon.
Code I'm using:
WinExec("MyProg",SW_SHOW);
If I double click the MyProg icon, it runs fine!
The button used to work, but just quit. I am flummoxed
Any help greatly appreciated!
Richard
|
|
|
|
|
Try specifying the full filespec path, eg:
WinExec (_T("C:\Dir\MyProg.exe"), SW_SHOW);
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
why can't u guys just read the documentation!?
Don't try it, just do it!
|
|
|
|
|
WinEXec is deprecated - it may be removed from Windows at some point in the future. It's only for backwards compatibility with 16-bit Windows.
You should consider using ShellExecute or CreateProcess instead. CreateProcess is normally preferred if you know that the file is an executable.
In either case, the executable found (and even if it's found) depends on the executable search path. See CreateProcess in MSDN[^] for more details.
|
|
|
|
|
Got a weird problem here... I have some list controls that are drag sources. I use LVM_CREATEDRAGIMAGE to get the images, however this returns a solid black rectangle if the list has a background image (as set by LVM_SETBKIMAGE ). The drag image is perfect for lists that do not have a background image.
WTF? Any ideas?
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|
|
I've never used those message so I may be out on a limb here
Aren';t the drag image fro the listview partially (or wholly) dependant on how you set up the image list that you associated with the listview? Maybe the image list doesn't have the right settings for tranparent images? Just guessing
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
|
|
If anybody know link for design specification/architecture for creating Plug-in.
I am not using MFC. Only C++ Win32 SDK.
|
|
|
|
|
The Visual Component Framework[^] makes plug-ins really easy to write.
The whole framework comes in 3 libs and for your purposes you'd probably only want the FoundationKit. It allows you to define RTTI extensions to your classes, register them with a global ClassRegistry, and then be able to do all sort of dynamic queries of object instances. For plugins, you'll conceivably want to create stuff on the fly, and you can also do this, it has support for createing C++ clases from the class name or the unique ID you give the class. If your interested in this feel free to email me at ddiego@users.sourceforge.net. You can also reach me on irc at irc.freenode.net #vcf
Hope this helps
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
To open a webpage from code i can to this
ShellExecute(NULL, _T("open"), _T("http://www.codeproject.com"), NULL, NULL, SW_SHOWNORMAL);
But if I already have some web pages open in IE, The page is opened in one of them.
And I want a new instance of IE ( or whatever browser the user have installed ) to be opened.
Is there any easy way of doing that?
/Mathias
|
|
|
|
|
I Found this article.
http://www.codeproject.com/internet/urlnewwindow.asp
problem fixed.
Should have searched the site better from the start.
/Mathias
|
|
|
|
|
How can I use such large numbers in C or C++?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
The only thing that pops into mind is to use BCD arithmetic, though I haven't used it in almost two decades and then it was purely for academic reasons.
(I looked at your birthday. I haven't used BCD arithmetic since before you were born )
Joe Woodbury
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
BCD arithmetic, okay, I'll Google for it!
Tackar!
Danke!
Thanks!
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
One solution is to check out freeware math libraries. Check out CodeProject code section and CodeGuru.
Kuphryn
|
|
|
|
|
I am trying to write a program that generates track lists for music cd's. If the cd that the user has in the drive has been written with the track names etc on the disk, I want to be able to read this information from the cd.
I have no idea how to go about this . can someone help??!!
|
|
|
|
|
i think u want to be looking at the extended orange book format
"there is no spoon" biz stuff about me
|
|
|
|
|
use CDDB!
Don't try it, just do it!
|
|
|
|
|
Hello,
I want to do something whenever on of the header columns in my CListView changes in size.
For that I catch the HDN_ITEMCHANGED message. But that one is not fired in the CListView.
What I have is a message entry:
ON_NOTIFY_REFLECT(HDN_ITEMCHANGED, OnItemchanged)
I've read the article by Matt Damon 'Using the CHeaderCtrl', and he mentions something about that, but the article is based on the CListCtrl, not the CListView, so the workaroud doesn't seem applicable for me.
Anyone knows how this message is fired in the CListView?
Thanks
Wim
|
|
|
|
|
WM_NOTIFY messages are sent by a control to its parent. So HDN_* messages are sent from the header to the list. Therefore, ON_NOTIFY_REFLECT is the wrong macro to use since the message isn't sent by the list. (That would be right if you were trying to handle, say LVN_ITEMCHANGED )
Use regular ON_NOTIFY .
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|