|
Ju@ncho wrote: Hi!
I need to pass a series of raw bitmaps in memory from c++ to VB (and then from VB to c++). Does anyone know how to do this? I am trying to encapsulate all the functions in a ActiveX, so i think i should pass my raw unmanaged c++ data to an Interface like IPicture or something like that.
You can use the function OleCreatePictureIndirect to create an IPicture wrapper around a bitmap. I think there are members of IPicture that allow you to render it to a bitmap to do the reverse.
Nathan
|
|
|
|
|
Hi All
I have developed an MMC sanp-in.there is a printer node in left pane,when I click on the printer,it displays jobs in that printer in right pane(result view).
I want to extract the index of the item selected in right pane(result view).I have to enable a menu on selecting a row in result view based on the value os a sub item in result view..
Plzzzz help me...
Thanks in Advance.
Rashmi Kushwaha
-- modified at 7:55 Monday 22nd October, 2007
|
|
|
|
|
It's not urgent for us so refrain from adding "Urgent", "please help me" or any one of a number of things which will guarantee you getting no answer.
|
|
|
|
|
Hi
I have some atl project with ctrl and I want to add CP support for this.
When I create project I don't set check for CP support and now I don't understant how to do it.
I try to implement interface. But after that in "add CP" menu VC2003 dont show this interface.
I try to create new project whith CP support and find differences, but this projects completely different. In project w/o CP I work with my ctrl directly in project with CP I must work throught CContainedWindow but I can't register (or something) my ctrl... overall CContainedWindow("MyCtrl", this, 1) - didn't create any window.
How to add CP support in project?
Thanks, Anton
|
|
|
|
|
Add support for the following Interfaces in yours coclass.h:
Class ATL_NO_VTABLE YourCoClass:
...
public IConnectionPointContainerImpl<yourcoclass>,
public CProxy_IXXXEvents<yourcoclass>,
...,
Public IXXX
{
....
//ADD THE CONNECTION POINT MAP
BEGIN_CONNECTION_POINT_MAP(CCoRectangle)
CONNECTION_POINT_ENTRY(__uuidof(_IXXXEvents))
END_CONNECTION_POINT_MAP()
Add also the following definitions in your .IDL File
library XXXX
{
[
uuid(/*GENERATE NEW UUID WITH CREATE GUID*/),
helpstring("_IDrawEvents Interface")
]
dispinterface _IDrawEvents
{
properties:
methods:
};
...
coclass YourCoClass
{
[default] interface IXXX;
[default, source] dispinterface _IXXXEvents;
}
}
I hope it was usefull
Any doubts, please ask
JO
|
|
|
|
|
Hi!
I've this problem.I've to do a in process COM server in C++;the server has to send in real time as fast as possible a vector of six elements produced by a stand alone application (written in C++) to a MATLAB client. MATLAB client can't read the new value of vector untill the application does not write new one.
Can you suggest me a possible solution?
Thanks.
DanyCode
DanyCode
|
|
|
|
|
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?
|
|
|
|