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

C / C++ / MFC

 
AnswerRe: problem with api messagebox Pin
Satheesh154614-Jan-12 5:07
Satheesh154614-Jan-12 5:07 
AnswerRe: problem with api messagebox Pin
«_Superman_»14-Jan-12 16:32
professional«_Superman_»14-Jan-12 16:32 
QuestionWhen click on item in tree control corresponding item in list control should get selected. Pin
VCProgrammer13-Jan-12 19:11
VCProgrammer13-Jan-12 19:11 
QuestionRe: When click on item in tree control corresponding item in list control should get selected. Pin
Richard MacCutchan13-Jan-12 22:12
mveRichard MacCutchan13-Jan-12 22:12 
AnswerRe: When click on item in tree control corresponding item in list control should get selected. Pin
«_Superman_»14-Jan-12 16:35
professional«_Superman_»14-Jan-12 16:35 
QuestionGlobal variable Pin
1.fcb191313-Jan-12 10:57
1.fcb191313-Jan-12 10:57 
AnswerRe: Global variable Pin
Albert Holguin13-Jan-12 12:05
professionalAlbert Holguin13-Jan-12 12:05 
QuestionRe: Global variable Pin
1.fcb191314-Jan-12 0:35
1.fcb191314-Jan-12 0:35 
Thank you for the answear.
If I remove the static declaration I receive errors like this : error LNK2005: "struct st_mysql * mysql5" (?mysql5@@3PAUst_mysql@@A) already defined in main.obj.
Adding
extern MYSQL *mysql5;
do nothing.
Here are details:
//main.cpp - contains WindowProc, int WINAPI _tWinMain(...) ...
main.h:
#include "ClassLogin.h"
static MYSQL *mysql5;
static ClassLogin *login2;

DlgLogin.cpp - contains dialog procedure and #include "main.h" 
case button_OK:
ClassLogin * login = new ClassLogin(...parameters...);
login2 = login;
 
//Class ClassLogin:
ClassLogin.cpp: 
#include "main.h"
#include "ClassLogin.h"
ClassLogin::ClassLogin();
ClassLogin::ClassLogin(...parameters...)
{ ... mysql_real_connect(Cmysql, host, user, password , database , port, unix, 0 );
mysql5 = Cmysql; }
destructor

//ClassLogin.h: 
Class ClassLogin
{
public:
ClassLogin();
ClassLogin(...parameters...);
MYSQL *Cmysql;
virtual ~ClassLogin();
};

income.cpp - contains dialog procedure and 
#include "main.h"
#include "ClassLogin.h"
MYSQL * mysql2;
case button_OK:
mysql2 = login2->Cmysql;// value login2->Cmysql is 0x00000000
mysql2 = mysql5;// value mysql5 is 0x00000000


But if I don't use login2->Cmysql or mysql2 = mysql5 the values are right (0x01df0a98) while debuging (F5)
What I have to do to obtain values from class ClassLogin in another cpp file?
Jan
AnswerRe: Global variable Pin
CPallini14-Jan-12 2:21
mveCPallini14-Jan-12 2:21 
GeneralRe: Global variable Pin
1.fcb191314-Jan-12 3:04
1.fcb191314-Jan-12 3:04 
GeneralRe: Global variable Pin
CPallini14-Jan-12 4:19
mveCPallini14-Jan-12 4:19 
QuestionHow to respond to WSAETIMEDOUT in CSsyncsocket::onconnect Pin
ForNow13-Jan-12 7:07
ForNow13-Jan-12 7:07 
AnswerRe: How to respond to WSAETIMEDOUT in CSsyncsocket::onconnect Pin
Chris Meech13-Jan-12 7:22
Chris Meech13-Jan-12 7:22 
Questiondll loading itself launching the application Pin
appollosputnik12-Jan-12 2:42
appollosputnik12-Jan-12 2:42 
AnswerRe: dll loading itself launching the application Pin
Chris Losinger12-Jan-12 3:50
professionalChris Losinger12-Jan-12 3:50 
AnswerRe: dll loading itself launching the application Pin
Randor 12-Jan-12 13:31
professional Randor 12-Jan-12 13:31 
QuestionLearn MFC Pin
columbos1492711-Jan-12 19:22
columbos1492711-Jan-12 19:22 
AnswerRe: Learn MFC Pin
«_Superman_»11-Jan-12 19:46
professional«_Superman_»11-Jan-12 19:46 
QuestionProper response From WSAEWOULDBLOCK return code From CAsyncSocket::Connect Pin
ForNow11-Jan-12 10:24
ForNow11-Jan-12 10:24 
AnswerRe: Proper response From WSAEWOULDBLOCK return code From CAsyncSocket::Connect Pin
CPallini11-Jan-12 10:45
mveCPallini11-Jan-12 10:45 
GeneralRe: Proper response From WSAEWOULDBLOCK return code From CAsyncSocket::Connect Pin
ForNow11-Jan-12 14:36
ForNow11-Jan-12 14:36 
GeneralRe: Proper response From WSAEWOULDBLOCK return code From CAsyncSocket::Connect Pin
CPallini11-Jan-12 22:08
mveCPallini11-Jan-12 22:08 
GeneralRe: Proper response From WSAEWOULDBLOCK return code From CAsyncSocket::Connect Pin
ForNow12-Jan-12 12:19
ForNow12-Jan-12 12:19 
QuestionWindow does not restore properly. Pin
cpp_prgmer11-Jan-12 5:53
cpp_prgmer11-Jan-12 5:53 
AnswerRe: Window does not restore properly. Pin
jkirkerx13-Jan-12 10:53
professionaljkirkerx13-Jan-12 10:53 

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.