|
void MyFn(int nDefault=2) is necessary somewhere in the code. If you declare this function in a class, then put this code in the class. If you are declaring it before the function call and definition, you can declare it like this as well. Then, you can use void MyFn(int nDefault/*=2*/) when you define the function.
Otherwise, when you define the function, you must write void MyFn(int nDefault=2) as the function header.
|
|
|
|
|
The second one would be the prototype and the first one would be the actual function.
void MyFn(int nDefault=2);
void MyFn(int nDefault)
{ ... }
The only reason for applying the second one to the functions is so that it reflects the prototype (a.k.a. documents prototype parameter).
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Which is a bad practice. Since modification of default value would need to change two places in code...
|
|
|
|
|
Does anybody know how the NTVDM.EXE, launched CREATE_SEPARATE_WOW_VDM via CreateProcess, shuts itself down.
I have a 16bit app and a 16bit DLL. Lets assume that the 16 bit DLL allocates some resources and then frees them in the WEP function.
The 16 bit app is created via 32bit call CreateProcess with CREATE_SEPARATE_WOW_VDM. However, upon 16 bit app termination, the 16 bit DLL WEP function is not automatically called.
The 16bit DLL WEP code IS called when CREATE_SHARED_WOW_VDM flags settings is used. Does anyone know why or have they seen this behavior before?
I am starting to get alot of insufficient resources error messages and was wondering is it related. Now, it is completely feasible that there are other memory/resource leaks in the 16bit app/dll. I'm just trying to rule this out first.
Error message =
The Win 16 Subsystem has insufficent resources to continue running. Click on OK, close your applications, and restart your machine.
|
|
|
|
|
Hello,
After I have added some new controls to dialog and add variables related with these new controls
,application crashes.( no crash after controls are added but related variable are not defined) When I break application and try to debug it , I saw that it is crashing
within void Reallocate( _In_ int nLength ) function of CSimpleStringT class.Any comments ...
|
|
|
|
|
Can you remove all of the related variables and then add them back in one at a time until the problem appears?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I have already remove all latest added control, and try to put one bye one and change their IDs also. I got the some result.As soon as first variable defined after first control is put onto dialog , it crashes.
|
|
|
|
|
Bilge Kaan wrote: ...it crashes.
Exception, assertion, or some other anomaly?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I am working on one C++ DLL. That dll is internally using some statically build common.lib. When I am building the DLL, I am getting following linking errors:
Creating library Release Standard Heap/paecustomactions.lib and object Release Standard Heap/paecustomactions.exp
common.lib(properocommon.obj) : error LNK2019: unresolved external symbol __imp__mymalloc referenced in function _MIDL_user_allocate@4
common.lib(properocommon.obj) : error LNK2019: unresolved external symbol __imp__myrealloc referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl PROPERO::FormatStringA(char const *,...)" (?FormatStringA@PROPERO@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBDZZ)
common.lib(hcheapfix.obj) : error LNK2019: unresolved external symbol __imp__myfree_cond referenced in function _myfree
common.lib(sysconfig.obj) : error LNK2019: unresolved external symbol __imp__mycalloc referenced in function "public: __thiscall PROPERO::Runnable::Runnable(int,int,unsigned short const *)" (??0Runnable@PROPERO@@QAE@HHPBG@Z)
common.lib(stackTrace32.obj) : error LNK2001: unresolved external symbol __imp__mycalloc
../bin/i386/release/paecustomactions.dll : fatal error LNK1120: 4 unresolved externals
Can you please guide me to solve this issue?
Thanks in advance
|
|
|
|
|
Reason :-
1. Did u included the include file of systemconfig.h, propercommon.h etc in your project along with the library?
2. Common.lib is again referencing some other libs, you need to find those libs which common.lib is referencing.
and check
http://msdn.microsoft.com/en-us/library/799kze2z(VS.71).aspx[^]
modified on Friday, July 10, 2009 8:57 AM
|
|
|
|
|
1) Find the library that implements those functions and link to it.
or
2) Write implementations for those functions.
It looks to me like your DLL wants to link against another DLL - that's what the __imp__ prefix on the undefined external names implies to me...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I am doing custom drawing of my header control in listview, that time i would like to know the image number associated with the column. The column doesn't have any image associated to it,has the image number as -1, this is the default value.
I am using Header_GetItem macro to identify the column details. I am getting all the detials like Name of the column, Width of the column correctly, but the image number is wrong. The image number always comes as 0 for the column not associated with any image. But it should come as -1.
HDITEM pColItem;
pColItem.mask = HDI_TEXT |HDI_FORMAT |HDI_IMAGE ;
pColItem.pszText = wcBuf;
pColItem.cchTextMax = 255;
pColItem.iImage = I_IMAGECALLBACK;
Header_GetItem(HederHandle,nColIndex,&pColItem);
Can anyone please help me how to rectify this problem?
|
|
|
|
|
I am using Microlsoft Visual Studio 6.00.
I am creating a new frame using CreateNewFrame(). At the time of creation of class I derive the class from CScrollView. I want to paint the background of the view with some color. So I am using SetBkColor as
pDC->SetBkColor(RGB(255,0,0))
Here 'pDC' is of OnDraw() method.
But it can't work.
Plz tell me how can I paint the background window.
Regards
Nikesh
|
|
|
|
|
I hope this will help you [^]
|
|
|
|
|
i have created a sample application with SetCursorPos().
this application moves the mouse cursor to a certain extent when clicking on a button.
This application works fine with my system.
However it doesnt work in VMware workstation. why?
|
|
|
|
|
http://communities.vmware.com/thread/189519[^]
Please see below :-
In order for SetCursorPos() or Mouse_Event() to behave the way you would expect, you can disable the absolute mouse and host cursor offload, by adding the following to the VM's .vmx file and rebooting.
vmmouse.present = FALSE
modified on Friday, July 10, 2009 8:52 AM
|
|
|
|
|
Hi,
I am trying to enable Boost multi threading in Visual Studio 2003.
<br />
#include < boost/thread/thread.hpp >
#include < boost/lambda/lambda.hpp >
int main()<br />
{ <br />
<br />
<br />
return 0;<br />
}<br />
I went to PROJECT -> PROPERTIES -> C/C++ -> COMMAND LINE and added /MT
but I get the following compile errors
<br />
main Command line warning D4025 : overriding '/MLd' with '/MT'<br />
main Command line warning D4025 : overriding '/MT' with '/MLd'<br />
main Command line warning D4025 : overriding '/MLd' with '/MT'<br />
main fatal error LNK1104: cannot open file 'libboost_thread-vc71-mt-sgd-1_38.lib'<br />
does anyone know how to switch it on? Had a scout round on the net but to no avail
Thanks for any information.
|
|
|
|
|
You set that with the C/C++->Code Generation->Runtime Library project property rather than on the command-line. Also, you need to set different options for Debug and Release builds.
[edit] And please remove the /MT from the Command Line properties![/edit]
In addition, you either haven't told the linker where to find the Boost libraries (use the Linker->General->Additional Library Directories project property) or haven't built them completely (or did you use the Boost Consulting installer?).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Wow, did'nt realise there was so much to do.
I ran
<br />
bjam --build-dir="c:\program files\boost\boost_1_38\lib" --toolset=msvc --build-type=complete stage<br />
where I have the bjam exe in the \boost_1_38\ directory but it gives an error
<br />
*** argument error<br />
* rule path.make ( native )<br />
* called with: ( )<br />
* missing argument native<br />
C:/Program Files/boost/boost_1_38/tools/build/v2/util\path.jam:44:see definition of rule 'make' being called<br />
C:/Program Files/boost/boost_1_38/tools/build/v2/tools\msvc.jam:184: in configure<br />
C:/Program Files/boost/boost_1_38/tools/build/v2/tools\msvc.jam:137: in msvc.init<br />
C:/Program Files/boost/boost_1_38/tools/build/v2/build\toolset.jam:38: in toolset.using<br />
C:/Program Files/boost/boost_1_38/tools/build/v2/build\project.jam:862: in using<br />
C:\Program Files\boost\boost_1_38\tools/build/v2\user-config.jam:59: in modules.load<br />
C:/Program Files/boost/boost_1_38/tools/build/v2\build-system.jam:241: in load-config<br />
C:/Program Files/boost/boost_1_38/tools/build/v2\build-system.jam:383: in load-configuration-files<br />
C:/Program Files/boost/boost_1_38/tools/build/v2\build-system.jam:520: in load<br />
C:\Program Files\boost\boost_1_38\tools\build\v2/kernel\modules.jam:283: in import<br />
C:\Program Files\boost\boost_1_38\tools\build\v2\kernel\bootstrap.jam:138: in boost-build<br />
C:\Program Files\boost\boost_1_38\boost-build.jam:16: in module scope<br />
Ummm, any ideas?
|
|
|
|
|
This is the command -line I used, from the root of my Boost 1.38.0 source unpack
bjam --toolset=msvc-7.1 --prefix=d:\lib\boost --build-type=complete install
My Boost libraries are in this sort of directory hierarchy:
- d:\lib\boost - Root of my Boost install - I've only got 7 versions of Boost installed. from 1.32.0 on . You can see that I've told bjam that this directory is the root of my Boost library directory hierarchy.
- d:\lib\boost\include - contains all Boost header files in versioned sub-directories, such as D:\lib\boost\include\boost-1_38. Each versioned sub-directory contains a boost sub-directory which is the root of the include directory hierarchy. The versioned sub-directory is automatically created by the 'install' action in the jam file
- d:\lib\boost\lib - contains all Boost libraries and DLLs. The libs and DLLs are copied here by the 'install' action in the jam file
- d:\lib\boost\versioned directory containing source, docs etc. For example, D:\lib\boost\boost_1_38_0 for Boost 1.38.0. I
CD into this directory before building that version of Boost. After building, I delete the bin.v2 directory, as it contains all the object files created by hte build process, which can be > 1GB in size.
I would certainly recommend using this sort of setup, as it's worked pretty flawlessly for me for (literally) years.
The other thing I'd be concerned about with your setup is the 'Program Files' directory - I'm always worried about command-line tools and directories whose names contain spaces.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hmmm, I uninstalled my Boost folder from the previous location and installed it again in "C:\boost" so I can remove the space.
I ran your commaned
<br />
bjam --toolset=msvc-7.1 --prefix=c:\boost --build-type=complete install<br />
(where c:\boost is the root dir containing all the folders) but still get the error
<br />
C:\boost>bjam toolset=msvc-7.1 variant=debug threading=multi link=shared<br />
C:/boost/tools/build/v2/tools\msvc.jam:734: in configure-really<br />
*** argument error<br />
* rule path.make ( native )<br />
* called with: ( )<br />
* missing argument native<br />
C:/boost/tools/build/v2/util\path.jam:44:see definition of rule 'make' being called<br />
C:/boost/tools/build/v2/tools\msvc.jam:184: in configure<br />
C:/boost/tools/build/v2/tools\msvc.jam:137: in msvc.init<br />
C:/boost/tools/build/v2/build\toolset.jam:38: in toolset.using<br />
C:/boost/tools/build/v2/build\project.jam:862: in using<br />
C:\boost\tools/build/v2\user-config.jam:59: in modules.load<br />
C:/boost/tools/build/v2\build-system.jam:241: in load-config<br />
C:/boost/tools/build/v2\build-system.jam:383: in load-configuration-files<br />
C:/boost/tools/build/v2\build-system.jam:520: in load<br />
C:\boost\tools\build\v2/kernel\modules.jam:283: in import<br />
C:\boost\tools\build\v2\kernel\bootstrap.jam:138: in boost-build<br />
C:\boost\boost-build.jam:16: in module scope<br />
<br />
C:\boost><br />
So when you installed it you moved all the header folders etc. around?
modified on Friday, July 10, 2009 7:49 AM
|
|
|
|
|
minkowski wrote: So when you installed it you moved all the header folders etc. around?
The Boost build script does that.
minkowski wrote: bjam toolset=msvc-7.1 variant=debug threading=multi link=shared
That doesn't match the command-line I shared - but even so, that comamnd-line works for me....
What version of bjam are you using? I'm using version 3.1.16.
PS - to avoid building all the libraries, you might want to use one of the installers from BoostPro[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I've got version bjam
Boost.Build V2 (Milestone 12)
Boost.Jam 03.1.17
|
|
|
|
|
Hmmm - I'm using 3.1.16.
Googling "missing argument native" does indicate some other things to try - if you're using an Express version of MSVC, you may need to explicitly specify the version as an express one using toolset=msvc-9.0express or toolset=msvc-8.0express on the command-line.
Aside from that, I'm a bit stumped - maybe posting to the Boost Users mailing list might help?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi ya,
I've got the enterprise version. Ok I'll try the Boost mailing list.
Thanks for your efforts!
|
|
|
|