|
No compiler is actually 100% ansi/iso compatible. Ultimately VC++ 6.0 suffered from Microsoft wanting to ensure backward compatibility and that the standard was still not finalized. In the end, Microsoft responded to customer demand for fuller compatiblity. Now if we could just get them to fix all the goofiness with Visual Studio....
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Joe Woodbury wrote:
Now if we could just get them to fix all the goofiness with Visual Studio....
And goofy it is...Oh Yes!
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Joe Woodbury wrote:
No compiler is actually 100% ansi/iso compatible.
This one[^] is.
|
|
|
|
|
Hi there...
I'm using VC6 & STL in my program along with Openssl.
I'm getting compilation error in OpenSSL\bn.h
The error is as follows:-
error C2955: 'modulus' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\include\functional(57) : see declaration of 'modulus'
There seems to be some kind of conflict in template names, because STL and OpenSSL structure are using same template name.
Is there any simple workaround for this ?
Any help is appreciated.
Sheetal.
|
|
|
|
|
Have you defined 'using namespace std;' ?
In that case, try deleting that and use the fully qualified name instead, eg. std::cout instead of cout.
Anyway, that's just a SWAG, because I rarely write C++ myself
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Hi,
Did anybody put a CRectTracker on a CScrollView wider than client area (4000x4000 pixels for example) and do some scrolling and/or zoming? The MSDN doesn't help me at all! From my point of view the MSDN creators should explain very clear where the actual Draw-ing is made when CRectTracker::Draw function is called. It is made on client area - visible area(ex: 100x100 pixels wide) or view area (ex: 4000x4000 pixels wide)?
Why 6 is affraid of 7?
Because 7 8 9
|
|
|
|
|
i am trying to create a 3D matrix vMatrix[x][y][z]
getting warning message:
warning C4786: 'std::vector<std::vector<std::vector<double,std::allocator<double> >,std::allocator<std::vector<double,std::allocator<double> > > >,std::allocator<std::vector<std::vector<double,std::
allocator<double> >,std::allocator<std::vector<double,std::allocator<double> > > > > >' : identifier was truncated to '255' characters in the debug information
any ideas?
(i know i can always ignore warnings but i want to know why)
cheers,
|
|
|
|
|
Template instance names in the STL, when fully expanded by the compiler, often result in truly awe-inspiring identifiers that exceed the 255-character limit for identifiers in the debug info. Remember that many STL templates take a number of optional extra template parameters that specify such things as allocators, sorting rules, and hash traits. The compiler fills in these parameters with default values when generating the instance.
I've found this warning to be generally harmless. You can selectively disable it with:
#pragma warning(disable:4786)
- Mike
|
|
|
|
|
Help!
I use RegisterHotKey function to define a global hotkey as following, I works with debug build, but crash with release build when the second I press the hotkey.
Could anyone help? Thanks!
CMainFrame::CMainFrame()
{
m_nHotKeyID = 100;
BOOL m_isKeyRegistered = RegisterHotKey(GetSafeHwnd(), m_nHotKeyID,
MOD_ALT, VK_TAB);
ASSERT(m_isKeyRegistered != FALSE);
}
//lets remove the hotkey block when the application is destroyed
CMainFrame::~CMainFrame()
{
BOOL m_iskeyUnregistered = UnregisterHotKey(GetSafeHwnd(), m_nHotKeyID);
ASSERT(m_isKeyUnregistered != FALSE);
}
|
|
|
|
|
Interesting.
Try calling it in OnCreate(). Make sure GetSafeHwnd() returns a valid handle.
Kuphryn
|
|
|
|
|
Thanks, Kuphryn.
Actually I did call it in OnCreate, but also crash with Release build.
The point is it always work with Debug Build, but crash the second I press the hotkey with with Release build.
Do you have any Idea?
|
|
|
|
|
My application tries to print out in MM_HIENGLISH mode, however, the output on page is always offset a little. I have to call CDC::SetWindowOrg() inside CMyView::OnPrint() to balance out the offset. The funny thing is for different printer the offset is different. Can anyone help me out on the issue? I am using VC++ 5.0 Professional in Windows XP platform.
|
|
|
|
|
Hi there!
I have a problem with my MDI-application.
When the application starts, i want to have an OpenFile dialog. I have
cmdInfo.m_nShellCommand = CCommandLineInfo::FileOpen;
in CMyappApp::InitInstance() and
DoPromptFileNames(filename, AFX_IDS_OPENFILE,OFN_HIDEREADONLY | OFN_FILEMUSTEXIST , TRUE, NULL)))
in CMyappDoc::OnOpenDocument() , everything works fine, the dialog opens on startup.
Now the problem: by pressing the 'Cancel'-button, one would expect nothing to happen, no view to open, just the dialog to disappear.
But the view opens just like it would if one selected a file, and produces lots of trouble cause it actually has no file to handle.
I tried to work around this by closing it right away by calling CWnd::DestroyWindow() in my view's OnInitialUpdate() if there's no file to handle, but then I get in trouble with my CDoc*...
What I want is just a simple solution for this: Open a fileOpen-dialog, just close it by pressing 'Cancel' and closing it and launching my view by selecting a file...
I hope it is understandable, my english isn't actually the best
thank you and greetz
Tib
----------------------------------------------------------
I once had a nightmare in binary --- I think there was a 2
|
|
|
|
|
You should just need to return FALSE from your OnOpenDocument() function to cause MFC to not create an empty document/view.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Thanks for your help...
I already tried that and it destroyed my MainFrame...
dunno how to fix it, so I do not open an openFile dialog on startup, would have been nice, but is not necessary.
Best regards
Tib
----------------------------------------------------------
I once had a nightmare in binary --- I think there was a 2
|
|
|
|
|
Hello,
I am writing an small setup program and I need to install some fonts. I had look in MSDN and in many other places, but I can’t find the solution. AddFontResource works but only on the current session after a reboot the font is gone. I also tried CreateScalableFontResource with AddFontResource but I can’t get it to work. I copy the ttf font file to the windows fonts folder and it does not work. Here is a sample function:
void InstallFont(CString sFontFileName, CString sFontLocation){<br />
<br />
CString sFontResource(GetWindowsFolder() + sFontFileName + ".fot");<br />
CString sWinFonts(GetWindowsFolder() + "Fonts\\" + sFontFileName + ".ttf");<br />
<br />
::CopyFile(sFontLocation + sFontFileName + ".ttf", sWinFonts, TRUE);<br />
<br />
CreateScalableFontResource(0, sFontResource, sWinFonts, NULL);<br />
AddFontResource( sFontFileName + ".fot" );<br />
}
If you have any ideas please help. An example will be perfect. Thanks.
|
|
|
|
|
Is the problem something to do with the windows security?
|
|
|
|
|
We have had the same problem. Just copying the .ttf into the fonts directory is not enough. You also need to add some registry keys settings to get teh font to work correctly. Try copying in the font, use word etc to use it, which sometimes gets the font working initially. Then search the registry for the fonts filename, and hopefully that will return the reg keys you need to add, to get the font registering correctly when you first add the font.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
How can i detect USB isdn modem with VC++ and how can i get 2 isdn phone lines through it?
I can't manage to detect it through SetupDiGetDev if i set INTERFACE flag with modem GUID. I wonder if i'm doing something wrong. Can someone give a example to me?
Thanx in advance for answer!
|
|
|
|
|
I ran into some serious bugs in the adobe reader 6.0 activex control. (pdf.ocx has problems when trying to load .xfdf file) I've been at Adobes forums and posted about this topic. People say that the control has zero support. What is a good pdf viewer control that has support for .xfdf ?
(auto merge with linked pdf and no need to save the result. Just needs to have basic viewing features and has to be able to print)
|
|
|
|
|
My boss wants to be able to change Files of Type pulldown dynamically inside
a CFildDialog callback. For example, we would start with a list of 5 file
types and the last file type is "More...". If the user clicks on "More..."
then the Files of Type combo is to be repopulated with 25 file types, for
example. Then the last entry is "Less..." and so the user can reduce back
to 5 file types.
Has anyone seen this done in a commercial product or a demo? I'm no
stranger to explorer style hookprocs, written them in (and out of) MFC.
I can capture the child control notification, I clear the combobox,
repopulate with a new list. However, the next time the user comes along
and picks a type, I get a null pointer in COMMDLG32.DLL.
Should I give up or is there hope?
|
|
|
|
|
Ok, I read about CImage on MSDN, and I have to include atlimage.h in StdAfx.h
I did it, but it says there is no such file. Where can I download it and where must I store the file (which directory)?
Thanks,
~Michael
|
|
|
|
|
|
hi friends,
i m facing one problem while using services.
the problem is..........
The service behaves well initially when i start manually through service interface(service is not autostart, one has to start manually). As soon as i LOG OFF from the system & again LOG IN to the system i found that service stops however when i check the service interface it shows that service is running and even TASK MANAGER displays the EXE of SERVICE as running status.
i hope u understand my problem.
waiting for reply.
|
|
|
|
|
I hope you registered ur service by /Service
Toughest Steel Comes From Hottest Furnance
|
|
|
|