I have a difficult question. In WM_CHAR: If i use IME: EN, i will receive corect code input char.(a:97). I use IME:Japan, Result is so(corect). When I select IME:VietNamese, Tamil...I received ?(code:63). Please help me.(I set location:japan)
After copying the "lib" and "h" file into the source file directory for the program, I got a linking error. I added these files to the project via "Add Existing Item" menu selection. The error I got was the following:
A custom build rule to build files with extension 'lib' could not be found.
Would you like to create a new rule to define a custom build rule to build files with this extension?
I would think that using library functions would be a standard functionality for Visual C. Is there a setting somewhere that has to be adjusted to allow for this functionality? If not, does anyone know the rule that needs to be used?
Thank you for your reply. Where do you add it? I added it to configuration properties\linker\general\additional library directories. I though am now getting LINK2019 for each of the functions. See below:
Exercise.obj : error LNK2019: unresolved external symbol "double __cdecl Max(double const *,int)" (?Max@@YANPBNH@Z) referenced in function _main 1>Exercise.obj : error LNK2019: unresolved external symbol "double __cdecl Min(double const *,int)" (?Min@@YANPBNH@Z) referenced in function _main 1>Exercise.obj : error LNK2019: unresolved external symbol "double __cdecl Average(double const *,int)" (?Average@@YANPBNH@Z) referenced in function _main 1>Exercise.obj : error LNK2019: unresolved external symbol "double __cdecl Sum(double const *,int)" (?Sum@@YANPBNH@Z) referenced in function _main 1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
This is the solution that was posted by WayneAKing in the Visual C++ Developer Center forum. His posting is in response to an error listing that I posted. This guy knows everything. My program is now working.
I added the directory to the project configuration
>properties - linker - general tab.
That's half the requirements.
What did I say to add, and where did I say to add it? Look under Linker->Input for "Additional Dependencies" and add your .lib filename to the list.
You are making a console program.
>error LNK2019: unresolved external symbol _WinMain@16 >referenced in function ___tmainCRTStartup
WinMain is used with Win32 GUI applications, not console apps. How did you create the project? Which project template did you use? You should have selected "Win32 Console Application".
Look under Linker->System for "SubSystem" and set it to "Console (/SUBSYSTEM:CONSOLE)"
So here is something really crazy. I have a class, which looks something like this:
here are 100 of other variables.
HWND hChildren; // i am collecting children windows handles hereprivate:
here are 100 private functions.
here goes constructor and destructor, and some public functions
Everything works fine. But if i change hChildren to hChildren - so now i can add up to 1000 children, class starts acting mental. Consider the following:
I am calling function1(),
myClass *cl = new myClass();
instead of that, the function, which gets called - is function2(). This happens if i change size of hChildren from 100 to 1000. If size is 100, the one which executes - is function1() (which is OK). Have you ever experienced code behavior like this? Its like, some undesirable polymorphism occurred
Although Hans is mosssst likely right (this sort of things happens when you copy some files around and the timestamps of the object in the project are anymore coherent, so you rebuild only partially something that should be rebuilt all)consider if your design needs a review.
An array of 1000 HWND is 4 or KBytes long, and fits all into the object storage that may be used in the stack as a local variable. The space on the stack is not "as wide as the computer is", so think to dynamic allocation for this kind of bulks (for example: std::vector<hwnd> don't have this problem).
Also: a window with 1000 active children is kick in the ass for the operating system: do you really need all of them? Can't you create only the ones that are really visible?
It is a parameter defined at link time. The stack is allocated when a thread is created, based on the parameter the shell find in the exe, just before starting the process. It is 1MB for MS compilers, but other may be different. But the point is how many of those object can exist on the stack in case of a recursive call: 1MB is not a soooo big space. If you know that will never happen, OK.
Container of size 1000 never gets really filled, nor does even that one of size 100, so its not that bad, trust me Basically, i would never go with an app which has 1000 child controls present at a time - it was rather like "testing here, testing there, changing some value here and there, see what can happen", but as well it was a quick check if i can theoretically have an array of 1000 controls. So, thank you for an advice on vector, i haven't considered this, but now will try Thanks
Thanks for you replies. So, rebuilding did not help, deleting ncb file did not help either. Maybe i should use these #pragma pack's ? Anyway, probably i just stick with array of 100 child windows, or will use vector. Well, actually vector is a good idea. These 1000 HWNDs are child windows - controls, so it is not a big deal, they are not like, separated windows (in such case that would be a real overkill), besides, that is just a container so it can hold up to some amount of controls doesnt mean there are that many controls
Nope, there is no error anywhere. As for the amount of controls - it is not even an application, it is a class - i am trying to write a class, which will be able to store unlimited amount of controls, child windows handles to, lets say, invalidate them on resize or something. At this point i am using vector as a container and it works nicely. Richard, sometimes an application needs to have a lot of controls because there is no possibility to do it other way. Consider 3D Studio Max - there is no way to pack all its functionality into 10 controls. My biggest app (for some company) has about 300 of controls at a time - and i have shrank it from about 500 of controls, so you see how it is.
All bit mask fields of removed units in pVol->dbcv_unitmask may come in one turn.
You had also better check (pVol->dbcv_devicetype == DBT_DEVTYP_VOLUME) like below.
PDEV_BROADCAST_VOLUME pVol = (PDEV_BROADCAST_VOLUME)lParam;
if(pVol->dbcv_devicetype == DBT_DEVTYP_VOLUME)
pVol->dbcv_unitmask; // test this mask for one or more volume letters (bit flags)
if(pVol->dbcv_devicetype == DBT_DEVTYP_VOLUME)
pVol->dbcv_unitmask; // test this mask for one or more volume letters// may be consisting of more than one bit flag (ORed together)
Does your device generate something other than DBT_DEVTYP_VOLUME as dbcv_devicetype member of the structure? Because this is the only difference from your code snippet above. You can inspect it by setting a break point on that line if you would like to.
Last Visit: 31-Dec-99 19:00 Last Update: 23-Feb-17 12:41