|
Im just stumped on this and Im looking for any kind of demo
project to guide me alittle.
I have a CFormView project. If the user clicks the X in the
upper right corner or clicks File/Exit, I want to run a quick
command and then terminate the program. I dont know how to
handle the clicking of the X in the upper right corner and
if I try to handle File/Exit, the program never actually
terminates.
Any ideas or demo project on how to safely exit a program.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
|
Hi, all
I have such construction:
class CMyClass : public CObject
{
public:
static CMapWordToPtr m_Map;
}
In another file I try to access this member:
char* val = "Something";
CMyClass::m_Map[1] = val;
The linker gets an error:
error LNK2001: unresolved external symbol "public: static class CMapWordToPtr CMyClass::m_Map" (?m_Map@CMyClass@@2VCMapWordToPtr@@A)
Is it possible to access to this member in some way?
Thanks.
Mykhaylo
|
|
|
|
|
You will still need to declare the member in a source file for it to be created:
CMapWorldToPtr CMyClass::m_Map;
|
|
|
|
|
Thanks a lot!
|
|
|
|
|
Just give a Outre defination of your static CMapToPtr this way
class CMyClass : public CObject
{
public:
static CMapWordToPtr m_Map;
}
In your myclass.cpp file
CMapWordToPtr CMyClass::m_Map;
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I'm using by MFC class CButton to create buttons on my dialog box.
I have to create buttons with a different color of text.
How I can make it ?
|
|
|
|
|
Follow These Steps
1 first make your button Owner Drawn , you will find this property by right clicking the button in Design View
2. then handle the WM_CTLCOLOR message wher nIDColor=..._btn
3. For Setting the Text Color use Api SetTextColor(...);
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Owner Drawn property cause to button be unvisible ???
About steps 2 and 3 I made like that:
<br />
HBRUSH CvisualCalcDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)<br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
if (pWnd->GetDlgCtrlID()==IDC_BUTTON1)<br />
{<br />
pDC->SetTextColor(RGB(0,0,255));<br />
}<br />
<br />
return hbr;<br />
}<br />
but it doesn't helps.
Could you explain more detailed ?
Please
|
|
|
|
|
This[^] article may help. See the section on colored captions.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
Why don't you use the activex button's of microsoft?
also,you can use all the button available here in Code project...
isn't it easier????
Regards,
Eli
|
|
|
|
|
Many ISPs put limits on the amount of internet traffic that an account can have before charging extra. Is there any way that a program can enquire as to how much data has been sent and received? Similar to the data supplied on the network status dialog.
|
|
|
|
|
Look for FireWall source code here At Code project in Internet Section or read documatation of IPHELPER apis in MSDN or look at this article by Mr David Crow here
http://www.codeproject.com/internet/IPHelper.asp
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
That's interesting stuff. Lots of useful functions there. However the statistics give the number of datagrams received, not the number of bytes, which is what ISPs quote. Are datagrams a fixed size? Or are there other functions?
|
|
|
|
|
Hello There!
This Morning i find a function that will give you statistics in Bytes.
And Function is RasGetConnectionStatistics
Hope that's Work Well for you.
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
|
GetTcpStatistics()
GetIPStatisticsEx()
suhredayan There is no spoon.
|
|
|
|
|
These return the number of segments / datagrams and not the number of bytes transmitted / received which is what ISPs quote.
|
|
|
|
|
if i add function sprintf(...), the com can not be compiled with error "unresolved external symbol _main".
if i remove the function (one call in one line), the com is compiled without any problem.
i never change any #include
why the sprintf() causes a main() function error?
confused. how to solve the problem?
thx
includeh10
|
|
|
|
|
have u included following
#include <stdio.h>
char buffer[200], s[] = "computer";
int j;
/* Format and print various data: */
j = sprintf( buffer, "\tString: %s\n", s );
Hope this helps
Jetli
Constant Thing In World Is Change.
|
|
|
|
|
what are u talking about?????????
includeh10
|
|
|
|
|
includeh10 wrote:
if i add function sprintf(...), the com can not be compiled with error "unresolved external symbol _main".
Hello Sir,
here is the solution:-
http://www.codeproject.com/useritems/SimpleATLCom.asp?df=100&forumid=124516&mpp=50&select=1034086#xx1034086xx
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
|
Hello ,2 everyone
I had a problem .
I want to
accept multiple connections on the same port.
Perhaps I could use a master Winsock control and on the DataArrival event,
somehow spawn a child Winsock thread and delegate the event to it. How?
Any hint would be helpful.
Can i have a sample code
Thanks!
Rahul Agarwal
|
|
|
|
|
there are many tcp/ip samples in VC disks, i think the best way is to start from a sample because it is hard to say all you need in a few of lines.
includeh10
|
|
|
|