Thread: Ddx vc

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    16

    Ddx vc

    hi,
    under vs2008, I made an dialog based app from scratch. I added shared mfc dll in the properties and etc, I made an empty project, not mfc. All went well, until the time, I wanted to use class wizzard and "Add variable" to a combobox, but it complained that there is no DoDataExchange function, I made another mfc project and copied the code to override it, no more complaining, the variable added, I checked the ddx dodataexchange routine, it seems the same, I tested and added a AfxMessageBox and it was called by mfc, even I used UpdateData function, nothing changed, when i use AddString or InsertString functions of CCombobox variable, nothing is added to my combobox, while the appwizzard made is okay and works properly.
    I copy some code to show:
    Code:
    protected:
    	virtual void DoDataExchange(CDataExchange* pDX);
    
    void CMyDlg::DoDataExchange(CDataExchange* pDX)
    {
    	CDialog::DoDataExchange(pDX);
    	DDX_Control(pDX, IDC_COMBO1, mycmb);
    	AfxMessageBox("f");
    }
    The other strange thing is that in one project (mine) I can use string w/out _T(), but the mfc app says I should use it.

    I'll be happy to know how things happen so,


    Thanks!

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Visual Studio 2008 is supposed to be, and many brug about it, very good at debugging projects. So why don't you do that?

    I don't know, i've never used VS
    Devoted my life to programming...

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Sorry having difficulty understanding your problem.
    Could you explain what is going wrong in a few very short lines?

    Quote Originally Posted by nabat1 View Post
    under vs2008, I made an dialog based app from scratch. I added shared mfc dll in the properties and etc, I made an empty project, not mfc.
    If you made a non-MFC project then you can not use the MFC message handling (DoDataExchange) in any part of it.

    You can have a WIN32 'solution', made up of multiple 'projects', some projects in MFC.

    Pasting in some code in the one class will not call the underlying framework (to route messages from the OS message queue, to your app, to the correct window/dialog and then onto the correct handler).

    [BTW Static lib is better than shared DLL as you do not need to distribute the correct MFC DLLs with your app (unless you have a VERY good reason to keep the size down).]

    Quote Originally Posted by nabat1 View Post
    All went well,
    until the time,
    I wanted to use class wizzard and "Add variable" to a combobox,
    but it complained that there is no DoDataExchange function,
    I made another mfc project and copied the code to override it,
    no more complaining,
    the variable added,
    I checked the ddx dodataexchange routine,
    it seems the same,
    I tested and added a AfxMessageBox and it was called by mfc,
    even I used UpdateData function,
    nothing changed,
    when i use AddString or InsertString functions of CCombobox variable,
    nothing is added to my combobox,
    while the appwizzard made is okay and works properly.
    Pardon?

    Too much information in this one sentence. I can not understand what is going wrong.

    Quote Originally Posted by nabat1 View Post
    The other strange thing is that in one project (mine) I can use string w/out _T(), but the mfc app says I should use it.
    Using _T is not essential.

    _T or _TEXT converts a string into 8 or 16 bit characters, if required.

    It depends on the target OS and the defines in your app (UNICODE).
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Quote Originally Posted by Sipher View Post
    Visual Studio 2008 is supposed to be, and many brug about it, very good at debugging projects. So why don't you do that?

    I don't know, i've never used VS
    You do know that the parts of MFC he is talking about are internal system files that can not (easily) have a break-point put in them (and so can not be easily debugged)?

    No, you have never used the technology that you are commenting on.

    So why don't you refrain from cluttering the thread with useless, unhelpful posts?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    What technology are you talking about? MFC is a joke set of classes that Microsoft built in order to make the Windows API more programmer-friendly! I would rather build my own instead of using those, and i actually have! So why don't you refrain from commenting on things you don't/can't understand?!
    Devoted my life to programming...

  6. #6
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Quote Originally Posted by Sipher View Post
    What technology are you talking about? MFC is a joke set of classes that Microsoft built in order to make the Windows API more programmer-friendly! I would rather build my own instead of using those, and i actually have! So why don't you refrain from commenting on things you don't/can't understand?!
    If you don't like WIN32/MFC/Microsoft, please say out of the Microsoft OS specific section of the forums.

    If you have nothing constructive, helpful or relevant to the topic at hand, please refrain from posting.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. VC 2005 win 32 app error.
    By geek@02 in forum Windows Programming
    Replies: 15
    Last Post: 12-21-2009, 02:17 PM
  2. strcpy_s exception in VC 2005
    By geek@02 in forum Windows Programming
    Replies: 3
    Last Post: 08-07-2009, 08:35 AM
  3. VC express 2008
    By rikroll in forum C++ Programming
    Replies: 6
    Last Post: 08-01-2009, 10:32 AM
  4. makefile exported by vc 6.0 doesn't work
    By wow in forum Windows Programming
    Replies: 7
    Last Post: 03-24-2006, 04:20 PM
  5. Why VC?
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 04-15-2002, 05:24 AM