|
Help me, please to change my MFC applications to unicode supported application.
I've already found a lot of articles about it, I've defined _UNICODE symbol and set wWinMainCRTStartup entry point. But I'm still cannot pass link - I get an error "unresolved external symbol WinMain". My quastions are:
1) Do I have to define all this for all DLL-s or only for main project?
2) Which library I have to use - mfc42 or mfc42u etc
3) What else I have to do to link my application?
Thanks,
Bella
|
|
|
|
|
Hi everyone, I am new to C++ Thread Programming, but I ran into a situation where my thread function never gets called, below is my code:
#include "StdAfx.h"
#include
#include
using namespace std;
static DWORD WINAPI kill (LPVOID p)
{
cout<<"Threading now";
return 0;
};
void main()
{
HANDLE t = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)kill, NULL, 0, NULL);
}
Can anyone tell me why the function "kill" never gets called? This is compiled in Visual C++ 6.0 under Windows 2000 Professtional. And how can I fix this?
Thanks
|
|
|
|
|
Now that you are in the right forum, the simple answer is to add a Sleep(1000); right after your call to CreateThread. That will allow you to see the output.
Next, look up the CreateEvent API and replace your Sleep call to a WaitForSingleObject call on the event that gets triggered by the thread function to let you know that it is complete.
This is an excellent book for understanding basic multithreading techniques.
Multithreaded Programming with Win32[^]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
You don't need an event, you can wait on the thread handle
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
That's true. I always forget about that , since I've mostly worked with threads on servers and you usually only let threads close down when the entire process is shutting down and you stop handling requests.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
As for why that is happening, your main thread is exiting right away, which makes the whole process go away before the second thread gets any CPU time.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
I have a Cedit subclass which is constructed like this..
CDockBar child is CStatic and CStatic child is CSubEdit..
Now I CeEdit::SetOwner(CDockBar) so that CDockBar would receive the notifications from CEdit.
Particularly i want to process NM_RETURN notifications when I press the ENTER key..
Now I already processed the WM_KEYDOWN from the subclassed c0ntrol.. and i can process the enter key from WM_KEYDOWN already.. but i still want the parent/owner to be notified of the ENTER keypress..(NM_ENTER) notification
I traced the Enter key press on the Cedit Control, in Spy++, the only messages generated are WM_KEYDOWN, WM_KEYUP, and WM_CHAR..
Why does NM_RETURN goesn't get generated?
|
|
|
|
|
i have created a MFC SDI application and want it support multiView.Therefore, i tried to Create another View, but i do not know how to add debug and nondebug versions of the GetDocument function to use data from CDocument.
can anybody help me?
|
|
|
|
|
Class wizard does this automatically for you, but here is the solution:
.h (inside the class):
CMyDoc * GetDocument();
.h (outside the class):
#ifndef _DEBUG // debug version
inline CMyDoc * CMyView::GetDocument()
{ return (CMyDoc *)m_pDocument; }
#endif
.cpp:
#ifdef _DEBUG
CMyDoc * CMyView::GetDocument()
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyDoc)));
return (CMyDoc *)m_pDocument;
}
#endif //_DEBUG
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
Where can I download the lastest Windows DDK?
I need to use function IoVolumeDeviceToDosName, but it is declared in ntddk.h
but I can't download the DDK from website of Micro$oft...
So any other else place where I can download it?
Thx!
Welcome to my site:
http://www.cntomorrow.com:3310
|
|
|
|
|
as far as I know windows ddk is not available for free. either you have to order it or you must have MSDN subscription.
Saurabh
|
|
|
|
|
In WinVista it will be call WDK - Windows Driver Kit[^]
and by the moment it's only available for MSDN subscribers (Windows Longhorn Beta program).
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
How to get the full pathname for a process via PID (Process Identifier)?
Welcome to my site:
http://www.cntomorrow.com:3310
|
|
|
|
|
first call OpenProcess with PROCESS_QUERY_INFORMATION as dwDesiredAccess to obtain a handle to process from PID.
then call GetProcessImageFileName.
Saurabh
|
|
|
|
|
Thanks a lot!
Welcome to my site:
http://www.cntomorrow.com:3310
|
|
|
|
|
In essence I am trying to capture return from a CComboBox within a subclassed CPropertyPage within a CPropertySheet. Is it possible to do this by subclassing CComboBox, or do I need to change some things higher up?
The combobox is a dropdown which is filled programatically and the value chosen is used to populate a tree control. I want the user to be able to input a value not already on the list, and update the tree control when they hit enter (or on kill focus), but I can't figure out how to capture the key before it causes the entire dialog to close. I've done a number of google searches an read as many articles on the subject as I can find, but none of the techniques I've encountered seem to work (which is why I suspect I may need to mess with the property page, but I'd like to avoid that if possible). I've tried subclassing, redefining OnGetDlgCode() with "return CComboBox::OnGetDlgCode() | DLGC_WANTALLKEYS;" (which does get called), then setting up handlers for WM_KEYDOWN and even WM_CHAR (which do not get called). I've also tried PreTranslateMessage(), but that function is not ever called, either.
Any help or links to relevant articles would be greatly appreciated.
|
|
|
|
|
|
I search a way to block Ctrl+Alt+del , Alt+Tab , Ctrl+Alt+End , Alt+F4 from the keyboard ... Thanks
|
|
|
|
|
You need to write a global keyboard hook. I'm not sure that will even catch Ctrl-alt-del, but it should allow you to intercept the others.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi eveyone,
I have trouble building a code....When I compile it, it runs well, but when I start building it...It gives me the following errors.
--------------------Configuration: TSCalibrate - Win32 Debug--------------------
Compiling...
TSCalibrate.cpp
Linking...
TSCalibrate.obj : error LNK2001: unresolved external symbol "public: static class CTouchScreenAPI * __cdecl CTouchScreenAPI::Create(void)" (?Create@CTouchScreenAPI@@SAPAV1@XZ)
Debug/TSCalibrate.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
TSCalibrate.exe - 2 error(s), 0 warning(s)
I read many forums on this but didn't find one which could resolve my problem.
Its a WINMAIN aplication....
I made it in win32 .....not in win32 console...
Also, I included main function. When I don't include main in the code...
I get one more error in addition to the above...
--------------------Configuration: TSCalibrate - Win32 Debug--------------------
Compiling...
TSCalibrate.cpp
Linking...
TSCalibrate.obj : error LNK2001: unresolved external symbol "public: static class CTouchScreenAPI * __cdecl CTouchScreenAPI::Create(void)" (?Create@CTouchScreenAPI@@SAPAV1@XZ)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/TSCalibrate.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
TSCalibrate.exe - 3 error(s), 0 warning(s)
PLease help me getting out of it.
Thanks
Preeti
Preeti9
|
|
|
|
|
Preeti9 wrote:
I have trouble building a code....When I compile it, it runs well, but when I start building it...It gives me the following errors.
What do you mean ? It doesn't compile, it has errors.
Preeti9 wrote:
TSCalibrate.obj : error LNK2001: unresolved external symbol "public: static class CTouchScreenAPI * __cdecl CTouchScreenAPI::Create(void)" (?
Assuming that CTouchScreenAPI is your class, you have a create method in your header file, and no implimentation in your .cpp file. If it's an external library, then you have linked to the header, and not the .lib file.
Preeti9 wrote:
Also, I included main function. When I don't include main in the code...
I get one more error in addition to the above...
Why would you remove your main function ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi there,
No, I said when I didn't include main function, it gives me 3 errors.
Now, I am including it, I get rid of that error.
Thanks for your reply, How can I remove other 2 errors.
Thanks
Preeti
Preeti9
|
|
|
|
|
They are both the same error ( one is just reiterating the other ), and did you try what I suggested ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes,
Thanks...My problem is solved and my program is working as I wanted.
Thanks once again.
Preeti
Preeti9
|
|
|
|
|
Hi
I am looking for a free ssh api for windows. Does that exist?
Basically I need to connect to a linux box, execute some commands and get their output and write this to a file.
I have seen a good project on sourceforge.net, but it is for java.
Thanks
|
|
|
|