|
problems...
look at the following code:
void CMyWnd::OnListItemChanging(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLISTVIEW *pState = (NMLISTVIEW *)pNMHDR;
if (0 == pState->uNewState && 2 == pState->uOldState)
{
if (!m_pDlg->ValidatePage())
{
AfxMessageBox(_T("aa"));
*pResult = TRUE;
}
else
{
*pResult = FALSE;
}
}
}
First time i step into the function, the uNewState is 0 and uOldState is 2 therefor validation is being checked and a message box pops. the function then returns TRUE which means it doesn't allow the new selection to be made.
but i see i step into this function again, with the same parameter values (for uNewState and uOldState) so once again i see the message box for validation
how can i solve this?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
The msdn says the following:
Programming Considerations
For WIN32 graphical applications: when the currently logged-in user is logging-off, all WIN32 top-level windows receive WM_QUERYENDSESSION and WM_ENDSESSION messages. Some WIN32 applications choose to terminate upon receipt of such messages. In order for your WIN32 application to survive logoff, it must not do that: instead, your windows procedure should call the default windows procedure on these messages.
But I have no idea how to develop this?
Can anybady give me an advice or example, how to make my srvany-service "logoff-save"?
Thank you!
|
|
|
|
|
steff.k@gmx.net wrote: Can anybady give me an advice or example, how to make my srvany-service "logoff-save"?
Just return 0 when you receive the WM_QUERYENDSESSION message.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
|
hi experts
i have a dialog-based application in which i had placed two buttons.when the first button is pushed it wil start generating some strings.so when i pushed the next button it should stop generating strings.itried it with some bool variables .but control is not received to stop button.how can i do that?
joy
|
|
|
|
|
When you start you first button, how the data is generated ? In a loop ?
If yes, start a new thread to process the data and like that, it won't freeze the GUI. Then, you can simply have a boolean set to true/false to continue the loop or not.
|
|
|
|
|
hi
sorry to disturb you.can you please tell me how can i start a thread?
thanking you
joy
|
|
|
|
|
You can use the CreateThread[^] function for that. Anyhow, I think you need to read a little bit how to work with threads. Make a search in the articles of this website, perhaps you'll find something usefull. Also, google can help
It is a little bit long to explain how it works in a post.
|
|
|
|
|
either use a separate thread for the 'generate some strings' part, or use the old-fashioned "message pump" function inside your string generating code.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
What is msgsrv.exe? What is it responsible for?
|
|
|
|
|
Aryan S wrote: What is msgsrv.exe?
Windows' 32-bit message server.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
MS has a kb article about it: http://support.microsoft.com/kb/q138708/
|
|
|
|
|
Hi,
I'd like to know how it's possible de edit a EMF with visualC++
I want to be able to import an EMF image and explode it, to be able to eddit the text in the image
thanks
|
|
|
|
|
|
Thanks Chris
What about the function :EnumEnhMetaFile , I just read that I can use it to edit a EMF, but there is to example about
Thanks
|
|
|
|
|
|
How do I programmatically create shortcuts for .exes?
NULL
|
|
|
|
|
|
We have a situation where a non mfc dll must depend on mfc dll.
When trying to compile, we got an error saying that Windows.h is already included.
When the _WINDOWS_ definition was undeffed, the compile error was gone, however it shows bunch of link errors.
Do you have any idea how to fix this? Thanks a lot!!
NonMFCDll error LNK2001: unresolved external symbol ___argc
NonMFCDll error LNK2001: unresolved external symbol ___argv
NonMFCDll error LNK2001: unresolved external symbol __mbctype
NonMFCDll error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in msvcprt.lib(newop_s.obj)
NonMFCDll error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in MSVCRT.lib(MSVCR71.dll)
NonMFCDll error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in MSVCRT.lib(MSVCR71.dll)
NonMFCDll error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)
NonMFCDll error LNK2019: unresolved external symbol __mbctype referenced in function "void __stdcall _AfxAbbreviateName(char *,int,int)" (?_AfxAbbreviateName@@YGXPADHH@Z)
NonMFCDll fatal error LNK1120: 3 unresolved externals
Kurnia
|
|
|
|
|
Have you tried adding mfc71.dll (in your release build) or mfc71d.dll (in your debug build) to the Ignore Specific Library (/NODEFAULTLIB) property?
|
|
|
|
|
That should be mfc71.lib and mfc71d.lib, or mfc71u.lib and mfc71ud.lib in a wide character application.
|
|
|
|
|
Actually the NonMFCDll uses preprocessor _USRDLL. Removal of this and adding of _AFXDLL solved the problem. Thank you all.
|
|
|
|
|
i would really appreciate some simple example of creating SAFEARRAY and inserting couple of strings (probably BSTR, i don't know for now but convertion is not a problem) into it. there's plenty about it on the internet but none of sites seem to provide just a simple exlpanation how it all works...
regards
|
|
|
|
|
scoroop wrote: a simple exlpanation how it all works...
Umm, what do you mean...
I think samples found on internet and MSDN would explain what you need to know to be able to use SafeArrays.
If those for some reason are not detailed enough I doubt the more detailed explanation would be "simple".
Try to rephrase your question and provide a description of what you want to do, why you've picked that particular solution for your problem and explain what doesn't seem to work as expected. This would make it possible for the rest of us to suggest a better solution if there is one and to guide you better when we have a better understanding of your problem.
Questions like "Explain MFC/COM/ATL/.NET" will likely go unanswered and in the best case you'll be provided with links. Always start by browsing among the articles at CodeProject.
--
Roger
It's suppose to be hard, otherwise anybody could do it!
|
|
|
|
|
you're right. i will describe my problem then. i have a COM method, let's say DoSomething(SAFEARRAY** sa). now I know exactly that it requires BSTR strings in SAFEARRAY. i have those strings extracted from something else. they are in std::string but convertion is not a problem as i mentioned before. what i need to do is to initialize SAFEARRAY, put those strings in it and then call the DoSomething method. actually perhaps i should have posted it in COM message board but it's too late now. i'm quite a newbie to COM (i don't really know why my company assigned this task to me... probably they wanted me to learn something else . anyway i saw SAFEARRAY for the first time in my life today and it's not similar to anything else i've used before ;]. and i'm a bit confused... thanks in advance for your answer.
PS MSDN provides really little information about this. i especially mean examples...
|
|
|
|