|
I think I managed to fix the problem, it was to do with the UNICODE preprocessor assignments. I don't think the functions like these assignments on 98.
Mark Coleman
|
|
|
|
|
Hi All
I want to implement hook to trap console windows messages.
say for example ...
one console application is runing .and one my application is runing.
both are totally independent application.
what i want is if console application minized or maximized or moved , my application should flag a message.
see if any one can help me with code.
Thanx
Rdgs
Efan
|
|
|
|
|
I am using MAPISendMail to open the compose mail window of my default mail client. Everthing is working fine except when i use MS Outlook 2000 as my default mail client the new message window which is opened through my application cannot be minimized and also i cannot start my MS Outlook when the new mail message window is open. Can anyone provide a solution to it.
-- Subu --
|
|
|
|
|
hi all ,
I want to convert CString Object to BYTE Object.How do I do that?.
My CString Object and pointer BYTE Object is given below.
BYTE * sampleFeatures;
CString s1;
thanks in advance
|
|
|
|
|
Type Casting will help
CString s1="codeproject";<br />
BYTE *p=(BYTE*)(LPSTR)(LPCTSTR)s1;
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi There
Does anyone know the struture of Outlook's .MSG file? I would like to extract the actual email data/attachment from the file.
Any ideas/pointers?
Thanks
|
|
|
|
|
An Outlook MSG is just a text file with source code of your mail.
Take a look at Mail Propierties - Details - Source (with Express).
If you know a little SMTP, you understand this code.
Cheers!
JM
|
|
|
|
|
Is it possible to drop a dragged item between two nodes? That means the user should be able to "insert" a dragged item in the tree.
I've found nothing on this site yet
|
|
|
|
|
Hi Stevy,
Have u find answer for this question?. I'm also having the same issue can u please help me.
|
|
|
|
|
I have two dialog: one parent and one child.
Can I get the name (or the class) of the parent from the child?
thanks a lot
|
|
|
|
|
Really I don't Understand what do you want.
if You need to access the class member of parent from
child.
here is solution
In Child Dlg Class ,declare a var which is pointer to
Parent Class.
like this
CParentDlg *m_ParentDlg;
and Function
GetParentWnd(CParentDlg *m_Wnd)<br />
{<br />
m_ParentDlg=m_Wnd;<br />
}
now in Parent Class before calling the Child DLg
pass parent pointer
mChildDlg.GetParentWnd(this);
///call the domodal or showindow
and use m_ParentDlg in your Child class to access info from main parent Dlg
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks a lot for your answer but i can't use this solution.
I try to explain me better (i don't speak english very well).
I call the same child dialog from two different parent and i need to know wich is the parent in both the cases. Do you understand what i want?
Thanks a lot on more time!
|
|
|
|
|
Well, you could always send a registered message to your parent window and it can respond with a different return value depending upon which one it is.
Or, you can set a global variable containing the parent window's 'type when the parent is created and then the child can read it.
Or you can use GetParent and then call RealGetWindowClass.
There are other ways, but these came to mind pretty quickly.
|
|
|
|
|
CString str;
GetParent()->GetWindowText(str);
TOXCCT >>> GEII power [VisualCalc] | [toxcct]
|
|
|
|
|
|
There are two threads:
//thread_one:
{
HANDLE hEvent=CreateEvent(NULL,TRUE,FALSE,NULL);
SetEvent(hEvent);
// do sth
// ...
AfxBeginThread(thread_two,this);
WaitForSingleObject(hEvent,INFINITE);
// continue to do sth...
}
thread_two:
{
ResetEvent(hEvent);
// do sth
// ...
SetEvent(hEvent);
}
I want thread_one to wait at WaitForSingleObject until thread_two passing SetEvent.
But the fact is thread_one wait at WaitForSingleObject for ever!!
|
|
|
|
|
After CreateEvent the only place you need to do anything with the event is at the end of thread_two. Remove the SetEvent in thread_one and ResetEvent in thread_two. Also make sure that the SetEvent in thread_two really sets the event that the WaitForSingleObject is waiting for. Mind local variable scope. I.e. if you have and event handle in your class called hEvent, and you do:
HANDLE hEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
the class (or object really) hEvent (having the same name as above) will not be set and the WaitForSingleObject will wait for a non-initialized event, thus holding execution indefinitely.
Hope this helps.
|
|
|
|
|
The reason I call ReSetEvent is that WaitForSingleObject at thread_one is not always waiting for when thread_two sets the event, so I set the event to nonsignaled state by using ReSetEvent to make sure thread_one should wait at WaitForSingleObject when thread_two is running.
What's wrong with the ReSetEvent function I called could cause 'waiting for ever' ?
BTW. Assume there is no variable scope problem.
Thanks
|
|
|
|
|
Theres no problem per se. But the first reason thread_one is not waiting is because of the SetEvent (after the CreateEvent method). This means that when you get to the WaitForSingleObject, it will just continue right on. So as I said, you should remove it.
The second reason is multithreading. When you start thread_two, don't assume that the ResetEvent in thread_two will get executed before you get to the WaitForSingleObject in thread_one (it is less probable than not that that will ever happen). So this is why thread_one does not wait sometimes, all at the mercy of Windows thread scheduling.
So, remove the SetEvent in thread_one and the ResetEvent in thread_two (optionally of course, because it doesn't do anything) and the code as it stands should work A OK.
|
|
|
|
|
Thanks for help.
But I found sth strange.
When thread_one is waiting at WaitForSingleObject() and at the same time thread_two was also suspended instead of running as I supposed before.
I use a counter in thread_two to caculated how many steps passed by when thread_one is waiting for it, but the fact is that the counter remains the same between WaitForSingleObject(hEvent,1000); that is to say thread_two was suspended when thread_one call WaitForSingleObject, but why????
|
|
|
|
|
That does indeed sound strange. Are you linking with the multithreaded runtime libraries? Because that kind of odd behavior could arise from linking with the single threaded ones.
|
|
|
|
|
Your hEvent in Thread one is a local variable which never gets set. Make it a class member or a global variable and then set that global variable from outside thread one.
Stuck to Programming through an unbreakable bond
My Articles
|
|
|
|
|
How to save the bmp file?
the data is YUYV format.
Give me a sample ,thanks !
could I first convert the data from YUV format to RGB format?
.
|
|
|
|
|
http://www.codeproject.com/bitmap/[^]
Articles:
CxImage // LARGE: handles multiple images formats
CDibData // SMALL: load, save, access (NEEDS UPDATING)
CDIBsectionLite // SMALL: load, save, access
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
hi, i was developing a plug-in for IE regarding image. I'm looking for event handler which will get fired whenever a image is found, or downloaded/loaded, or by user's command.(e.g. by IE itself will display email to fren etc whenever u right click on a image, and only on a image)
may be i can make use of DWebBrowserEvent2 , e.g. BeforeNavigate2,DownloadBegin,DownComplate etc, but how to i specify it so it only works to a image file ?
any help is much appreciated, thx a lot
|
|
|
|