|
George_George wrote: I have taken one hour to do reading for the great document you referred
George_George wrote: Do you have any ideas or comments?
Some stl containers do take/return a pair object, that's one of the reason why I would use a pair.
George_George wrote: But from the document, there is no conclusion what is the special benefits of using pair.
Exactly that's why I said it's a long story.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Hi Nibu,
Nibu babu thomas wrote: Some stl containers do take/return a pair object, that's one of the reason why I would use a pair.
It means we have to use it...
Any way, could you list your reaons (besides the above one) why and when using pair has special benefits please?
regards,
George
|
|
|
|
|
George_George wrote: It means we have to use it... Smile
Yeah sometimes!
George_George wrote: Any way, could you list your reaons (besides the above one) why and when using pair has special benefits please?
From MSDN:
The two most common uses for a pair are as return types for functions that return two values and as elements for the associative container classes map Class and multimap Class that have both a key and a value type associated with each element. The latter satisfies the requirements for a pair associative container and has a value type of the form pair<const mapped_type="">.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Thanks for finding that, but the latter makes additional one copy, correct?
regards,
George
|
|
|
|
|
Hi all,
I am working on RPC client programing(VC6.0).
As I got info from CP that MIDL to be used for client and server stubs.
I have designed an RPC server test application and My client and server
able to communicate succesfully with the stubs generated by MIDL.
But If I have an Linux server or any third party windows server, then how to design my client?
How can I get the client stub.
Regards,
Sunil Kumar
|
|
|
|
|
there are basically two RPC 'derivatives'/Implementations for a better word
Microsoft
ONC/Sun
unfortunately, Microsoft isnt compatable with ONC/Sun (and v-v) .. so, if you're on a windows box for example, and you want to RPC to a *nix box, you need a win32 port of ONC RPC - luckily, someone else has thought of this and (last time I checked) there were two versions out there.
it really depends on the implementation/version of RPC the 'other end' is using
thats a very brief sketch only, you'll need to research more than that
'g'
|
|
|
|
|
Thanka a lot for your info.
Regards,
Sunil Kumar
|
|
|
|
|
Hi guyz,
I just want to know if there's a limit on vector size.
What is the maximum vector size?
I'm using a vector of CString and store about 100K+ absolute path
and experience program hang. Am I reaching the vector's limit?
Hope you can help me thanks.
|
|
|
|
|
TooShy2Talk wrote: I just want to know if there's a limit on vector size.
Use max_size member function of std::vector.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Hi,
Does anyone use these classes, or the new Ribbon control in the MFC update?
Has anyone considered inheriting from them?
I'm looking to insert a DateTime picker control into a ribbon, and thinking of inheriting from CMFCRibbonBase element. I've had a look around, and cant find anyone else inheriting from these. Surely someone has tried it?!?!
thanks,
Mark.
|
|
|
|
|
Hi All,
Can Anyone guide me on how to pass float or double argument in _beginthread() function in argument list (3rd) argument?
I need to complete my assinment asap so it would be great if anyone can help me out.
Thanks.
|
|
|
|
|
you can just pass the address to the call of _beginthread and do a cast to a (double *) in the thread function.
|
|
|
|
|
You can pass a pointer as Rick suggested. I'll add this...
make sure the object pointed to stays in scope
double mydouble = 4.2;
_beginthread(&mythreadproc, 0, &mydouble); <code><-- BAD!!! mydouble may go out of scope before spawned thread uses it!</code>
return;
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I used this MDI Article[^] or MSDN MDI Article[^] but it still gives me errors, I've searched for about a week with thousands of different combination's to get the information i am looking for, can someone teach me or show me an article on how to create MDIParents and Child's and open the child windows when clicking on a button or a menu.
Error 1 error C3699: '*' : cannot use this indirection on type 'MDITest1::Form2' c:\documents and settings\nicholas king\my documents\visual studio 2008\projects\mdi test1\mdi test1\Form1.h 164<br />
<br />
<br />
Error 2 error C2039: 'MDIParent' : is not a member of 'MDITest1::Form2' c:\documents and settings\nicholas king\my documents\visual studio 2008\projects\mdi test1\mdi test1\Form1.h 167<br />
modified on Tuesday, August 26, 2008 4:50 PM
|
|
|
|
|
Looks like that code was written for Managed Extensions for C++
(Visual Studio 2002/2003 .NET).
There is a compiler option to support the old syntax but upgrading
the code to the new syntax is the best long-term option IMO.
Just to make sure - is a .NET forms app really what you want or do you
want a native MDI app? If .NET forms is what you're after, you're posting
on the wrong board.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Alright, well I am using 2008 and I can't find anything on the new syntax even on MSDN.
Sorry about posting on the wrong board, I usually posted my questions here.
I want native, but doesn't matter to me.
|
|
|
|
|
|
Thanks Mark, I'll take a look at those after I get back tomorrow.
|
|
|
|
|
Hi everyone.
I'm having some problems removing objects from a list.
Here's the code.
cout<<"Name of the band you want to delete: ";
fflush(stdin); getline(cin,nameband);
band = myManager.select_band_name(nameband);
if(band!=0)
{
(...)
myManager.remove_band(*band);
(...)
The remove function is this:
void Manager::remove_band(const Band & bd)
{
available_bands_list.remove(bd);
}
There are no debug or run-time erros... did I miss something?
Thank you.
|
|
|
|
|
Is the "band" you're trying to remove really in the list?
I mean, it looks like you store Band references in the list and the reference you're trying to remove may refer to another object which is not in the list.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
yes.. it worked. I mean, there where no building errors or run-time errors after I made the changes you told me to. The thing is I run the remove function but the object remains there.
|
|
|
|
|
FrankMookie wrote: The thing is I run the remove function but the object remains there.
Have you tried the example code[^] and seen that it works?
Once you see that works correctly, you should then suspect your operator implementation is faulty. You can verify this by debugging.
Cedric Moonen wrote: So you need to provide an operator which receives a Band:
led mike
|
|
|
|
|
Hey mike.. you were right, it was the operator. It was implemented badly. So now it works perfectly! Thanks to everyone. Cheers
"Failure is always an option."
|
|
|
|
|
Hi,
I have tried allowing VS2005 to convert several existing 'VC++6 compilable' projects and with each the results are the same. Tons of ATL related compile errors. None of the projects that I am trying to convert even use ATL! I am assuming this is some sort of compiler/preprocessor setting? The errors occur in:
atlalloc.h
atlconv.h
atldebugapi.h
atltrace.h
I have included below, the first part of the Output display from the compile.
Any help, ideas or a pointer to an answer would be greatly appreciated!
Thanks,
Doug
------ Build started: Project: TPC, Configuration: Debug Win32 ------
Compiling...
StdAfx.cpp
WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
NOTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications. To build a retail application,
set WINVER to 0x0400 or visit http:
to see if retail Windows NT 5.0 or Windows 98 headers are available.
See the SDK release notes for more information.
d:\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h(228) : error C2065: 'DWORD_PTR' : undeclared identifier
d:\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h(228) : error C2143: syntax error : missing ';' before 'GetWindowThreadProcessId'
d:\microsoft visual studio 8\vc\atlmfc\include\atlalloc.h(80) : error C2065: 'LLONG_MIN' : undeclared identifier
d:\microsoft visual studio 8\vc\atlmfc\include\atlalloc.h(80) : error C2057: expected constant expression
d:\microsoft visual studio 8\vc\atlmfc\include\atlalloc.h(81) : error C2065: 'LLONG_MAX' : undeclared identifier
d:\microsoft visual studio 8\vc\atlmfc\include\atlalloc.h(81) : error C2057: expected constant expression
d:\microsoft visual studio 8\vc\atlmfc\include\atlalloc.h(89) : error C2065: 'ULLONG_MAX' : undeclared identifier
d:\microsoft visual studio 8\vc\atlmfc\include\atlalloc.h(89) : error C2057: expected constant expression
d:\microsoft visual studio 8\vc\atlmfc\include\atlalloc.h(603) : error C3861: '_resetstkoflw': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(92) : error C2061: syntax error : identifier 'LONG_PTR'
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(92) : error C2146: syntax error : missing '(' before identifier 'LONG_PTR'
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(92) : error C2061: syntax error : identifier 'LONG_PTR'
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(92) : error C2146: syntax error : missing '(' before identifier 'LONG_PTR'
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(752) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(754) : error C3861: 'wcscat_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1034) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1047) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1063) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1084) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1093) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1138) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1147) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1264) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1277) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atlconv.h(1293) : error C3861: 'memcpy_s': identifier not found
d:\microsoft visual studio 8\vc\atlmfc\include\atldebugapi.h(31) : error C2143: syntax error : missing ';' before '__stdcall'
d:\microsoft visual studio 8\vc\atlmfc\include\atldebugapi.h(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
d:\microsoft visual studio 8\vc\atlmfc\include\atldebugapi.h(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
d:\microsoft visual studio 8\vc\atlmfc\include\atldebugapi.h(32) : error C2146: syntax error : missing ')' before identifier 'dwProcess'
d:\microsoft visual studio 8\vc\atlmfc\include\atldebugapi.h(32) : warning C4229: anachronism used : modifiers on data are ignored
d:\microsoft visual studio 8\vc\atlmfc\include\atldebugapi.h(32) : error C2182: 'AtlTraceCloseProcess' : illegal use of type 'void'
Doug Knudson
|
|
|
|