Difference between revisions of "Questions and Answers"

From WxWiki
Jump to: navigation, search
(Created page with "'''Can we use MFC and wxWidgets at the same time in Windows environment? I tried to do the following in my code''' #include <Afxwin.h> #include <Afxtempl.h> // For compiler...")
 
m (Text replacement - "<source>" to "<syntaxhighlight lang="cpp">")
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Can we use MFC and wxWidgets at the same time in Windows environment? I tried to do the following in my code'''
+
This is a place where you can find answers to questions other users may have had similar to yours or to get your own question answered.
 
+
There is also a [[wxFAQ|Frequently Asked Questions (FAQ)]] article which may be useful to you.
  
 +
{| class="mw-collapsible mw-collapsed wikitable"
 +
! Can we use MFC and wxWidgets at the same time in Windows environment?
 +
|-
 +
|
 +
I tried to do the following in my code:
 +
<syntaxhighlight lang="cpp">
 
#include <Afxwin.h>
 
#include <Afxwin.h>
 
#include <Afxtempl.h>
 
#include <Afxtempl.h>
Line 17: Line 23:
  
 
#include "wx/dynarray.h"
 
#include "wx/dynarray.h"
....
+
</syntaxhighlight>
</nowiki>
 
 
 
'''THen I tried to do the following'''
 
  
 +
Then I tried to do the following:
 +
<syntaxhighlight lang="cpp">
 
WX_DEFINE_ARRAY_INT(int, CChannel);
 
WX_DEFINE_ARRAY_INT(int, CChannel);
 
 
WX_DEFINE_ARRAY(CChannel *, CChannelArray);
 
WX_DEFINE_ARRAY(CChannel *, CChannelArray);
  
 
void main()
 
void main()
 
 
{
 
{
 
 
//CArray <float,float> PCChannel;
 
//CArray <float,float> PCChannel;
 
 
int m_lNumChannels = 80;
 
int m_lNumChannels = 80;
 
 
int m_lNumTimeslices = 100;
 
int m_lNumTimeslices = 100;
 
 
CChannel *pChannel;
 
CChannel *pChannel;
 
+
</syntaxhighlight>
...
+
When I compile the code in VC++ 6, I got the following error.
 
+
<pre>
'''When I compile the code in VC++ 6, I got the following error. I am wondering if someone can help me with this issue.
 
Thank you'''
 
 
 
 
--------------------Configuration: array_test - Win32 Debug--------------------
 
--------------------Configuration: array_test - Win32 Debug--------------------
 
Compiling...
 
Compiling...
 
array_test.cpp
 
array_test.cpp
 
c:\wxwidgets\wxmsw-2.8.11\mytests\array_test\array_test.cpp(20) : warning C4284: return type for 'CChannelArray::reverse_iterator::operator ->' is 'class CChannel ** ' (ie; not a UDT or reference to a UDT.  Will produce errors if applied using infix  notation)
 
c:\wxwidgets\wxmsw-2.8.11\mytests\array_test\array_test.cpp(20) : warning C4284: return type for 'CChannelArray::reverse_iterator::operator ->' is 'class CChannel ** ' (ie; not a UDT or reference to a UDT.  Will produce errors if applied using infix  notation)
 
 
c:\wxwidgets\wxmsw-2.8.11\mytests\array_test\array_test.cpp(20) : warning C4284: return type for 'CChannelArray::const_reverse_iterator::operator ->' is 'class CChannel *const * ' (ie; not a UDT or reference to a UDT.  Will produce errors if applied  using infix notation)
 
c:\wxwidgets\wxmsw-2.8.11\mytests\array_test\array_test.cpp(20) : warning C4284: return type for 'CChannelArray::const_reverse_iterator::operator ->' is 'class CChannel *const * ' (ie; not a UDT or reference to a UDT.  Will produce errors if applied  using infix notation)
  
Line 53: Line 48:
  
 
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: "void * __cdecl operator new(unsigned int,int,char const *,int)" ([email protected]@Z) already defined in nafxcwd.lib(afxmem.obj)
 
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: "void * __cdecl operator new(unsigned int,int,char const *,int)" ([email protected]@Z) already defined in nafxcwd.lib(afxmem.obj)
 
 
nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
 
nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
 
 
nafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
 
nafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
 
 
nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
 
nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
 
 
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
 
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
 
 
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
 
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
 
 
Debug/array_test.exe : fatal error LNK1120: 3 unresolved externals
 
Debug/array_test.exe : fatal error LNK1120: 3 unresolved externals
  
Line 69: Line 58:
  
 
array_test.exe - 7 error(s), 2 warning(s)
 
array_test.exe - 7 error(s), 2 warning(s)
 +
</pre>
 +
I am wondering if someone can help me with this issue. Thank you.
 +
|-
 +
| no answer has been provided yet!
 +
|}

Latest revision as of 18:36, 19 October 2018

This is a place where you can find answers to questions other users may have had similar to yours or to get your own question answered. There is also a Frequently Asked Questions (FAQ) article which may be useful to you.

Can we use MFC and wxWidgets at the same time in Windows environment?

I tried to do the following in my code:

#include <Afxwin.h>
#include <Afxtempl.h>

// For compilers that support precompilation, includes "wx.h".
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
// Include your minimal set of headers here, or wx.h
#include <wx/wx.h>
#endif

#include "wx/dynarray.h"

Then I tried to do the following:

WX_DEFINE_ARRAY_INT(int, CChannel);
WX_DEFINE_ARRAY(CChannel *, CChannelArray);

void main()
{
	//CArray <float,float> PCChannel;
	int m_lNumChannels = 80;
	int m_lNumTimeslices = 100;
	CChannel *pChannel;

When I compile the code in VC++ 6, I got the following error.

--------------------Configuration: array_test - Win32 Debug--------------------
Compiling...
array_test.cpp
c:\wxwidgets\wxmsw-2.8.11\mytests\array_test\array_test.cpp(20) : warning C4284: return type for 'CChannelArray::reverse_iterator::operator ->' is 'class CChannel ** ' (ie; not a UDT or reference to a UDT.  Will produce errors if applied using infix  notation)
c:\wxwidgets\wxmsw-2.8.11\mytests\array_test\array_test.cpp(20) : warning C4284: return type for 'CChannelArray::const_reverse_iterator::operator ->' is 'class CChannel *const * ' (ie; not a UDT or reference to a UDT.  Will produce errors if applied  using infix notation)

Linking...

msvcrtd.lib(MSVCRTD.dll) : error LNK2005: "void * __cdecl operator new(unsigned int,int,char const *,int)" ([email protected]@Z) already defined in nafxcwd.lib(afxmem.obj)
nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
Debug/array_test.exe : fatal error LNK1120: 3 unresolved externals

Error executing link.exe.

array_test.exe - 7 error(s), 2 warning(s)

I am wondering if someone can help me with this issue. Thank you.

no answer has been provided yet!