|
If you plan not to change the cpp file then you can compile it and create a lib file out of it. After that, if you have a location where you place your header files, you need to include it in the options by doing the following:
1. Click on Tools->Options
2. Click on the tab Directories
3. Where it says "Show directories for:" select Include files.
4. Click on the first button (it has a square) that is next to the field Directories: (or just double click on the field).
5. Add the headers' file location.
The same thing can be done for the lib files. You also have to add the lib file in the linker's options.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Hello ,
Iam in search of a vc++/WIn API code or interface which gets the list of pluggins installed for IE in the system
Cause is my effort;
Effect is God's effort
|
|
|
|
|
Hi. How do you access an xml file in C++, as well as write it and read from it.
"To teach is to learn twice"
|
|
|
|
|
|
I've programed a Hello world Dialog based app using MFC.I just a button and add MessageBox("Hello!") code,and I use Rational Purify to find the memory leaks,I always find a lot.
Why?
Thank you!
Let's roll!
|
|
|
|
|
Not every leak Purify/BC detects is the true leak.
Some like: "NoTrack" ( or "NoMemoryTrack"!? ) and SetEnv, delayLoad has to do with MFC structure, others leaks inside CryptoApis, etc has to do with crappy MS coding.
|
|
|
|
|
In addition to what Brian said, some leaks are due to improper termination. Many termination leaks are due to how the leak detecting program monitors the DLL. In some cases, they do not, or cannot, check memory in the proper spot. Regardless, these are of no real concern.
I haven't used Purify, but they should have a filter file for each compiler and library used. Be aware that on a few occasions these programs will do a false detection. I have perfectly legitimate code that totally "stumps" BoundsChecker as well as other programs.
The leaks to be concerned about are those that happen while the program is running.
|
|
|
|
|
Any clues on how to trap the standard Window | Close All command? I need to close a number of modeless dialogs before continuing with the standard operation, which closes all open views.
I suppose I could just define my own IDC_WINDOW_CLOSE_ALL command, but it seems like it's a pain to inject this menu item into the standard Windows popup.
Thanks,
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Well in ED I change the ID and do my own thing, but CWinApp::CloseAllDocuments(), CDocTemplate::CloseAllDocuments() might be of help.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi Neville,
Yes, that's my fallback solution. Do you know how to insert a custom menu item into the standard Windows popup (i.e. the one that contains an MFC generated list of view names)?
Thanks,
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi Ravi,
Have a look at CMDIFrameWnd::GetWindowMenuPopup(HMENU hMenuBar).
Assuming you are using a Menu Resource why can't you just change it there.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Yikes, I must be getting senile! Just looked at my code and found I already have a handler for a custom ID_WINDOW_CLOSE_ALL menu item in all my view classes. I copied the handler (and the menu) to the mainframe. and added the code to close all open modeless dialogs, so all is well.
Thanks for your help!
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I compiled reseditor using csc.exe. No problem. I even saved a test resource file with ".resources" extension successfully. It broke down unfortunately however when I tried to saved it as ".resx" format. Is there any place where I can download resource editor binary? I searched tucows, download.com, morpehus, microsoft msdn and google, no luck yet.
anyway, here's the problem, in case you wish to know:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Resources.ResXResourceWriter.Generate()
at System.Resources.ResXResourceWriter.Dispose(Boolean disposing)
at System.Resources.ResXResourceWriter.Dispose()
at System.Resources.ResXResourceWriter.Close()
at ResEditorComponents.ResEditor.WriteResXFile(String fileName) in C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Samples\Tutorials\resourcesandlocalization\reseditor\ResEditor.cs:line 519
at ResEditorComponents.ResEditor.SaveResources() in C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Samples\Tutorials\resourcesandlocalization\reseditor\ResEditor.cs:line 485
at ResEditorComponents.ResEditor.menuFileSave_Click(Object sender, EventArgs e) in C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Samples\Tutorials\resourcesandlocalization\reseditor\ResEditor.cs:line 469
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/windows/microsoft.net/framework/v1.0.3705/mscorlib.dll
----------------------------------------
ResEditor
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase: file:///C:/Program%20Files/Microsoft%20Visual%20Studio%20.NET/FrameworkSDK/Samples/Tutorials/resourcesandlocalization/reseditor/ResEditor.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/windows/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.3300.0__b77a5c561934e089/system.xml.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
norm
|
|
|
|
|
Any one can help me how to change my desktop wallpaper and add a desktop items to active desktop( Icon, web,...) ?
----------------------
Coding for lv,lv & di
|
|
|
|
|
hi.
you can look this example.
http://www.codeproject.com/tools/wallpaperq.asp?target=change%7Cdesktop%7Cwallpaper
good work!!;)
|
|
|
|
|
|
Hi, all
I have created a RichEdit box (version 1.0) using regular windows API (no MFC) but I can’t seem to format (using the SendMessage() function) any part of the text in the control. I have tested both formatting the paragraphs (PARAMFORMAT structure) and characters (CHARFORMAT structure) but nothing seems to get displayed. The return values (from both EM_SETPARAFORMAT and EM_SETCHARFORMAT flags) are nonzero, which indicates success. I know that I am setting the cbSize and the dwMask structure members correctly because after setting the format, I use EM_GETPARAFORMAT and EM_GETCHARFORMAT flags to check if the changes was actually made, and it is (but just not displayed). This experience is really strange, I really don’t know what I am doing wrong or missing. And I can’t seem to find any examples on formatting text in a Rich Edit without using MFC. Any ideas on how to solve this or find any examples are greatly appreciated.
Thanks in advance
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
hehe... I found the problem, when I declared the PARAMFORMAT and the CHARMFORMAT structures I forgot setting them to zero, which caused the variable members (who wasn’t later set to any specific value) to have unpredictable values. Anyways it was a clumsy mistake
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
new to win32 api programming and am using the free borland tools.
i want to ensure i have the latest headers/libraries that will allow me to target 2k & xp but not clear on how to use msft's platform sdk update and borland to ensure they play well together.
advise from anyone who's gone down this road before?
|
|
|
|
|
Hi everyone !
Well, I have heard that the MFC runtime used a hook to dynamically link a
component to its window procedure. I know that it's the best way to do it,
but Microsoft itself advises the developers to use hooks in their
applications only for debugging purposes, because it dramatically slows
the programs down... What about MFC programs, are they much slower than
their raw API equivalents ?
Thanks in advance,
Mark
|
|
|
|
|
Well, as far as I know that MFC uses window subclassing to override the default WndProc. Hooking is usually used to install the MFC WndProc to the created window. I dont know what hooks exaclty, but definitely not WH_CALLWNDPROC hook or anything like it, which involve notification of frequent events. Usually WH_CBT is used, which can notify the hooking application about creation of windows.
Another thing, there is a difference of local hooking used in this process and global hooking in which the hook is installed over the whole system.
To sum up, the hooking is used just to initiate subclassing and it's local to the process. Subclassing doesnt degrade performance (actually it is done using APIs). So if there existed a degreade on performance of MFC application I think hooking wont be the reason.
Am saying this with accordance to my knowledge, hope if there is anything wrong someone would correct it
|
|
|
|
|
The hook that MFC uses is only installed for the time it takes to create the window. Basically, MFC installs the hook, creates the window, and uninstalls the hook. The hook has basically no influence on the program or the system. Incidentally, it's a thread-specific hook, so it would not slow down the system anyway.
Hope this helps,
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"
|
|
|
|
|
Thanks alot for your replies, mates !
|
|
|
|
|
Hi,
Is there a way to detect from a setup program whether or not MFC is installed, and download/install it only if it isn't?
Such as is with the detecting of MSI's installer?
I do know that I can detect if it's there an close the setup application, but don't know if it's possible to automatically download it.
Thanks,
Shutter
|
|
|
|
|
You could search for the mfc dll (the version that your program uses). You could put the installation program on your ftp site and download and run it if needed.
Cathy
Life's uncertain, have dessert first!
|
|
|
|