#### Archived

This topic is now archived and is closed to further replies.

# MFC shiznitz

This topic is 5188 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am making a 3d max exporter, which was working fine till I tried to add a CDialog. Then the shiz hit the fan! Firstly, it wouldnt recognise CDialog, so i made a new MFC app and copied the stdafx.h to get the right include files, that fixed that problem, but introduced the following errors which i have no idea what they are saying(well how to fix it):
nafxcw.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in DllEntry.obj

nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in MSVCRT.lib(MSVCRT.dll)

nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in msvcprt.lib(delop_s.obj)

nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv

nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc

nafxcw.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype

nafxcw.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype

nafxcw.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype

../SiphonExporter.dle : fatal error LNK1120: 3 unresolved externals

ideas welceom

##### Share on other sites
Did you create a MFC project or a Win32-project?

AFAIK MFC can only be used in an MFC project properly (yes, you can probably hack around that, but wouldn''t be too clean).

##### Share on other sites
i did a hrmm, 3d max app wizard, so i think its a mfc dll,
as it starts you off with a basic mfc dialog, which i removed, but now want to add back in :-/

##### Share on other sites
3ds Max does not use MFC. It uses regular Win32 stuff and they''ve added a few custom controls. The AppWizard does generate a dialog box in the resource editor, but that''s just a resource. It has nothing to do with MFC.

-John

##### Share on other sites
so how do i fix it
not make it extend a dialog
or what

##### Share on other sites
Well, it depends on what you''re doing I guess. You can probably just go to the resource editor and make a new dialog. However, many of the dialogs in Max are a specific size(Materials, Modifiers, etc). So, if you''re doing one of those you''ll want to make sure the width matches.

How you use it also depends on what type of plugin you''re doing as well. IIRC, when creating a Material plugin you have to derive a class from ParamDialog, or something like that. Not sure if that''s the same for other plugin types. You can find the specifics in the SDK help.

Either way, if you tell us more about what you''re trying to do, we can give you more detailed advice

-John

##### Share on other sites
okay, i got ride of the MFC, and just made it a resource, how do i get the value in an edit box?

i saw they use:
GetCheckBox(hWnd,IDC_MAP)

to get the value of a check box,
but GetEditBox doesnt exist, but ther must be something?

##### Share on other sites
To get the text from an edit control use GetWindowText( HWND )

##### Share on other sites
hrmm how do i get a handle for the text box givin its resource name?
eg: IDC_EDIT_BOX

i found:
HWND hWnd = FindWindowEx( hWnd, NULL, MAKEINTATOM(0x800), MAKEINTRESOURCE(IDC_COLLISION_DIVISIONS) );

but i dont know which atom a edit box is?

[edited by - supagu on March 8, 2004 6:31:22 AM]

##### Share on other sites
Use GetDlgItem( hwndDlg, IDC_RESOURCE_ID )

• 22
• 10
• 19
• 15
• 14