Click here to Skip to main content
15,890,845 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Pointer to Doc class of SDI Pin
dtr111-Nov-07 7:27
dtr111-Nov-07 7:27 
AnswerRe: Pointer to Doc class of SDI Pin
bob1697211-Nov-07 8:16
bob1697211-Nov-07 8:16 
AnswerRe: Pointer to Doc class of SDI Pin
Nelek11-Nov-07 22:19
protectorNelek11-Nov-07 22:19 
QuestionCalling web browser Pin
Tarek Jabri11-Nov-07 5:12
Tarek Jabri11-Nov-07 5:12 
AnswerRe: Calling web browser Pin
toxcct11-Nov-07 5:20
toxcct11-Nov-07 5:20 
GeneralRe: Calling web browser Pin
Tarek Jabri11-Nov-07 5:38
Tarek Jabri11-Nov-07 5:38 
AnswerRe: Calling web browser Pin
David Crow11-Nov-07 17:04
David Crow11-Nov-07 17:04 
QuestionUsing MFC with windows form Pin
minihotto11-Nov-07 3:25
minihotto11-Nov-07 3:25 
I create a windows form application named p2pport.
and I want to use the Message Map of MFC.
so I use MFC with shared DLL and include afxwin.h.
But When I compile it, it says that
Debug Assertion Failed
File : dbgheap.c
line 144
Expression : _CrtIsValidHeapPointer(pUserData)

I find it is because of the afxwin.h.

I google it and found that it is a bug that was reported to MSDN.
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99715[^]
I use that method to replace the main function and put #include <afxwin.h> in stdfax.h file.

My original code is

#include "stdafx.h"<br />
#include "Dlg.h"<br />
<br />
using namespace p2pport;<br />
[STAThreadAttribute]<br />
<br />
int main(void)//array<System::String ^> ^args)<br />
{<br />
	// Enabling Windows XP visual effects before any controls are created<br />
	Application::EnableVisualStyles();<br />
	Application::SetCompatibleTextRenderingDefault(false); <br />
<br />
	// Create the main window and run it<br />
	Application::Run(gcnew Dlg());<br />
	//Application::Run(gcnew Form2());<br />
	CMFCApp k;<br />
	return 0;<br />
}


And I modify it.

#include "stdafx.h"<br />
#include "Dlg.h"<br />
<br />
using namespace p2pport;<br />
<br />
[STAThreadAttribute]<br />
class CMFCApp : public CWinApp<br />
{<br />
	public:<br />
		virtual BOOL InitInstance()<br />
		{<br />
			// Enabling Windows XP visual effects before any controls are created<br />
			Application::EnableVisualStyles();<br />
			Application::SetCompatibleTextRenderingDefault(false);<br />
			// Create the main window and run it<br />
			//Application::Run(gcnew Dlg());<br />
			return FALSE;<br />
		}<br />
}theApp;


But it comes the error.
error C3115: 'System::STAThreadAttribute': this attribute is not allowed on 'theApp'

I delete the [STAThreadAttribute].
It comes another two errors.
error LNK2001: unresolved external symbol _main
fatal error LNK1120: 1 unresolved externals

I dont know how to solve it. I stuck it all day.
Can anybody help me to solve the problem.
Appreciate for ur reply
Thx.
Jane
AnswerRe: Using MFC with windows form Pin
Hamid_RT11-Nov-07 3:33
Hamid_RT11-Nov-07 3:33 
Questiondumpbin with debug and release version Pin
George_George11-Nov-07 3:08
George_George11-Nov-07 3:08 
GeneralRe: dumpbin with debug and release version Pin
George_George11-Nov-07 20:09
George_George11-Nov-07 20:09 
GeneralRe: dumpbin with debug and release version Pin
Luc Pattyn12-Nov-07 2:57
sitebuilderLuc Pattyn12-Nov-07 2:57 
GeneralRe: dumpbin with debug and release version Pin
George_George12-Nov-07 4:12
George_George12-Nov-07 4:12 
GeneralRe: dumpbin with debug and release version Pin
Luc Pattyn12-Nov-07 4:57
sitebuilderLuc Pattyn12-Nov-07 4:57 
GeneralRe: dumpbin with debug and release version Pin
George_George12-Nov-07 5:15
George_George12-Nov-07 5:15 
GeneralRe: dumpbin with debug and release version Pin
George_George12-Nov-07 19:04
George_George12-Nov-07 19:04 
GeneralRe: dumpbin with debug and release version Pin
JudyL_MD13-Nov-07 1:56
JudyL_MD13-Nov-07 1:56 
GeneralRe: dumpbin with debug and release version Pin
George_George14-Nov-07 1:14
George_George14-Nov-07 1:14 
GeneralRe: dumpbin with debug and release version Pin
JudyL_MD14-Nov-07 3:28
JudyL_MD14-Nov-07 3:28 
GeneralRe: dumpbin with debug and release version Pin
George_George14-Nov-07 18:22
George_George14-Nov-07 18:22 
GeneralRe: dumpbin with debug and release version Pin
JudyL_MD15-Nov-07 2:37
JudyL_MD15-Nov-07 2:37 
GeneralRe: dumpbin with debug and release version Pin
George_George15-Nov-07 4:24
George_George15-Nov-07 4:24 
QuestionHow can I get the ID code for Pin
mwolf12211-Nov-07 2:25
mwolf12211-Nov-07 2:25 
AnswerRe: How can I get the ID code for Pin
Hamid_RT11-Nov-07 3:40
Hamid_RT11-Nov-07 3:40 
Generalthat was just an advice... :( Pin
toxcct11-Nov-07 5:37
toxcct11-Nov-07 5:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.