|
Kindly help me out in this...
Regards,
Kushagra
|
|
|
|
|
If my pointer is pointing an invalid object. How to find proactively in run-time.
|
|
|
|
|
there are some memory check functions as _CrtIsValidPointer()
It is strongly recommanded to avoid this situation. use pointers to data, only for copying the data, if you need it later. -> make your own object
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
To check the validity of the pointer in Windows there are API functions called IsBadReadPtr and IsBadWritePtr to do that.
P.S. While using pointer developer should be careful that pointer is set to NULL once it is deleted. And not to use the deleted pointer before allocating memory.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
There is no reasonable and fool proof way to make this check.
You as a programmer must ensure that this never happens.
Smart pointers can help you to an extent.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I have ported my activex plugin to 64bit by compiling with x64. it has created .ocx file as well as .dll file.
Created cab and inf file to install my activex plugin.
When i install it crashes.
I ran dependency walker on .ocx file it says
two dlls not found...
devmgr.dll dwmapi.dll
please let me know how to resolve....
|
|
|
|
|
for(i=0;i=printf("Hello");i++);
printf("Hello");
how many times hello will be printed?????????n why?
|
|
|
|
|
it is an endless loop, the condition is always true.
In
i=printf("Hello");
it will always be 5.
|
|
|
|
|
syntax of printf is
int printf ( const char * format, ... );
so it returns the size of the characters displayed, here "Hello" number of characters is 5.
since
for ( i = 0; i = 5; i++ ) is condition on execution.
now u can see that i=5 is condition which will never ends, so its a infinite loop
|
|
|
|
|
Hello everybody
iam creating a dlu plugin, in that, iam storing values in a structure. i need to access the same values from another plugin (exporter plugin, dle). how to access that?
|
|
|
|
|
Hi,
I want to create a simple client server application by using CAsyncSocket class of MFC to send and receive messages(data) through internet connection. I found a lot of stuff for this at .net plateform but I want to do it in VC++ ( with out .net support).
I found article at this site helpful but could not make the application working.
http://www.codersource.net/mfc_window_socket_programming_server.html[^]
I could not figure out the sequence of operations properly even after having some time with msdn as well. I remember in old days there was a book named "VC++ in 21 days" and it has a chapter related with client server application.
Any link where I can find an MFC based code for the stuff or any tutorial for this work.
|
|
|
|
|
|
Thanks. This link helped me a lot and I sucdeed in extracting the required knowledge and code form it.
|
|
|
|
|
I have a dialog box on which some Edit boxes are there.
For validation of values in edit boxes, i have handled EN_KILLFOCUS.
When EN_KILLFOCUS is called, value in edit box is validated.
If validation fails, then AfxMessageBox is displayed "Input value is in correct".
The problem is when i press ALT+TAB and switch to another application, the Afxmessagebox is re-displayed because EN_KILLFOCUS is called again.
Please let me know any solution to be handled in EN_KILLFOCUS so that Afxmessagbox is not displayed.
Thanking you in advance.
Regards,
Sharda.
modified on Friday, July 24, 2009 12:41 AM
|
|
|
|
|
Generally it is not a good idea to validate user input on focus loss, for example see here[^]. In the old times when i tried to do the same i ran into all kinds or troubles myself. If you can i recommend rethinking your validation system.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes your right...I also know it that validation in kill focus is not a good idea....but still i have to do it because its an requirement...
Please suggest be some idea to handle this situation....
|
|
|
|
|
I guess if it was easy to solve it wouldn't be a problem to validate on focus loss. You could try to check if the window who gets the focus belongs to your application or not, or maybe check if your aplication is the active application on the syatem or not and not display the message if it is not. Do these make any sense?
How about a different aproach? Don't display a message box but change the errorous edit field's background color to red for example, and maybe have a static field or such placed somewhere on your dialog that explains to the user what is wrong with the edit field, maybe show the error message in a tooltip when the user points his mouse at the edit field. Or is the message box itself also a requirement?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
validating data is done in the OnOk(). If the data is invalid, dieplay a message and DONT close the dialog. (I am setting the focus to the invalid data to help)
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
|
Hi guys
I have a project using Multi-Byte Character Set, but i need to open some files wich names and/or paths may have Unicode Chars.
How can i use CFileDialog with Unicode support in my project without changing my project configuration to Unicode char set?
|
|
|
|
|
Hi ,
There are always aliases of the functions in Widechar or ANSI .So for example u have a function WriteprivateprofileString () .It will be available in WriteprivateprofileStringA () and WriteprivateprofileStringW ().Similarly, for unicode you will have to use function equivalents in ANSI to get your job done. So, no need of switching to UNICODE.
|
|
|
|
|
I Know that there are counterparts to Ansi o Widechar Functions.
The thing is that i can not find the Widechar version of CFileDialog
There is no CFileDialogW, there is a LPOPENFILENAMEW but how do you use it with CFIleDialog
|
|
|
|
|
Hi,
How can i increase the height of the Title bar of a Dialog Box based on the font size.....
|
|
|
|
|
I think default title bar is something managed by Windows Theme.
To achieve the things you want you need to create a custom Title bar.
here[^] is one link. You may get many if you search for that.
I hope this is the thing you are looking for.
Please reply if this is not as expected.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
i need to increase the height without using custom title bar...
|
|
|
|