|
Here are a couple of possibilities: 1) Declare your dialog object globaly, then you could access it from any where and keep/access the infomation stored in it via that object (Example: g_CfgDlg.GetWhatEver()), 2) Declare your dialog object as a member of your main dialog or application class for the same reasons as in 1 above.
INTP
|
|
|
|
|
Keep the config data in your main class, as an instance of another class and make it visible to the config dialog, probably by passing it in through the constructor, and visible in the dialog class, so that it can be grabbed back when the dialog is closed. Something like this:
class ConfigData
{
// config stuff here
}
class MainDialog
{
private ConfigData m_configData;
// Read in oninitmethod
private void OnClickShowConfig()
{
MyConfigDialog dlg(m_configData, this);
if(dlg.DoModal() == IDOK)
{
m_configData = dlg.configData;
}
}
}
The config dialog saves the changed data to disk, and has only got a constructor which takes the config as well as the usual parameters with defaults ( parent dialog, etc. That what the this is being passed in for, the parent window )
My MFC is VERY rusty, two years since I used it. But that should be the general idea.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Has anyone here used the extended mapi interface? and if so do you know what has to be changed to use the GUID's that are declared in mapiguid.h? I have included everything the MSDN library specifies and have even defined the proper defines, but when I build I get the following error:
EmailMessage.obj : error LNK2001: unresolved external symbol _IID_IMessage
Can anyone help me?
|
|
|
|
|
#include <initguid.h>
or
#define INITGUID
|
|
|
|
|
I included mapiguid.h mapix.h and #defined initguid and uses_iid_imapimessage and when I build I still get the error on the link.
|
|
|
|
|
How about MapiDefs.h
Thank You
Bo Hunter
|
|
|
|
|
I included that as well and several other of the mapi includes. the error seems to be an issue of the lib files linked, but I included uuid.lib, mapi32.lib, ole32.lib, and oleaut32.lib.
|
|
|
|
|
Hi,
I'd like to know how I can draw simple 2D Shapes like Rectangles, Triangles, Boxes, Circles with Microsoft Visual C++ 6.0 in DOS ? Is there something like a "dosgraphs.h" header file with pre-defined prototypes for drawing such objects ? If there is something like this where can I get a tutorial ?
Thanks in advance
Tolga
|
|
|
|
|
This is not possible because VC++ 6.0 cannot create a DOS application. It can create a console application, but this is not the same thing. To do this, you’d need an older version of VC++ (like say 1.x or 2.x). Furthermore, DOS uses the concept of different screen modes to display graphics; a Windows console app does not support this. Yes, Windows can run a DOS app (like some games), but these are two different things.
However, VC++ 6.0 can work very well with Windows graphics using the GDI, OpenGL, DirectX, etc. But, if it must be DOS then look for an older version of VC++ first.
Jeremy Falcon
|
|
|
|
|
Well actually the program I wrote opens up in a DOS Console and all the data is input from the DOS Console, but could I do something like this: use the gl.h to create the 2D shapes which open up in Windows ?
Tolga
|
|
|
|
|
I created a simple app using the wizard. It was a dialog based app. It works fine, but does nothing expect close when you hit the button. However, I have a problem when I add a Rich Edit control. The app compiles fine, but the app window does not appear when I run it. Nothing happens. I stepped through the code and found it exits at a DoModal call. What's up? Thanks.
|
|
|
|
|
AfxInitRichEdit() needs to be called.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
|
I am starting getting this "CXX0030: Error: expression can not be evaluated" from the debugger after configuring my application to use the CxImage class. The error message is at the Value column on all recordset fields at the Variables window. Now I am not able to see the values in the recordset to debug the application. Please help.
Elizabeth
|
|
|
|
|
If you Paste the Actual Code as well you will get more replies that way
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Here is the function. Before I made the changes at Project Settings to use the CxImage class, I was able to see the values from each field at m_pListSet. Now all I am seeing is "CXX0030: Error: expression can not be evaluated".
void CDeliveryForm::LoadDeliverableList()
{
m_comboDeliverable.ResetContent();
if (!m_pListSet->IsBOF())
{
m_pListSet->MoveFirst();
while (!m_pListSet->IsEOF())
{
if (m_pListSet->m_ROUTE_TO_WAM_DATE != 0 && m_pSet->m_ACCEPTED == "1")
m_comboDeliverable.AddString(m_pListSet->m_TITLE + " (deliverred)");
else
m_comboDeliverable.AddString(m_pListSet->m_TITLE);
m_pListSet->MoveNext();
}
}
m_comboDeliverable.AddString("NEW");
if (!m_pListSet->IsBOF())
{
int target_record = 0;
//get to the deliverable
if (m_pDoc->m_deliverable_id != "")
{
m_pListSet->MoveFirst();
while (!m_pListSet->IsEOF())
{
if (m_pListSet->m_DELIVERABLE_ID == m_pDoc->m_deliverable_id)
break;
target_record ++;
m_pListSet->MoveNext();
}
}
//reset to 0 if no record found
if (m_pListSet->IsEOF())
target_record = 0;
//set selected item in list
m_comboDeliverable.SetCurSel(target_record);
m_pListSet->Move((target_record+1), SQL_FETCH_ABSOLUTE);
}
}
Elizabeth
|
|
|
|
|
What are some good books for shell programming? One by Dino Esposito is out of print and its really old. If I can find it is it still useful?
Thanks,
ns
|
|
|
|
|
Yeah, I believe it's really good. I got a different book, 2nd hand, which was also good, but I forget what it was called. Yeah, I'm just a world of useful info....
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
Thanks! Its downloadable at amazon. I am reading your series of articles.....
|
|
|
|
|
I'm using MSHTML and creating a URLMoniker to browse to a web page. Using IPropertyNotifySink::OnChanged works fine for a successfull page, but is there any way to get the http status so I can detect failures?
|
|
|
|
|
What I want to do is when a program prints something , and the printer icon appears in the notification area that my program is also run, or to have my program already running but it can detect when another program prints something.
All my program does right now is allow the user to enter how many pages he/she printed in color and/or black and white.
Thank you.
|
|
|
|
|
I am learning using CSocket to send/receive message through net,but here's some problem
I use class CSocket CSocketFile CArchive to support my program.
At first,I create a new CSocket object and connect to Server,and everything is OK.At the server I can get the connection message from the client.
After that,I use the following code to send some message to Server:
<br />
CString str;<br />
str.Format("%s","risking");<br />
UINT CtrlCode;<br />
CtrlCode=USER_NAME;<br />
m_pClientSocket->SetSendData(CtrlCode,str,3,1);<br />
m_pClientSocket->SendData();<br />
CtrlCode=USER_PASSWORD;<br />
m_pClientSocket->SetSendData(CtrlCode,str,3,2);<br />
m_pClientSocket->SendData();<br />
CtrlCode=USER_LOGIN_END;<br />
str="";<br />
m_pClientSocket->SetSendData(CtrlCode,str,3,2);<br />
m_pClientSocket->SendData();<br />
if I add the two code sleep(100); in it,everything looks OK at server,I can see the ctrl_code USER_NAME USER_PASSWORD CTL_END at server.But if I delete the two sleep(100) ,I can sometimes see all three ctrl_code,sometimes can only see CTRL_END message.
I don't know where is wrong,and the following code is used to send data:
<br />
void CClientSocket::SendData()<br />
{<br />
CCommand cmd;<br />
cmd.m_CtrlCode=m_CtrlCode;<br />
cmd.m_DataStr=m_DataStr;<br />
cmd.m_CurrentData=m_CurrentData;<br />
cmd.m_TotalData=m_TotalData;<br />
cmd.Serialize(*m_pArchiveOut);
m_pArchiveOut->Flush();<br />
}<br />
At server I use the following code to receive message:
<br />
void CServeSocket::OnReceive(int nErrorCode) <br />
{<br />
CCommand cmd;<br />
do <br />
{<br />
cmd.Serialize(*m_pArchiveIn); <br />
} while(!m_pArchiveIn->IsBufferEmpty());<br />
UINT CtrlCode=cmd.m_CtrlCode;<br />
switch(CtrlCode/100)<br />
{<br />
case 1:UserLogin(&cmd);<br />
……………….<br />
}<br />
<br />
void CServeSocket::UserLogin(CCommand *pCmd)<br />
{<br />
<br />
switch(pCmd->m_CtrlCode%100)<br />
{<br />
case 1:m_LogInUserName=pCmd->m_DataStr;m_LoginDataCount++;<br />
break;<br />
case 2:m_LoginUserPwd=pCmd->m_DataStr;m_LoginDataCount++;<br />
break;<br />
default:break;<br />
}<br />
if(m_LoginDataCount>=2)
{<br />
CCommand cmd;<br />
if(m_bLogin=m_DBCtrl.VerifyLogin(m_LogInUserName,m_LoginUserPwd))<br />
{<br />
cmd.m_CtrlCode=USER_LOGIN_SUCCESSFULLY;<br />
cmd.m_DataStr="You are Welcome!";<br />
}<br />
else<br />
{<br />
cmd.m_CtrlCode=USER_LOGIN_DENY;<br />
cmd.m_DataStr="Sorry!You have no privilege to login";<br />
}<br />
cmd.m_TotalData=1;<br />
cmd.m_CurrentData=2;<br />
<br />
cmd.Serialize(*m_pArchiveOut);<br />
m_pArchiveOut->Flush();<br />
m_LoginDataCount=0;<br />
<br />
}<br />
}<br />
<br />
I really don't know why the server can get all message sending by client.
May anyone do me a favor for it,I just want to know what casue it and how to solve it,Thank you very much
Don't look at me in that way!
|
|
|
|
|
I don't use CSocket but I have in the past. (I ran into tons of problems with it). Anyway as a rule of thumb it's not a good idea to do multiple sends especially with out doing any type of error checking.
I'm not 100% sure of the problem but I bet if you run some error checking you will see that the socket is still busy sending the first msg when you try to send the second. That's could be why sleep() allows the socket to finish sending before it attempts the next send.
Hope this helps,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi!
I would like to execute a external program "iperf.exe" and read the output.
Iperf is a command line tool and writes it´s output to stdio.
How can I get the output? Should I use ShellExecute() command or what?
-Hannu
|
|
|
|