|
"Child dialog" is nearly always used in a general sense, hence the question.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi ,
when the child gets destroyed it send a wm_destroy trap it and do what you want to do their ,or post a message to the parent with the help of sendmessage( or a user message), trap it at parent .
Regards
farpointer
|
|
|
|
|
I can't do that in WM_Destroy as it sends assert failure as the parent dialog is about to be closed because i need to do some manipulations on class member of Parent Dialog.
I make an object in the OnDestroy event of child to modify Parent's label control.But when destructors are called child destructor is called first and in that destructor (Parent object was created so it causes assertion failure).
If any other method to solve this please send some code snippet for that
Thanx alot
Asif Rogers
asifrogers
|
|
|
|
|
Thanx i have managed to make my self defined event.
So nice of you n God Bless You
asifrogers
|
|
|
|
|
Hi
Any pointers to set BMP/GIF image as a background image.
Regards
Anniyan
|
|
|
|
|
Hi..
I want to write one program search 10 numbers element. we are 100 numberal
Example number: 193493049139458195314951935................
Thanks.
|
|
|
|
|
I have two questions really bothers me.
1. Is it possible to have .Net assembly with global functions so that I can add reference and use them in my application by ::globalfunctions?
2. I have one small solution with two projects: one to create the dll and the other is to consume it. In the application, I can see the intellisense recognize the member in the namespace. But when I compile, I got error 2039 "something" is not a member of "namespace".
Any help will be greatly appreciated.
|
|
|
|
|
i'm just getting into programming and for one of my projects involves opening a file, but if it doesn't exist it is not supposed to create one, but rather output an error message. in some cases, if i give it a file location that doesn't exist, it outputs the message and doesn't create a file, but most of the time it creates the file and doesn't output the message. why is this?
any help would be much appreciated
thanks
-james
jnerv
|
|
|
|
|
jnerv wrote: most of the time it creates the file and doesn't output the message.
What function are you using?
You may try PathFileExists()
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
If you're using MFC CFile class if you will pass only CFile::modeRead it won't create it if it doesn't exist (Open function).
If you're using fopen pass only 'r' to mode parameter and the function will fail if the file does not exist.
|
|
|
|
|
right on, thanks for the help guys. saved me another day of tearing my hair out, haha.
muchas gracias
later
-james
|
|
|
|
|
if u use CreateFile()
Specifiy the create dispozition paramater: OPEN_EXISTING;
if the function return INVALID_HANDLE_VALUE then it does not exist or u can use GetLastError() and FormatMessage() to see the exact error returned hope this helps
gabby
|
|
|
|
|
Another way for you knowledge:-
You can also use
CFile::GetFileStatus(CString filename,CFileStatus status) a static function
returns false if it doesnt exist and then return from your function.
Regards
farPointer
|
|
|
|
|
jnerv wrote: if i give it a file location that doesn't exist, it outputs the message and doesn't create a file, but most of the time it creates the file and doesn't output the message. why is this?
Which Api/Class are you using to read/write File.. as these api contain flags... which can return ERRROR is no file Exist by that name on the specified path.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I all [[]]
Is this ok?
<br />
class errorMemoryShortage;<br />
<br />
int Func( void )<br />
{<br />
SomeType* SomeVar;<br />
<br />
SomeVar = new SomeType;<br />
if ( !SomeVar ) throw new errorMemoryShortage;<br />
}<br />
If there is no memory how can i throw an exception?
Thx!
Peace [[]]
hint_54@hotmail.com
|
|
|
|
|
If there is not enough memory, new will throw bad_alloc exception for you anyway and you will never even get to your NULL test.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
> If there is no memory how can i throw an exception?
Never *ever* throw exceptions which allocate memory dynamically (or dynamically allocate the exception object itself), when you are out of memory. Things may happen to your application which you may not recover from if you had a thousand catch clauses (I love paraphrasing lyrics by the way )
As Nemanja says, "reuse" the exception which new provides for you. You'll be much better off that way.
--
Pictures[^] from my Japan trip.
|
|
|
|
|
At least in my case. What I am trying to do is to obtain an icon from an executable and to add it among with exe name to the report-styled list control.
<br />
if(ExtractIconEx(str,0,NULL,NULL,0) > 0)<br />
{<br />
ExtractIconEx(str,0,NULL,&hIcon,1);<br />
m_plistIcons->Add(hIcon);<br />
}<br />
else<br />
m_plistIcons->Add(m_hIcon);<br />
What I get is while every run the handle is different and after the loop ends image list contains 37 entries the only icon which is applied to absolutly all list items is the first added to the image list.
Image list is being attached to list control using this line:
m_ProcList.SetImageList(m_plistIcons,LVSIL_SMALL);
I am quite sure I'm doing something wrong. I just dunno what.
-- modified at 4:49 Saturday 10th December, 2005
|
|
|
|
|
Nobody knows ? Not a single human being ? I take help from aliens as well...as long as you speak the language I speak
|
|
|
|
|
Maybe it depends on how you add the items to your list control. By default the CListCtrl assumes to use image 0 for all items. You have to specify for every item which image it should use.
|
|
|
|
|
Wow. Some people wonder outside of page 1 Anyway I've figured it out on my own but thanks anyway.
--------------------------------
Human stupidity is infinite.
|
|
|
|
|
hi guys
Im trying me in managed C++ Appications. I have a string ( System::String^ item; ) an i want to compare it with another one ( "abc" ). My first idea was strstr but it dont works ( something like cannot convert ... ) Now its your turn. I need a similiar function that works like strstr in managed c++
Salut!
|
|
|
|
|
MaTTEvIL wrote: hi guys
Im trying me in managed C++ Appications. I have a string ( System::String^ item; ) an i want to compare it with another one ( "abc" ). My first idea was strstr but it dont works ( something like cannot convert ... ) Now its your turn. I need a similiar function that works like strstr in managed c++
Salut!
strstr does not compare two strings, it is used to search a string for a substring. You probably mean strcmp .
For managed strings, use String::Compare .
Alternatively you can compare the String handles directly using the == operator, because due to string interning, all handle variables to the same string will have the same handle value.
|
|
|
|
|
Anyone use this product? If so, did you update it for VC7+? If so...I need to talk to you!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Hello everybody,
i'm using Word automation to generate some data reports in word for printing.
Because my program is a top-level window i need to bring the word window to the top level
to make it accessible. I use a method explained here.
This method of changing the caption with automation and find it with the API FindWindow works like
a charm with Word97. But with Word 2003 the FindWindow API finds nothing . I searched a couple of hours on the internet, but I can't seem to find some answer/hint on how to pull it off.
All suggestions are welcome .
Greets Remco.
|
|
|
|