|
Thank you for your point of view. It surprices me that your recommendation is not in MS world. I like C++ as a language because for me it feels natural to me. I have programmed in many languages, some high level, others not so much, but I always come back to C++.
I would like to know if there other adventages to WxWidgets besides portability becasuse most of my programming has been for windows, and my target users use windows for now.
I have a lot of code in MFC, some programs will stay there until they die, others I would like to evaluate migrating to other frameworks, to take advantage of what the future brings (mobile, touch, etc). The problem right now I see is that many people are saying that this is dead and that is the futures and so on. Most is marketing but in the end I don't clearly see that MS is giving a long life to MFC. On the other hand, going to WinRT, it feels like as an experiment that could be dropped on the next release as we have seen many times. WxWidgets on the other hand has been for some time, but never tried. I think it will be arround for some years from now.
|
|
|
|
|
Disregard my advice to learn other languages then, looks like you already know a pile of them .
I recommend getting away from MS once in a while because you can get stuck in a bear trap if you use nothing else[1]. I see loads of poor buggers still trapped using VC++6.0 (on these forums and in real life) and I almost cry for them. Then I remember they made the choice to swallow the hook MS fed them gave them and now they can't choke it up. Instead of using standard C++ they splatted on every MS extension they could find. When MS finally came up with a very good standard compiler in 2003 (2002 was nearly there) they were stuck. Huge job to move the code.
Anyway, I don't recommend writing non-portable code, even if you just use windows, as it's your ticket out of trouble when you have to change tools. And portable code has another advantage: If you need a programmer quickly you have a greater pool to draw on, you're not just stuck with the subset of VC++ programmers and you're a member that bigger pool as well.
Where was I? Oh yes, WxWidgets next. So WxWidgets is meant to be portable so it's not a bad thing. However if you only ever do Windows in C++ with the caveats above it won't do a lot for you. You might as well keep using MFC. You might still like to look at the differences in implementation between WxWidgets and MFC, the things they do differently, the rubbish ideas in both, the great ideas in both.
For the next big thing I'd wait a couple of years and see what catches on. After a few years the good ideas are still there and the bad ones are gone apart from the people who invested heavily in them. Try and avoid the marketing spend (Sun and Microsoft spent loads on selling Java and .Net to non-techy managers, not developers) and concentrate on what helps you right now. I use a lot of open source libraries (expat, libCURL and OpenSSL to name three) and they can quite often do what the big guns are trying to flog in a more effective way.
So the moral of this lot is avoid company tie ins - they're usually bad for you. Keep learning stuff outside the box you're in (whether employer mandated or self imposed) and you can't go wrong. Well you can but it'll help in the long run.
Sorry about the length of the post, I'm not sure if I've answered your points that well though!
Cheers,
Ash
[1] And I say this with 6 different versions of MS's compiler on my computer
|
|
|
|
|
Thank for the time spent on answering my question. I think you are right on spending some time on external libraries.
|
|
|
|
|
You may like to look at C#, which should be fairly easy for you as an MFC developer. .NET Book Zero[^] by Charles Petzold is a great introduction, and these tutorials[^] on MSDN are quite helpful. Once you feel comfortable with C# and .NET, you can move on to WPF or ASP.NET, but of course, it all depends on where you want to be in the future.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Thanks, I've neved done C# probably becase of confort. When you know how to do it in C++ why bother. Well for some projects this has been a good desicion, but for others probably was an oportunity lost. Next time I have a chance I will put the effort to learn it.
|
|
|
|
|
It depends on what you want to be able to do... a lot of new applications are skipping C++ and going right to C#, so if you want to be competitive in the market as a programmer, then learning C# would be a good idea.
|
|
|
|
|
hello guys... I am trying to add the couple of property pages to property sheet. If I ignore all the assertions then the EXE runs properly. But if I go to the assertion it takes me to the following address
- <pre lang="c++"><b>atlmfc\include\afxwin1.inl</b></pre>
and the line
- <pre lang="c++"><b>{ ASSERT(afxCurrentResourceHandle != NULL);</b></pre>
I tried to trace the starting point and put a break point on CMyApp::InitInstance(). But the assertion is shown even before this function is called.
Again, the project builds successfuly and if I ignore all the assertions then the EXE works fine as well. What can be the problem
|
|
|
|
|
You should find in the call stack window of Visual Studio what is the origin of the problem.
Veni, vidi, vici.
|
|
|
|
|
CPallini wrote: You should find in the call stack window
Yes. The origin is the global variable for one of the PropertyPage that I have declared, in order to excess it in other TABS. It is fine because before declaring these global variables, this program was working absolutely fine with no assertions.
The constructor of the property page looks like.
CEmployementDlg::CEmployementDlg(CWnd* pParent )
: CPropertyPage(CEmployementDlg::IDD)
{
}
I dont know what resource I am missing here.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
|
Another thing to look into a global variable you have mentioned. Could you give more details about it? Like type and where it is declared?
JohnCz
|
|
|
|
|
Hi,
I am having a problem. I have a project "MicroSIP" which is used for SIP based call voice over IP. I am running it into VS 2010 and I need to customize it according to my need. For this as soon as I edit the main dialog ( Dialer ) and add some other controls ( like edit control of CEdit) and add member variable for from wizard of "Add Variable", it shows the message "unable to update DoDataExchange method".
More over if getting reference of newly placed "Edit Control" in the program , it has NULL pointer or undefined reference.
Anybody having any idea about this to resolve or some way around to resolve the issue. I am having extremely trouble for solving this scanario.
Regards
Usman Khalil
|
|
|
|
|
Sometimes the wizards get out of whack is some of the commented text that is in the header/source files is removed. Why not add the control by hand? It's really not that difficult.
This is the problem with people using wizards... when they fail, you're left with no recourse. If you learn what it is the wizard does, then you don't have to depend on it.
|
|
|
|
|
Unfortunately adding it by hand also didn't work at all.
See the problem:
It crashes now inside DDX_Control(pDX, IDC_EDIT_Address, MacAddressEditCtrl ); where IDC_EDIT_Address is the id and MAcAddressEditctrl is CWnd object.
oid AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CWnd& rControl) { if ((rControl.m_hWnd == NULL) && (rControl.GetControlUnknown() == NULL)) // not subclassed yet { ASSERT(!pDX->m_bSaveAndValidate);
pDX->PrepareCtrl(nIDC); ////it crashes here...and inside it int the long run inside of code somehere..it calls GetOleControlSite() and there it is observed that m_pCtrlCont is NULL.
HWND hWndCtrl;
pDX->m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if ((hWndCtrl != NULL) && !rControl.SubclassWindow(hWndCtrl))
{
ASSERT(FALSE); // possibly trying to subclass twice?
AfxThrowNotSupportedException();
}
ifndef _AFX_NO_OCC_SUPPORT
else
{
if (hWndCtrl == NULL)
{
if (pDX->m_pDlgWnd->GetOleControlSite(nIDC) != NULL)
{
rControl.AttachControlSite(pDX->m_pDlgWnd, nIDC);
}
}
else
{
// If the control has reparented itself (e.g., invisible control),
// make sure that the CWnd gets properly wired to its control site.
if (pDX->m_pDlgWnd->m_hWnd != ::GetParent(rControl.m_hWnd))
rControl.AttachControlSite(pDX->m_pDlgWnd);
}
}
endif //!_AFX_NO_OCC_SUPPORT
}
}
|
|
|
|
|
Where's the code where you describe MacAddressEditCtrl? Are you positive IDC_EDIT_Address exists in the resources? When you try to access this variable, are you sure there's an instance of the dialog created? Has OnInitDialog() been called already?
If I had to guess, you're probably trying to use the control before it has been created.
|
|
|
|
|
Thanks Albert.
As you pointed out and I realized that I placed and written the code of another OnInitDialog..
It was main dialog's control of whole I was trying to manipulate of another dialog's code.
Thanks
|
|
|
|
|
Could you upload the header and cpp file of dialog class ?
|
|
|
|
|
It seems that, among the very many properties that a file can have, is a text caption, to say what is in the file. (If it is a graphic file, it would say what the image is a picture of.) Please what are the Visual C++ functions to set and read these captions for any given file?
|
|
|
|
|
Quote: If it is a graphic file, it would say what the image is a picture of
This is better called as 'preview' and can be retrieved as file buffer (which holds either jpeg/png/bmp image type) and can be parsed accordingly.
Now like the same way, you should know what other types have as text caption to extract and parse them. Isn't it?
I guess, there is no such set of methods in VC++ to do task in a generic way.
|
|
|
|
|
Sorry: I did not mean a preview image. I thought that, if I (say) photographed a diver in a hardhat diving suit, that it might be possible (after I moved the image onto my computer), to attach to the image a text comment that said "Hardhat diver, Albert Dock, Liverpool", and later to retrieve the comment knowing the filename, both within a Visual C++ for Windows program.
|
|
|
|
|
|
What I meant is: after the usual #include's:-
#include "targetver.h"
pragma once
#pragma comment(lib, "GdiPlus")
#include "targetver.h"
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows
// Windows Header Files:
#include [windows.h]
#include [gdiplus.h]
#include [stdlib.h]
#include [malloc.h]
#include [memory.h]
#include [tchar.h]
#include [direct.h]
#include [stdio.h]
#include [errno.h]
/* the square brackets should be angle brackets */
FILE *F;
if I could wrote something like
setfilecaption(F,"Hardhat diver in Albert Dock, Liverpool");
getfilecaption(F,s,n); /* get file F's caption into string s, allow n bytes for it. */
modified 15-Apr-12 15:29pm.
|
|
|
|
|
Yes indeed, I already understood that. Nonetheless, thanks for taking for the effort to ensure you'd been clear.
Edit: Think your keyboard is on the blink - you've got [] where there should be <>, also a } where there should be a )
Hint: You can enter the angle brackets using the html for them - i.e < is "& lt;" (andLessThanSemicolon)
and > = "& gt;" (andGreaterThanSemicolon)
Note: You just need to remove the space after the & character.
modified 15-Apr-12 15:16pm.
|
|
|
|
|
I know about angle brackets :: I used angle brackets first, but the editor treated the texts between the angle brackets as HTML codes and dropped them, and I was in a hurry, so I quickly cut-and-pasted it to Wordpad and changed the brackets. Sorry.
Please, after the usual #include's:-
#include .......
FILE *F;
is there something like this that I could write to set and get a file's text caption?
setfilecaption(F,"Hardhat diver in Albert Dock, Liverpool");
getfilecaption(F,s,n); /* get file F's caption into string s, allow n bytes for it. */
~~~~~~~~~~~~~~~~
Are these captions stored within the file descriptor, like the last-modified date and suchike, or are they stored in the Windows registry?
|
|
|
|
|
There's been no problem caused through your use of brackets.
No, there isn't something available with the interface you describe. The provided functions are available in .NET
See here: reading-writing-and-photo-metadata[^]
Furthermore, the data is stored in neither the directory entry (fileDescriptor) nor the Registry. See for yourself!
Got a Hex-Editor? (Nope? Get one - HxD is okay and $free)
I chose a JPG and did the following:
1) Right-click a photo
2) Select Properties, then the Details tab.
3) Add some unique text - I set the Camera Model field to "Canon EOS".
4) Hit apply
5) Now you can see that the photo's last modified date is the current date and time, furthermore, when you open the image in the HexEditor, you can easily find the text you entered.
It should be fairly easy to implement the getfilecaption function yourself, it's likely going to involve searching the file for some kind of marker (don't think you'll have to parse the whole file, including image data yourself) so that you know where the metadata starts.
Obviously, different filetypes have different structures, so you'd have to implement the function for each of the different image-file types you'd like to support.
Unfortunately, it is unlikely that writing the metadata will be so simple.
Here's a few pertinant links:
JFIF metadata[^]
(2nd search result): Does Exif metadata always get stored just after the jfif header?[^]
|
|
|
|