|
Hi all,
i want to assign a hyperperlink for send mail with use of static control.
i want when i move mouse on the static control hand cursor displayed.
when i clicked over it than mail window open and here mail address in To field and some subject in subject field,and some body text display in body of mail.
please tell me how can i do this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
|
when i clicked over it and than close the mail window and again clicked over it than its gives error and becomes not responding and close tha application.
and this comes when i run my application on VISTA
please help me for this.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
modified on Monday, March 23, 2009 7:05 AM
|
|
|
|
|
Download the source and single step through the code.
I'm sure you will find what the problem is.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I m downlad the code and check it but i m not find error please help me.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi there.
Lets say I have created a file as below...
#include <stdio.h>
int main ()
{
FILE * pFile;
int n;
char name [100];
pFile = fopen ("myfile.txt","w");
for (n=0 ; n<3 ; n++)
{
puts ("please, enter a name: ");
gets (name);
fprintf (pFile, "Name %d [%-10.10s]\n",n,name);
}
fclose (pFile);
return 0;
}
Now, my requirement is, each and every time I write a name into the file, i want to delete the previous name.
So, at a time I want to have just one name in the file.
Please suggest.
Thanks & Regards
PanB
|
|
|
|
|
It seems you are doing it the right way. Opening a file using fopen with "w" as the parameter creates an empty file for writing. If a file with the same name already exists its content is erased and the file is treated as a new empty file.
but since you are writing in the for loop the contents are written such that the file contains all the three names or names equal to the number of iterations
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
What i want to do is, at one point I just want to have one entry in the file. If you run attached program, you will find three entries in the same.
|
|
|
|
|
Instead of opening the file once at the begining, you could simply open it in your loop. Thus, each time you open it, the previous contents are deleted. Don't forget to close it afterwards.
|
|
|
|
|
Why do you want the loop, if you want only 1 name in the file.
And if you really want the loop, put the fopen and fclose inside the loop.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
The code was just a sample code... I want to update some information lets say for more than 1000 times, so dont you think that will an overhead? I think better option will be deleting contents amd updating the same with the updated information. Please suggest.
|
|
|
|
|
I'm not very sure of the performance issues here.
For overwriting the file you will need to first bring the pointer back to the begining.
You can use rewind() for that.
After writing the new data, if the newer data is of a smaller size than the earlier, you will need to make the file smaller.
You can use _chsize() for that.
You could probably try to either use fopen/fclose inside the loop or rewind/_chsize inside the loop, loop for 1000 or more times and compare the performance.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
PankajB wrote: Now, my requirement is, each and every time I write a name into the file, i want to delete the previous name.
Little weird. So what do achieve by writing them into the file immediately? If you want to keep the last-entered text to be written, you can keep them in a temp buffer and write it into the file at the end. Otherwise if you want to keep up the requirement, I'd suggest the same as everybody there, something like
ofstream ofs;
while(your_input_loop)
{
ofs.open("txt",ios::out);
ofs.close();
}
As you show in your code, the control already waits for user inputs. So it doesn't make sense to count performance there.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
What about:
#include <stdio.h>
void main( void )
{
char name[100];
for (int n = 0; n < 3; n++)
{
puts("Please, enter a name: ");
gets(name);
}
FILE *pFile = fopen("myfile.txt", "w");
fprintf(pFile, "Name %d [%-10.10s]\n", n, name);
fclose(pFile);
}
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
Can we create a Toolbar without MenuBar in Visual Studio 2008 (MFC).
I don't want to add a Menubar in my application. Instead of menubar, i want only toolbar to be attached with mainframe window?
Is it possible to do this?
If yes, help with some code?
Thanks
Abhijit
|
|
|
|
|
Don't you just sent the menu to NULL to make it go away?
Will be a little bit fiddly, but early in CMainFrame::OnCreate, just call SetMenu(NULL)...
MSDN wrote: BOOL CWnd::SetMenu( CMenu* pMenu );
Identifies the new menu. If this parameter is NULL, the current menu is removed.
So:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (baseCMainFrame::OnCreate(lpCreateStruct) == -1)
return -1;
SetMenu (NULL);
...
return 0;
}
Just had another thought... Could you just remove the menu resource from your resources?
None of this is tested, and I assume MFC hasn't changed fundamentally from VC6 (which is a fairly safe assumption)
Good luck,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Thank you sir,
It's working fine.
If i do SetMenu (NULL); it works. But if you delete Menubar resource from resources, it give's an error.
|
|
|
|
|
I did have that suspicion, which is why it wasn't the first thought.
Glad to hear you got the answer you wanted!
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
In my VC++ project floating point division by zero operations (and overflow/underflow etc.) used to generate 1.#INF000000000000, NaN etc.
Recently for some reason the same operations create an error message:
Unhandled exception at 0x0341f550 in xevi34_2.exe: 0xC000008E: Floating-point division by zero.
Does someone have an idea why this could happen? I am using VCC Studio v8 (2005).
Interesting: If I create a new project and try the division by zero there it still gives back the 1.#INF000000000000 value.
Thanks!
sor73naf
|
|
|
|
|
Maybe you've enabled the floating point exceptions option (in Project -> Project Properties -> Configuration settings -> C/C++ -> Code generation, option "Enable floating point exceptions")?
|
|
|
|
|
Hi Dominik. Thanks for your quick suggestion. Unfortunately, no, this option is not enabled. Any other ideas?
Thanks, sor73naf
|
|
|
|
|
First question:
The INTERNET_CACHE_ENTRY_INFO has a member LPBYTE lpHeaderInfo pointing to a buffer holding the header info. Does anybody know the structure (format) of that header info ?
To me it seems that the title of the web page starts at offset 0x38 (that's what I'm interrested to know) but I'm not sure it's happening all the time under al versions of Windows and IE. That's why I would like to see some documentation about that.
Second question:
The header info holds the title using a strange coding for the characters, each character on 32 bits (4 bytes). I don't know any character/string format on 32 bits. What's the name of that kind of character/string ? How can I convert it to standard unicode (on 16 bits) ?
I understand I could simply copy it to another buffer and skip bits 16-31, but I'm not sure it will work with any kind of unicode characters.
I use a 64 bit Centrino processor, 64 bit Vista Ultimate, 32 bit IE7, VS2008.
modified on Monday, March 23, 2009 4:53 AM
|
|
|
|
|
I've got some C code that using single FILE* fp does those:
FILE* fp;
fp = fopen(binfile, "rb");
fclose(fp);
fp = fopen(txtfile, "rt");
fclose(fp);
I found the SEH location by puting printf() enclosing fclose(fp)
Чесноков
|
|
|
|
|
Chesnokov Yuriy wrote: fp = fopen(txtfile, "rt");
//read it with fscanf
fclose(fp);
Are you sure "txtfile" exist? And the opening is successful?
Just try this protectionalism:
fp = fopen(txtfile, "rt");
if(fp){
fclose(fp);}
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
It is already there, and the file also. How can it read it in debug mode exe and SEH the same code in Release? That is the point.
Чесноков
|
|
|
|