|
Maintaining .def file is obsolete with currect C++ compilers. Instead you can use __declspec(dllexport) .
|
|
|
|
|
|
Hi All,
I have some CEdit's in an CFormView and I can do copy&paste by using the contextual menu but I just cannot do that by using the keyboard combinations Ctrl+C, Ctrl+V and so on. Of course there is no such problem for a CEdit in a CDialog.
I suppose there are some keywords' related messages eaten by CFormView. Any tips on how to solve that? Thanks.
Regards,
Cosmin Unguru
|
|
|
|
|
does your app have accelerators defined for those keyboard combinations?
|
|
|
|
|
Yes it does, for copy, cut and paste. I tried to remove them but with no different results.
Regards,
Cosmin Unguru
|
|
|
|
|
hi iam doing a project to list <like dir=""> but only header files any good refrence for me?
|
|
|
|
|
arifliminto86 wrote: hi iam doing a project to list but only header files any good refrence for me?
Sorry?
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.
|
|
|
|
|
arifliminto86 wrote: hi iam doing a project to list but only header files any good refrence for me?
sorry dude.. this windows programing forum.. here linux is rare breed.. you have to search google for linux grp!
|
|
|
|
|
How the f*** this is sickening.
void fun(int);
void main()
{
int a ;
a=3;
fun(a);
}
void fun(int n)
{
if(n==0)
exit(0);<--If I put this the ouput is nothing, but if I remove it, the idiot compiler is bypassing the condition (0>0),(-1>0).
if(n>0)
{
printf("\nTHERE!");
fun(--n);
printf("\n%d",n);
fun(--n);
}
else
{
printf("\nHERE!");
}
}
How 0,-1 can be > than 0? sh*t. I'm not on drugs! but mark,led,jeron,toxcct,david someone help! help!
without exit(0),it prints
0
1
2
0
----------------------------
286? WOWW!
|
|
|
|
|
First off, what is the output you are expecting? With the recursive calls you are making the output you are getting makes perfect sense.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Thanks Arends,
but why does it bypass this condtion when n =0, or -1
<br />
if(n>0)
{<br />
but still it comes here! why? <br />
}<br />
I still can't get that point. Recursion makes multiple copies of the function? may be I'm missing this? it gets into the stack everytime we call it, so the context of "n" changes? I can somehow come around the point but still need some help to understand it. Please help dude.
-- modified at 14:06 Saturday 31st March, 2007
----------------------------
286? WOWW!
|
|
|
|
|
_8086 wrote: but why does it bypass this condtion when n =0, or -1
It does not, the recursive function calls stop when n is zero or less.
I think your confusion is coming from what n is. You have to remember that a new n is created every time fun() is called, you are not using a single n .
I cleaned up your sample a bit, so lets step through it:
void fun(int n)
{
if (n > 0)
{
fun(--n);
+void fun(int n)
|{
| if (n > 0)
| {
| fun(--n)
|
| +void fun(int n)
| |{
| | if (n > 0)
| | {
| | fun(--n)
| |
| | +void fun(int n)
| | |{
| | | if (n > 0)
| | | {
| | | fun(--n)
| | | printf("%d\n", n);
| | | }
| | +}
| |
| | printf("%d\n", n);
| | }
| +}
|
| printf("%d\n", n);
| }
+}
printf("%d\n", n);
}
} and repeat ad infinitum.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
|
Of course the compiler is working fine. Please follow me in code inspection, to make analysis shorter, let's start with fun(2) :
fun(2){
if(2>0){
fun(1);
At the moment (no output yet produced) we have to stop considering fun(2) and, due to recursion, procede with the inspection of fun(1) :
fun(1){
if(1>0){
fun(0);
Again (no output yet), we have to suspend considering fun(1) and go deeper in recursion with fun(0) :
fun(0){
if(0>0){
Here, the compiler, that is a honest guy, correctly evaluates (0>0) as false and the function returns. Have we done? No, of course, there are (in the order) fun(1) and fun(2) waiting on the stack. So let's go back to fun(1) and reprise whereever we suspended:
printf("\n%d",0);
fun(-1);
}
As you can see, this is the first time we have a number on the console, and the number is 0 (you can also see that fun(-1) is called, but it will do nothing). Of course we could go on with code inspection, but I think it's enough: we have the zero , and we also have the demonstration that the compiler is not insane.
hope that:
(1) the analysis is correct.
(2) it helps.
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.
|
|
|
|
|
|
Hello,
From where can I get the parameters which are required for
CHttpConnection class.
I basiacally want to get data from a remote computer .I have the IP address of the computer .Both the computers have internet access.
I have been through all the MFC iternet classes.But I do't understand from where these parameters be available.
CHttpConnection* GetHttpConnection( LPCTSTR pstrServer, INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER, LPCTSTR pstrUserName = NULL, LPCTSTR pstrPassword = NULL );
Prithaa
|
|
|
|
|
Is this related to your ip address question below?
To get a file from a remote computer, the remote computer needs some kind of server to serve
you the file.
To use CHttpConnection there needs to be an HTTP server running on the remote computer.
To use CFtpConnection there needs to be an FTP server running on the remote computer.
etc.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hello
Yes my problem is related to the ip address problem.
My remote computer is having an internet connection.
It does not have any server.
I thought ip address should be enough to recognize the PC on the Net.
If I am using a CDatabase class to access a remote computer's database then what kind of connection string should I provide.
Can you give me a link for the same.
I think there are many people on this site asking the same question.You can link me to that question if possible.
Prithaa
|
|
|
|
|
Without some kind of "server" running on the remote machine (HTTP,FTP,SQL Server, etc.) then
an IP address isn't useful. There needs to be some application waiting for connections at the
given address (IP/Port).
Connection strings vary between databases - what database are you connecting to?
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hello,
Right now I am connecting to access database but soon I will have to connect to SQl server.
I have created an ODBC driver for my PC for access database but if I have the database on a remote computer then I will have add something in the network connections option of ODBC driver and provide a proper connection string in my CDatabase class isn't it?
But I don't know how to do the changes?
Prithaa
|
|
|
|
|
|
Thanks I will refer that
Prithaa
|
|
|
|
|
i have 5 icons .. iam loading these icons into one static control...
then what the problem is after loading 4000 times into static control it exit automatically...
what the problem i dont know sir....
<br />
CString strFilename,strPercent,strFileExt;<br />
strFileExt=(LPSTR)wparam;<br />
<br />
if(strFile=="BMP0")<br />
{<br />
m_stIcons1[icons].SetIcon(::LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_BMP)));<br />
}<br />
else<br />
if(strFile=="BMP1")<br />
{<br />
m_stIcons1[icons].SetIcon(::LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_BMP1)));<br />
}<br />
else<br />
if(strFile=="BMP2")<br />
{<br />
m_stIcons1[icons].SetIcon(::LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_BMP2)));<br />
}<br />
else<br />
if(strFile=="BMP3")<br />
{<br />
m_stIcons1[icons].SetIcon(::LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_BMP3)));<br />
}<br />
else<br />
if(strFile=="BMP4")<br />
{<br />
m_stIcons1[icons].SetIcon(::LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_BMP4)));<br />
}<br />
hIcon=m_stIcons1[icons].GetIcon();<br />
<br />
DestroyIcon(hIcon);<br />
m_stIcons1[icons].DestroyWindow();<br />
m_stFileName1[icons].DestroyWindow();<br />
m_stPercent1[icons].DestroyWindow();<br />
icons++;<br />
IconRes++;<br />
<br />
<br />
Regards,
Srinivas
|
|
|
|
|
Maybe the following excerpt from MSDN will be helpful:
Remarks
It is only necessary to call DestroyIcon for icons and cursors created
with the CreateIconIndirect function.
Do not use this function to destroy a shared icon.
A shared icon is valid as long as the module from which it was loaded remains in memory.
The following functions obtain a shared icon:
LoadIcon
LoadImage (if you use the LR_SHARED flag)
CopyImage (if you use the LR_COPYRETURNORG flag and the hImage parameter is a shared icon)
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.
|
|
|
|
|
I am using Microsoft Windows-xp professional Version 2002 Service Pack 2. I am writting an application to write to CDs and I am using ICDBurn interface. But When i run this application I ge this error that
fatal error C1083: Cannot open include file: 'IMapi.h': No such file or directory
Where I can find this file. any suggesstion.......
Thanks
|
|
|
|