|
Thanks, I think you are right. I searched some materials, says the compiler won't embed the template definition( blueprint ) into an obj until it is called. So I simply put it in a common header file, but I am still worried if more than one cpp call the template with the same function prototype.
|
|
|
|
|
If you want to use a function from different cpp files you have to make the declaration (the function signature) available to both. In the case of a template function, the same goes for its definition! To avoid code duplication, the right place to put this is a header file, not a cpp file.
template< size_t N >
void cdecl _DumpWin32StructFields( WCHAR (&szBuffer)[N], LPCWSTR pszFormat, ... )
{
va_list pFirstParam ;
va_start( pFirstParam, pszFormat ) ;
StringCchVPrintf( szBuffer, N,pszFormat, pFirstParam ) ;
va_end( pFirstParam ) ;
}
#include "dump.hpp"
void foo() {
WCHAR buffer[20];
_DumpWin32StructFields(buffer, _T("Hello World!"));
}
#include "dump.hpp"
void bar() {
WCHAR buffer[30];
_DunpWin32StructFields(buffer, _T("Goodbye Cruel World!"));
}
This will force the compiler to instantiate and create code for your template function for both foo.obj and bar.obj, and the linker won't have trouble finding them.
|
|
|
|
|
Because of some reasons I have to use both VS2005 and VS2008 on my computer.
if it can, is there any thing I should be careful with?
|
|
|
|
|
yes, they can both be installed.
i have VC6, VS03, VS05, VS08 and VS10 on mine. they all work fine together.
|
|
|
|
|
WOW !!!
Didn't you get your hands on any earlier versions???
|
|
|
|
|
i don't need any of the other VCs. but if i could get DOS C 6.0 to run on Win7, i'd have it, too.
|
|
|
|
|
I use Microsoft C 6.0 with DosBox[^] under Windows XP. It should probably work under Windows 7 too.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
It would be a good idea to install the products in the order that they were released. In your case, first install VS 2005 followed by VS 2008.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
|
This is very important... I have VS6, 2003, 2005, and 2008 on one machine...
|
|
|
|
|
They are explicity designed to be installed side by side
Best regards,
Jaime.
|
|
|
|
|
yes they do just pay attention that u install 2005 first and the 2008.remember for anything put version vice first the older then the new.
|
|
|
|
|
I've had a setup like this some 15 years ago, and the only problem I had was the incompatibility between different versions of the MFC. I had to put copies of the correct version into a binary folder and copy my compiled binaries in there during a custom build step to make sure they would be using the correct version. Not sure if such problems still exist, or if they extend to ATL and other runtime libraries.
|
|
|
|
|
Hai,
We have a VC++ application [Acrobat plug-in] where we are using Ultragrid 2.0 for displaying data.
It was an old application where we used VC++ 6.0 and Ultragrid 2.0, it was fine in most of the aspects, and in the grid we were displaying English and Japanese text as required.
Later on we have to upgrade our project to VC++ 2008[Visual studio 2008] for some enhancement work, But after that it is showing some junk characters for Japanese text [but for English we have no problem] in the ultragrid cell, what could be the problem here,
Does ultragrid 2.0 not support VC++ 2008 or not? Or do we need to do some changes here? And acrobat plug-ins can be implemented using only VC++, and no other language.
We cannot rewrite the whole application from the scratch as is a very large application!
What we can do to display Japanese text within the existing project, please help me.
Waiting for your valuable response.
|
|
|
|
|
I don't know Ultragid 2.0 or any other version of it, but maybe you need to play with font settings a bit? E.g. if you check out the LOGFONT[^] struct, it has a member called lfCharSet , maybe you need to play with that one.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
sujipal wrote: Does ultragrid 2.0 not support VC++ 2008 or not?
What does the author (infragistic) say about supporting VS2008 ? Did you try with a updated version of Ultragrid ?
sujipal wrote: Or do we need to do some changes here?
Maybe ... when upgrading from a _very_ old version of Visual Studio, some changes will have to be done to either your code or the supporting libraries.
Even at the worse scenario, you should not have to re-write everything, only the part that uses the grid.
Watched code never compiles.
|
|
|
|
|
Hi!
I've an XML file whose contents are as following:
<?xml version="1.0" ?>
<response action="registration">
<element>
<properties name="username">cst11</properties>
<properties name="playerhandle">238768881697142018728993387950411141</properties>
<properties name="skinId">RCA001</properties>
<properties name="errcode" >loginnotAllowed</properties>
</element>
</response>
I've to retrieve the values ("cst11","238768881697142018728993387950411141","RCA001" and "loginnotAllowed") using TinyXML. How to do this? Can any body post some sample code for this?
|
|
|
|
|
|
Hi!
I've written the following code. It loops every element.
TiXmlElement* child = parent->FirstChildElement();
TiXmlElement* prop = child->FirstChildElement();
while(prop)
{
if(prop && prop->Attribute("errcode"))
{
errorcode = prop->GetText();
break;
}
else
prop = prop->NextSiblingElement();
}
}
It loops every element fine. After that I need to check for the username,playerhandle,skinId
and errcode and if it's errcode, I've to extract the "loginnotAllowed".
I don't know how to check this. I need some explanation or some code snippet
for the if block(what should be replaced with the existing to meet my requirements?).
|
|
|
|
|
I have not used tinyXML myself, but isn't it a possibility for you to make the parent node as the node for which you get the errcode and then iterate it's children to get the value of loginnotallowed.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
when I unplug the Ethernet cable,the client doesn't send the FD_CLOSE event to the server
so the server's online list isn't fresh new.
How about this ?
|
|
|
|
|
Koma Wang wrote: when I unplug the Ethernet cable,the client doesn't send
If the cable is unplugged there is no physical path to send on.
The best things in life are not things.
|
|
|
|
|
First , thanks for your reply !
but how can I get it offline real-time ?
I set a timer to call CheckIsOnline() to find the client struct's m_nLastActive;
the client call SendHeartPacket() every 30 second,
and the server recv it then set the m_nLastActive.
when (GetTickCount() - m_nLastActive) >= (1000 * 10),I will remove from the list.
but when I run some days in wlan server, it be crashed,I cound't found what's wrong with it.
This is my biggest headache !
|
|
|
|
|
Koma Wang wrote: some days in wlan server, it be crashed,I cound't found what's wrong with it.
Sorry, but that does not give us any clues as to what might be happening. If your system is crashing then you should add some trace or debug code to your program and try to trace the conditions that cause the crash.
The best things in life are not things.
|
|
|
|
|
thanks !
|
|
|
|