How do the Win10 upgrades present themselves? I have the Get Windows 10 icon, but I don't know whether the Windows Upgrade arrives via the Icon or Windows update.
Stone Free
Posts
-
Windows 10 -
Which programmng site?Yup, I knew I should have added section to the title! Is there a better place than the lounge? Thanks Maximilien, Cinder and openFrameworks where already on my radar due to Herb Sutters graphics challenge. It is more the audio side that I don't know where to look, both with Frameworks with audio extraction and knowledge on how to process the data. Please suggest any books on audio processing that might be helpful, as well as any possible frameworks that have some of the necessary tools that might simplify the task.
-
Which programmng site?I basically want to have a recipe for a project that I want to create. Well its more a question of finding the correct 'ingredients' that would be needed to solve the needs of the project. I am a C++ programmer, and I want to create a R128 sound level meter but I don't really know what subjects to research. So I will probably use one of the new C++ GUI frameworks that use the latest compilers for C++. I would need a library that allows me to extract the audio data. Anyway you see what I am getting at. What is the most appropriate place to get advice on what building blocks will be needed (and new knowledge acquired)
-
Complementary Books for "C# Unleashed" - Joseph MayoI looked at reviews for that, but thought it would be better after a C#4.0 based book.
-
Complementary Books for "C# Unleashed" - Joseph Mayo:) Funny
-
Complementary Books for "C# Unleashed" - Joseph MayoBooks on C# for a C++ programmer A long while ago just before embarking on looking for a new job, I decided to try and learn some C# and bought the original C# Unleashed book by Joesph Mayo. Unfortunately the new job did not provide any opportunities for doing C# work, and so the knowledge disappeared in a whisp of smoke. I am now getting the chance (at the same company) to work on updating a C# project, and would like to know what current books to combine with my original C# Unleashed. First there is C# 4.0 Unleashed, by author Bart De Smet C# in Depth" by John Skeet. Professional C# 4.0 and .NET4 (Wrox) Beginning Visual C# 2010 (Wrox) C# 4.0 in a Nutshell: The Definitive Reference C# 4.0 The Complete Reference - Herbert Schildt Pro C# 2010 and the .NET 4 Platform Amongst a lot of C++ programmers Herbert Schildt is reviled, however I don't know if this means I should discount his C# book. Comments?
-
The Four Horsemen (Metallica)V. wrote: The Four Horsemen
I just love that song...
Nah, :| everyone knows that its a rip off of Mechanix by Dave Mustaine. You should crank up Am I Evil instead! ;P Whoops, thats Diamond Head :doh:
-
I just don't know who to be angriest atIf the people listening to him read the source book more closely they would have known full well he was wrong. It says no one can know the day or the time. Peter - An Atheist
-
A downside of being a programmerI don't think you've deconstructed the problem fully as you've created the Knot enum with the member Windsor, however the Windsor knot can by tied as a FullWindsor or a HalfWindsor!
-
Favorite song from a TV show/sitcomThis may be cheating somewhat as the song is from the show's soundtrack but its "Bones" by Little Big Town from True Blood. I like many others don't like country, but this band's fantastic - amazing harmonies. If this isn't allowed then its Jace Everett's "Bad Things" the title song of the same show. Incidentally another Country artist! Some other favourite songs from soundtracks to TV series. Is "Waiting" by the Devlins from Six Feet Under. Then "Light Outside" by Wakey! Wakey! the less said about where I heard that the better :^) Oh also "Mean to me" by Tonic, no idea what show I saw that on! Peter
-
Zeno's ParadoxI heard a slightly ruder version where the punch line features an Engineer. Engineer: That's near enough F**k it!
-
boost bind expression not doing what I expectI obviously don't get this bind stuff as I cannot seem to get it right
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <boost/bind.hpp>using namespace boost::bind;
typedef int DWORD;
typedef std::pair<std::string, bool> user_info;
typedef std::map<DWORD, user_info> USER_MAP;
typedef std::vector<DWORD> VEC_STAFF;int _tmain(int argc, _TCHAR* argv[])
{
USER_MAP m_Users;
VEC_STAFF Staff;VEC\_STAFF::iterator it = std::partition(Staff.begin(), Staff.end(),(bind(&USER\_MAP::find, m\_Users, \_1) != m\_Users.end()));
What I wanted to code to do is that for every entry in the Staff vector it should check to see whether that user id was present in the map, and if so move those items to the front. I have an example using a functor that works as I hoped the above code would, but the bind version is obviously not doing what I think its doing.
struct InUsersMap : public std::unary_function<USER_MAP::key_type,bool>
{
InUsersMap(USER_MAP & theMap, USER_MAP::const_iterator end)
: m_theMap(theMap)
{
}
inline bool operator()(CSecurePatients::USER_MAP::key_type& id) const
{
return m_theMap.find(id) != m_theMap.end();
}
private:
const USER_MAP &m_theMap;
}Finally does anyone know how to avoid getting the socket bind function from windows being included
-
Is forward declaration of ATL autogenerated _com_ptr_t possible?Thanks for all your help Stuart :-D It's working fine! I'm trying to come up with some macros to make it configurable, but the inability to redefine a #define as part of another #define doesn't seem to be possible.
-
Is forward declaration of ATL autogenerated _com_ptr_t possible?It works up to a point, but the moment I introduce an accessor function to return a valid COM object the type ITest I get error C2027: use of undefined type 'ITest' So: HashImport.h
#pragma once
#include struct ITest;
extern const IID ITest_IID;
_COM_SMARTPTR_TYPEDEF(ITest, ITest_IID);class CHashImport
{
public:
CHashImport();
~CHashImport();
HRESULT GetImpl(ITestPtr &pImpl);
};HashImport.cpp
#include "StdAfx.h"
#include "Hashimport.h"#import "libid:00020813-0000-0000-C000-000000000046" version("1.6") auto_search no_dual_interfaces rename("DialogBox", "excelDialogBox") rename("RGB", "excelRGB") rename("DocumentProperties", "excelDocumentProperties") rename("SearchPath", "excelSearchPath") rename("CopyFile", "excelCopyFile") rename("ReplaceText", "excelReplaceText")
struct ITest : public Excel::_Application {};
using namespace Excel;
const IID ITest_IID = __uuidof(Excel::_Application);
CHashImport::CHashImport()
{
ITestPtr ptr;
GetImpl(ptr);
}CHashImport::~CHashImport()
{
}HRESULT CHashImport::GetImpl(ITestPtr &pImpl)
{
pImpl = ITestPtr(__uuidof(Excel::Application));
_bstr_t appname = pImpl->GetValue();
return S_OK;
}referenceheader.h
#pragma once
#include "hashimport.h"class CReferenceHeader
{
public:
CReferenceHeader();
~CReferenceHeader();
};referenceheader.cpp
#include "StdAfx.h"
#include "Referenceheader.h"CReferenceHeader::CReferenceHeader()
{
}CReferenceHeader::~CReferenceHeader()
{
}main.cpp
#include "stdafx.h"
#include "hashimport.h"
#import "libid:00020813-0000-0000-C000-000000000046" version("1.6") auto_search no_dual_interfaces rename("DialogBox", "excelDialogBox") rename("RGB", "excelRGB") rename("DocumentProperties", "excelDocumentProperties") rename("SearchPath", "excelSearchPath") rename("CopyFile", "excelCopyFile") rename("ReplaceText", "excelReplaceText")int _tmain(int argc, _TCHAR* argv[])
{
::CoInitialize(NULL);
CHashImport import;
//ITestPtr pTest; //error C2027: use of undefined type 'ITest'
//import.GetImpl(pTest);
//c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\comip.h(822) : error C2227: left of '->Release' must point to class/struct/union::CoUninitialize(); return 0;
}
-
Is forward declaration of ATL autogenerated _com_ptr_t possible?I get the error "redefinition; different basic types" when the #import defines the real thing.
-
Is forward declaration of ATL autogenerated _com_ptr_t possible?In normal C++ when a class header only contains a reference or a pointer to a class it is better to not #include the definition but wait until the .cpp file to avoid coupling/avoid recompilation. In our of our class headers the reference concerned is to a smart pointer generated from a #import, in other words a smart pointer of the form _COM_SMARTPTR_TYPEDEF(IComInterface, &__uuidof(IComInterface)) Which expands to typedef _com_ptr_t<_com_IIID<icominterface,> > IComInterface; I think the problem is that the __declspec(uuid("GUID VALUE")) which is attached to the forward declaration of the IComInterface struct like __stdcall and __fastcall is part of the declaration and so will produce different types depending on the contents of uuid. The problem however is that the uuid contents will be autogenerated by the #import line, and so it won't be possible know ahead of time to know what to put in the typedef. I also think that the $(InputName)_i.c file generated when building the COM component won't help because although it contains the correct GUID it won't be in the correct form for __uuidof
-
name() function fails in MSXMLStone Free wrote:
name(/find:ResponseEnv/find:Bodies/node())
led mike wrote:
I have never seen name() used like that and I have no idea what this "find:" is nor can I find it referenced on www.w3schools.com. If that is newer XPath then of course it's not going to be supported in old DOMs like MSXML.
Mike, find: won't be referenced at www.w3schools.com, because it is a namespace alias. Take
/ResponseEnv/Bodies/node()
for example, this would work fine if my XML had been as follows:<responseenv>
<header schemaversion="1.1">
<field1/>
</header>
<bodies>
<response>
<field1/>
</response>
</bodies>
</responseenv>Unfortunately it has a namespace attached to it of http://example. To make the XPath work successfully I had to use the SelectionNamespaces property. I could have made the alias anything. I could have written the following:
hr = domDoc->setProperty(_bstr_t("SelectionNamespaces"),_variant_t(_bstr_t("xmlns:codeproject=\"http://example\"")));
This would mean my XPath would have been/codeproject:ResponseEnv/codeproject:Bodies/node()
led mike wrote:
I have never seen name() used like that
I got that syntax:
- name(): Returns the qualified name of the context node.
- name(node_set): Returns the qualified name of the first node in the given node set object.
From http://www.herongyang.com/xml/xpath_2.html[^]
led mike wrote:
I don't know if you are using the XPath statement in XSLT or not but name() returns a string not a node which is why the error message says what it says. After seeing your XPath statements I don't have clue what you are trying to do.
No the XPath statement is being used directly from the XML Document. The node identified with will not actually be called response, but can be a number of different sub-messages and so I don't know in advance what it will be only that it will be the first node found that is a child of bodies
-
name() function fails in MSXML> Post the following: > > * MSXML version you are using Tried both 3 and 6 > * Smallest possible XML representing the problem.
<responseenv xmlns="http://example" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaversion="3.0">
<header schemaversion="1.1">
<field1/>
</header>
<bodies>
<response>
<field1/>
</response>
</bodies>
</responseenv>* Code setting SelectionLanguage
HRESULT hr = domDoc->setProperty(_bstr_t("SelectionLanguage"),_variant_t(_bstr_t("XPath")));
> * Code setting SelectionNamespaceshr = domDoc->setProperty(_bstr_t("SelectionNamespaces"),_variant_t(_bstr_t("xmlns:find=\"http://example\"")));
> * XPath statements that failname(/find:ResponseEnv/find:Bodies/node()) name(//find:Bodies/node())
* Code in FullMSXML::IXMLDOMDocument2Ptr domDoc(__uuidof(MSXML2::DOMDocument60));
if ( domDoc->loadXML(sExample.c_str()) == VARIANT_TRUE)
{
HRESULT hr = domDoc->setProperty(_bstr_t("SelectionLanguage"),_variant_t(_bstr_t("XPath")));
if (FAILED(hr))
return 1;
hr = domDoc->setProperty(_bstr_t("SelectionNamespaces"),_variant_t(_bstr_t("xmlns:find=\"http://example\"")));
if (FAILED(hr))
return 1;
MSXML::IXMLDOMElementPtr pElem = NULL;
try
{
//pElem = domDoc->selectSingleNode(_bstr_t("/find:ResponseEnv/find:Bodies/node()"));//Works
pElem = domDoc->selectSingleNode(_bstr_t("name(/find:ResponseEnv/find:Bodies/node())"));
}
catch (const _com_error &e)
{
MessageBox(NULL, static_cast<LPCTSTR>(e.Description()), e.ErrorMessage(), MB_OK);
}
}The original code was using an internal C+++ wrapper hiding the specifics of calling MSXML code, and was using raw_interfaces_only and so did not throw. The example above returns the error text "Expression must evaluate to a node-set", the original company code modified to throw a _com_error, returns a slightly different message "Expression does not return a DOM node.". Peter
-
name() function fails in MSXMLYes I am, I've also used the SelectionNamespaces property to setup a namespace alias. This works fine as long as I don't introduce name()
-
name() function fails in MSXMLI have tried an XPath successfully in both XML Spy, and SketchPath, but I cannot make it work in MSXML The XPath without the name() function works fine in MSXML, but as soon as I try and use name() it fails. I have setup a prefix using SelectionNamespaces, of find I want to find the name of the first element attached to DesiredNode. I originally tried name(//parent:node()/find:DesiredNode/node()) which failed, I then tried //parent:node()/find:DesiredNode/node() , this however works fine I have also tried alternate XPaths such as name(//find:DesiredNode/*), but this fails also. All XML Spy XPath work (without the need for using the find prefix), and if I setup the alias of find correctly in SketchPath, I also always get the correct results. What am I doing wrong?