|
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
|
|
|
|
|
Search the MSDN for
"Spawn Console Processes with Redirected Standard Handles"
Q190351
Also I seem to remember there is an example on CP using the above method.
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
|
|
|
|
|
One solution is pipe as the other member has mentioned. Check out MSDN.
http://support.microsoft.com/default.aspx?scid=kb;en-us;190351
Kuphryn
|
|
|
|
|
I wrote email program which works fine, but the problem I have is resolving domain name server. For example if I want to send email to somebody@yahoo.com, the server is not really yahoo.com but rather mx2.mail.yahoo.com. My question: are there any API functions to querry DNS to get me the real server name, after which I can use gethostbyname() and send the email.
Thanx,
|
|
|
|
|
One solution is via getaddrinfo() and getnameinfo().
Kuphryn
|
|
|
|
|
Hi,
How do i disable a popup menu item in runtime (or change it's property to grayed) ?
For a regular menu item i would use the ON_UPDATE_COMMAND_UI macro, with the menu item's ID and the handler function. the problem is that a a popup menu item has no ID!
Does antone have an idea?
Regards,
Oren.
|
|
|
|
|
oren frenkel wrote:
the problem is that a a popup menu item has no ID!
Actually, you are wrong...
You have to give each item an ID when you are creating it. Either in resource editor,
or when you add each line.
BOOL AppendMenu( UINT nFlags, UINT nIDNewItem = 0, LPCTSTR lpszNewItem = NULL );
Off the top of my head, to get the ON_UPDATE_COMMAND_UI stuff working, just give
TrackPopupMenu your main window.
int nResult = mPopup.TrackPopupMenu (
TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RETURNCMD,
pt.x, pt.y, AfxGetMainWnd () );
Iain.
|
|
|
|
|
Hi every one...
I need to calculate the time in millisecondes to find an element in this array
in another way i want to calculate this time to compare between the binary search and the sequential search..
Pleae help me
|
|
|
|
|
Naif620 wrote:
...i want to calculate this time to compare between the binary search and the sequential search
Why bother? For three items and greater, a binary search will always take less time than a sequential search. The search time for for a binary tree is O(lg N) in the worst case. For sequential lists, the search time is O(N) in the worst case.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Brother I need to prove this by time,this is my taecher want.
|
|
|
|
|
If you are not interested in accuracy, try something like:
DWORD dwStart = GetTickCount();
DWORD dwStop = GetTickCount();
cout << (dwStop - dwStart) / 1000.0 << " seconds\n";
Another way that involves a bit more could would be:
unsigned __int64 nFreq;
QueryPerformanceFrequency((LARGE_INTEGER *) &nFreq);
unsigned __int64 nStart;
QueryPerformanceCounter((LARGE_INTEGER *) &nCtrStart);
unsigned __int64 nStop;
QueryPerformanceCounter((LARGE_INTEGER *) &nCtrStop);
cout << (nCtrStop - nCtrStart) / nFreq << " seconds\n";
But given that Windows is not a RTOS, you'll always be at the mercy of the hardware in terms of resolution.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hello everyone,
I have been working on an MFC SDI program whose Document actually has lists of lists (and possibly a list of a list of a list). I would like to get into a good habit and be consistent with the way I maintain collections (mostly lists, occasionally arrays and maps). Almost all my objects are derived from CObject (for serializing, etc.).
I guess it comes down to picking between CList<type, type>, CList<type, type&>, CList<type*, type*> and whatever other combinations. To keep sane, I think I always want to use CList<type*, type*>. That way, I just use the new operator at the point where an object needs to be instantiated and call delete on it (while traversing the list or sublist) at the 'outer' list's destructor.
I would like comments about this. Is it safe? Is it a decent practice to keep? How can I prevent double deleting the same objects (if that could even happen)? Does this choice affect how I code the required copy constructor and assignment operator (which always seem to involve references)?
Thanks in advance for any advice and comments!
Eric
|
|
|
|