Click here to Skip to main content
15,910,009 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionStaticly linking MFC in VS2008 app produces compiling errors Pin
josip cagalj22-Mar-10 23:03
josip cagalj22-Mar-10 23:03 
AnswerRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
CPallini22-Mar-10 23:26
mveCPallini22-Mar-10 23:26 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
josip cagalj23-Mar-10 0:02
josip cagalj23-Mar-10 0:02 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
CPallini23-Mar-10 0:07
mveCPallini23-Mar-10 0:07 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors [modified] Pin
josip cagalj23-Mar-10 0:31
josip cagalj23-Mar-10 0:31 
AnswerRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
KarstenK23-Mar-10 4:12
mveKarstenK23-Mar-10 4:12 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
josip cagalj23-Mar-10 4:51
josip cagalj23-Mar-10 4:51 
AnswerRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
Avi Berger23-Mar-10 6:02
Avi Berger23-Mar-10 6:02 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
josip cagalj23-Mar-10 21:37
josip cagalj23-Mar-10 21:37 
QuestionHow to convert Chinese Unicode string to ANSI multibyte? Pin
tmx22-Mar-10 22:56
tmx22-Mar-10 22:56 
AnswerRe: How to convert Chinese Unicode string to ANSI multibyte? Pin
Richard MacCutchan23-Mar-10 0:28
mveRichard MacCutchan23-Mar-10 0:28 
GeneralRe: How to convert Chinese Unicode string to ANSI multibyte? Pin
tmx24-Mar-10 21:47
tmx24-Mar-10 21:47 
QuestionReg MDI windows Explorer Pin
hellogany22-Mar-10 20:45
hellogany22-Mar-10 20:45 
AnswerRe: Reg MDI windows Explorer Pin
Richard MacCutchan22-Mar-10 22:16
mveRichard MacCutchan22-Mar-10 22:16 
AnswerRe: Reg MDI windows Explorer Pin
Adam Roderick J23-Mar-10 2:19
Adam Roderick J23-Mar-10 2:19 
GeneralRe: Reg MDI windows Explorer Pin
hellogany23-Mar-10 18:40
hellogany23-Mar-10 18:40 
GeneralRe: Reg MDI windows Explorer Pin
hellogany28-Mar-10 20:15
hellogany28-Mar-10 20:15 
QuestionGCC Linker and Where To Define Structures Pin
Trevor Johansen22-Mar-10 17:46
Trevor Johansen22-Mar-10 17:46 
AnswerRe: GCC Linker and Where To Define Structures Pin
CPallini22-Mar-10 21:55
mveCPallini22-Mar-10 21:55 
GeneralRe: GCC Linker and Where To Define Structures Pin
Trevor Johansen24-Mar-10 9:22
Trevor Johansen24-Mar-10 9:22 
GeneralRe: GCC Linker and Where To Define Structures Pin
CPallini24-Mar-10 11:33
mveCPallini24-Mar-10 11:33 
If you define the struct variable in one source file and declare it extern in another one, then such variable is avalable in the latter (and the linker won't complain), for instance:
(common header)
// main.h
struct Point 
{
	int x,y;
};
void init();


(first source)
// init.cpp
#include "main.h"
Point centre={0,0};
void init()
{
	centre.x=100;
	centre.y=120;
}


(second source)
// main.cpp
#include <iostream>
#include "main.h"
extern Point centre;
void out()
{
	std::cout << "cente = {" << centre.x << ", " << centre.y << "}" << std::endl;
}

void main()
{
	init();
	out();
}


Smile | :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: GCC Linker and Where To Define Structures Pin
Trevor Johansen25-Mar-10 13:08
Trevor Johansen25-Mar-10 13:08 
GeneralRe: GCC Linker and Where To Define Structures Pin
CPallini25-Mar-10 21:41
mveCPallini25-Mar-10 21:41 
QuestionHow do you display a bitmap in IE and control navigation? Pin
nstein222-Mar-10 11:57
nstein222-Mar-10 11:57 
AnswerRe: How do you display a bitmap in IE and control navigation? Pin
KarstenK23-Mar-10 4:21
mveKarstenK23-Mar-10 4:21 

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.