|
Hi,
I think you can encapsulate the C++ code in an activeX, and pass the data like a VARIANT but i dont know if it will be fast enought.which is the Bandwith required?
See http://www.codeproject.com/cpp/variantarray.asp for a library to pass vectors from unmanaged c++ code to managed MATLAB code
If you are using MATLAB you can also try to make an sfunction with the c++ code (see
c++ sfunctions in the matlab help).
JO
|
|
|
|
|
Hi Im working on ListCtrl(ATL Controls) in which i need to add images(Icons) to subitem other than 0th index.I was trying from couple of dayz.Plz help me if u have any idea..
thanks & Regards,
srihari.
|
|
|
|
|
I don't think there's a built-in way that you can add images to sub-items in a list view. I suspect the only way you can draw the images that you want is by using custom draw - see this MSDN page[^].
|
|
|
|
|
|
Hi,
I want to convert the string into german currency format eg.
in US 21,666.56 in German 21.666,56
in US 177.66 in German 177,66
please revert me with a good solution.
vijay
|
|
|
|
|
If you're ignoring any currency symbols, just imbue input and output streams with appropriate locales:
std::string in("17,456.43");
std::istringstream in_us(in);
</code><code></code><code> in_us.imbue(</code><code>std::locale("English_USA")</code><code>);
double value;
in_us >> value;
std::ostringstream out_de;
out_de.imbue(</code><code>std::locale("German_germany")</code><code>);
out_de << std::fixed << std::setprecision(2) << value;
std::string out = out_de.str();
If you need to read and write currency symbols (by which I mean 'USD' for dollars, 'EUR' for Euros), then you need to use the money_get and money_put facets:
<code> std::string in("USD17,456.43");
std::istringstream in_us(in);
in_us.imbue(std::locale("English_USA"));
</code><code> long double value;
</code><code> std::ios_base::iostate state;
std::use_facet<std::money_get<char> >(std::locale("English_USA")).get(std::istreambuf_iterator<char>(in_us), std::istreambuf_iterator<char>(), true, in_us, state, value);
std::ostringstream out_de;
out_de.imbue(std::locale("German_germany"));
out_de.flags(out_de.flags()|std::ios_base::showbase);
std::use_facet<std::money_put<char> >(std::locale("German_germany")).put(std::ostreambuf_iterator<char>(out_de), true, out_de, out_de.fill(), value);
std::string out = out_de.str();</code><code>
|
|
|
|
|
Hi - I don't quite understand the last two arguments of STL Map constructor
template <<br />
class Key, <br />
class Type, <br />
class Traits = less<Key>, <br />
class Allocator = allocator<pair <const Key, Type> > <br />
> <br />
Reference hereclick here[^]
I am searching for "less" template function - but Google returns millions of returns.... ALso. I don't understand the syntax (I know template...some) but
pair<const key,="" type=""> .... why "const"? that "pair" cannot change "Key"? Is that what it means?
Thanks.
|
|
|
|
|
devvvy wrote: ALso. I don't understand the syntax (I know template...some) but
pair .... why "const"? that "pair" cannot change "Key"? Is that what it means?
Yes, the const means the key can't be changed in place. One of the design philosophies of STL’s contains is to only support efficient operations. A std::map is implemented as a binary tree and changing the key would require the entry to be removed from the tree and reinserted into a new position. This would also invalidate all iterators referring to the modified item. In short, it’s a consequence of the underlying data structures used.
Steve
|
|
|
|
|
less is a template structure implementing a function object, not a function - see the MSDN docs here[^].
|
|
|
|
|
Before I move to draw my owner draw combox I want some suggestion.
Is it possible to control/draw the arrow part of combobox?
Is it possible to control the color of arrow part?
Is it possible to control the width and height of comboxbox or just I have to accept what is supplied.
I know it is possible to change color of textbox part and listbox part.
Based on this answer I have decide do I need ownerdraw combobox or (make my own combobox by as edit box and list box linking together)
I will appreciate your thought.
Thank you
msc
|
|
|
|
|
Hi All
Is it possible to implement drag and drop of nodes in MMC snapins...
if yes..is there any clue..how..plz help me.,...
Thanks in Advance
Rashmi Kushwaha
|
|
|
|
|
|
Are you using VC++ 2005 Express? If so, you're out of luck - Microsoft don't ship ATL or MFC with the Express version - you need a paid-for version (Standard or Pro).
If you're not using VS2005 Express, try re-installing VS2005 - it does come with atlbase.h - I just checked.
|
|
|
|
|
|
Make sure the ATL/MFC include directory is in the include path:
1. Open Tools->Options
2. Expand the 'Projects and Solutions' branch of the tree in the options dialog.
3. Select VC++ Directories in the tree in the options dialog.
4. In the 'Show directories for:' combo-box, select 'Include files'
5. Check if the directory string '$(VCInstallDir)atlmfc\include' is in the list of include directories. If not, add it.
|
|
|
|
|
I reinstalled it and now its working...
I guess so in the first time I didn't install the MFC without realizing
Thanks a lot
|
|
|
|
|
I have created ATL project with ATL Control and ATL Property Page. How I can set value of property directly from ATL Control class? Can I make this or I must use some Helper class for creating Property Page?
|
|
|
|
|
hi everyone,
well I gotta say this, I'm not a gr8 fan for programming in ATL/MFC but now I'm in a situation where I have to do this stuff. I'm using MSXML 4.0 in a project where I need to develop an XML log as the functions get called.
I'm trying to pass a CString to the nodeTypedValue or NodeValue functions and its giving the error
error C2064: term does not evaluate to a function taking 1 arguments
the Code is given below
CString t = "No Error";
pRetCode->nodeTypedValue(_variant_t(t));
Its also giving this error on this
CString t;
t.Format("0x%x",hr);
pRetCode->nodeValue(_variant_t(t)); code>
Can u plz tell me what to do here???
Thanks in advance
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Have you included comdef.h?
|
|
|
|
|
yup now i have a still no change... Everythings the same
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
pRetCode->nodeValue(_variant_t((LPCTSTR)t));
|
|
|
|
|
well actualy that problem got solved when i did something like this
pTempNode->nodeTypedValue = _T("MixNSplit 12");
pNode->nodeValue = _variant_t(ObjType);
Thanks I think that LPCTSTR would also come in useful somewhere for me
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Olen'!
when you open first parenthesis - what you see in help tooltip? There is should be enumerate of parametres in function, yes? So, how many parameteres in that function?
Actually, I have meet that problem - in MS .NET Studio and MS VS 6.0 count of parametres in MSXML namespace function are dfferents. But don't wory - the absent parametr is result of DWORD types.
So,
pRetCode->nodeValue(_variant_t(t));
transform to
DWORD dw;
pRetCode->nodeValue(_variant_t(t), &dw);
or some looks like thiat
|
|
|
|
|
template<typename _InterfacePtr> HRESULT _QueryInterface(_InterfacePtr p) throw()
{
HRESULT hr;
if (p != NULL) {
Interface* pInterface;
hr = p->QueryInterface(GetIID(), reinterpret_cast<void**>(&pInterface));
Attach(SUCCEEDED(hr)? pInterface: NULL);
}
else {
operator=(static_cast<Interface*>(NULL));
hr = E_NOINTERFACE;
}
return hr;
}
I've got another problem now. I sorted that previous one earlier but now its reporting an error here on the variable p. I havent even touched the code in this file and I dont have any idea how this one came about. Can u give me any suggestions for this? Its using typedef to define the _Interface type but I havent foiund any typedef statement for _InterfacePtr. I tried toadd it but to no avail.
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
I think the problem in your code when you (or system) have call QueryInterface. You can review call stack and determinate where this error ocure.
|
|
|
|