|
Thanks Jörgen, answers like this are why I love CodeProject, fully deserving of a five.
Time to go back and fix some of that old code...
Boost::Compose[^] Has been deprecated in favour of bind and lambda btw
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Thanks for your kind words.
Real soon now, I will be ending a java project (at least my involvement in it), and go straight back to C++. I can't wait.
I have a bunch of header files with code for dealing with composition. With a bit of luck, I'll see if I can gather enough strength and will to write an article about it later on. Sure, there's always boost, but I figure I can show the concepts of functional composition if I used my own code. I think just the awareness of these tricks makes STL a lot easier and more enjoyable to work with.
--
Booohoo!
|
|
|
|
|
Hello all. Tell me please can I get the http session which was created by ASP.NET page from my ATL ActiveX component and work with it? Thanks.
|
|
|
|
|
Alright,
I've taken an existing VC6 C++ COM dll which uses MFC libraries, converted it to VC 7 and added the ATL COM+ class. It compiles fine. However when I try to drag and drop it into COM+, I see nothing visually show up. I looked at the registry and it does register the ATL dll. I also took another ATL Dll, downloaded it's source code, and recompiled. Then dragged and dropped it into COM+ and the classes and interfaces show up so this to me means I don't have any issues as far as the present of the necessary dlls. Specifically atl.dll.
The ATL dll that I used as an example that works is much smaller than the one I'm creating and it doesn't use the MFC library but from everything I've read that shouldn't make a difference.
One final note: I did add the ATL DLL manually instead of using drap-n-drop and it displays the class but no interfaces are present.
Paul
|
|
|
|
|
Hi All
Is it possible to develop a COM server as a/service which would start when a client instantiates an object of it?
I know this is possible in theory, but I've tried doing it, by creating a Service using ATL COM Wizard and then adding an ATL Object.
From the client, I tried to instantiate an object of this exposed interface. But the service does not start up and the pointer returned to me in the client is NULL.
Can anyone help me provide pointers?
Thanks in advance,
Cheers
Raja
|
|
|
|
|
|
Hi
Thanks heaps !
I was trying to instantiate an instance using VC++ and CoCreateInstance. Maybe I could not get the CLSID of the class correctly.
I used VB client and it works fine ! )
Many a thanks,
However, can you tell me how to get the CLSID of a class id to use it with the CoCreateInstance. I tried CLSID<>, __uuidof <>, but no luck
I tried using the Smart pointers too.
Cheers
Raja
|
|
|
|
|
hi all,
I want to add a property to HTML Control. which set some of data member
m_myvar of the control.
From html page i want to set this m_myvar from the HTML page
Some thing which can be used as follwed:
<object id="MyHTMLcontrol" classid="CLSID:here goes my CLSID " param="" name="m_myvar" value="some value " width="100%" height="100">
how i can do the same.
Thanks
Abhishake
|
|
|
|
|
hi all,
Here this is what i have done so far.
1.Created a Full control using ATL app Wizard. MyATLFullCntrl
2. Added following line to the list of Classes that the MyATLFullCntrl
public IPersistPropertyBagImpl</code> <code> <MyATLFullCntrl>
3. Added Entry in COM_MAP
COM_INTERFACE_ENTRY(IPersistPropertyBag)
4) Added a Property using add property
Type: BSTR
Name: Url
5) Implement the get and put methods in the .cpp file:
STDMETHODIMP MyATLFullCntrl::get_Url(BSTR *pVal)
{
return S_OK;
}
STDMETHODIMP MyATLFullCntrl::put_String(BSTR newVal)
{
return S_OK;
}
6) Add the following entry to the PROP_MAP:
PROP_ENTRY("Url", 1, CLSID_NULL)
With this setup I am opening the web page with Object tag Embeded
<HTML>
<HEAD>
<TITLE>ATL 3.0 test page for object MyATLFullControl</TITLE>
</HEAD>
<BODY>
<OBJECT ID="MyATLFullControl" CLASSID="CLSID:XXXXx-XXXX-XXX" HEIGHT=100 WIDTH=100 >
<PARAM NAME="Url" VALUE="abc">
</OBJECT>
</BODY>
</HTML>
but when i debug ,the control is not at the put_Url() function.
Can anybody point me where i am wrong?
Thanks in advance,
Abhishake
Success is simply a matter of luck. Ask any failure.
--Earl Wilson
|
|
|
|
|
Hi,
when I design a dialog in a WTL project, what's the equivalent of a CSliderCtrl to control a Slider on a dialog and how do I get the contents of an edit box?
Another question is, how do I work that out with the resource editor within Visual Studio?
Thanks,
Peter
|
|
|
|
|
|
This is excellent news! Thanks for the head's up
--
Booohoo!
|
|
|
|
|
Anyone who knows what have changed since 7.1 besides
opensourcing it?
The readme looks like this.
Maybe i can add items there and they magically improve..
8. Changes Between WTL 7.5 And 7.1
New and improved:
<< TODO: Add items >>
Fixes and enhancements:
<< TODO: Add items >>
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
_Magnus_ wrote:
Maybe i can add items there and they magically improve..
The reverse is probably better. You magically improve things, and they will be added to the list.
--
Booohoo!
|
|
|
|
|
Hi! my name is jinsoo. i am korean
after installing xp service pack 1 and latest windows update.
i cannot register activeX control on registry.
when in 2003. this job was good in windows 2000.
so though using regsvr32.exe not vc++ tool .the result was the same.
the error message is 0x80070715.
though i find the error message in msdn. i can not find that.
my system is windows xp.
tool is VC++(Serviced pack 6.0).
i hope you help me to solve this problem.
nice to meet u
|
|
|
|
|
Hi,
I am converting an VC 6.0 C++ DLL to ATL VC 7.0 DLL. I first converted the DLL to a VC 7.0 non-managed COM DLL. I tested this and everything works fine. Then I proceeded to add an ATL COM+ class to the project. The compiler compiles w/ no errors however it errors out when trying to regsvr32 the DLL w/ the following message...
[Performing registration
Project : error PRJ0019: A tool returned an error code from "Performing registration"]
What does it mean ???
Thanx & Regards,
Paul
Paul
|
|
|
|
|
I started with C++ recently Basically i am trying to overload the >> operator but couldn't succeed.The aim is to parse the string into different values.Infact this was provided with IBM open classes but not present with standard C++ string
#include <iostream>
#include <string>
using namespace std;
#define DELIM '~'
main()
{
string S="2~R~10/01/03~Personal Watercraft~Pers. Watercraft~9.0500~";
string s1,s2,s3,s4,s5,s6;
S >> S1 >> DELIM >> S2 >> DELIM >> S3 >> DELIM >> S;
S >> S4 >> DELIM >> S5 >> DELIM >> S6 >> DELIM;
}
Basically i am expecting the values between delimiters to be populated itno s1,s2...
I have declared this fucntion as in IOC
#ifdef __IOC_ANSI_STREAM
friend std::istream& operator>>(std::istream& aStream, string& aString)
#else
friend istream& operator>>(istream& aStream, string& aString)
#endif
Can you experienced guys let me know how to implement this or what has to be done to acheive the desired values.Thanks a lot in advance
Thanks
Sas
|
|
|
|
|
I recommend that you don't try to overload the stream insertion and extraction operators for strings, developers expect their tools to work in consistant ways - and this isn't.
For really simple parsing jobs it's easier to just search the string for the delimiting character and copy that substring out. For more complex tasks use a regular expression library like boost::regex.
#include <vector>
#include <string>
std::vector< std::string > parseString(const std::string& strin)
{
std::string str = strin;
std::vector< std::string > words;
size_t splt = str.find("~");
while(splt != string::npos)
{
string out = str.substr(0,splt);
words.push_back( out );
str = str.substr(splt+1,str.length());
splt = str.find("~");
}
words.push_back( str );
return words;
}
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Thanks a lot for the info.But then this will be great when we are writing a new program.But then when an application is to be ported from IBM Open classes to satndard C++/STL, i guess thsi is not enough.
Becasue while parsing IString,we can parse up to some portion and can retain the remaining in the original string itslef.Thats where i am becoming clueless as to how to impleemnt this in STL.
#include istring.hpp
#include istparse.hpp
main()
{
IString IS1= "12#34#56#78#90#ab";
IString I1,I2,I3,I4,I5,I6;
IS1>>I1>>DELIM>>I2>>DELIM>>I3>>DELIM>>I4>>DELIM>>IS1;
IS1>>I5>>DELIM>>I6;
}
Any ideas on how to acheive this type of functionality?? This is where i am not able to make out anything.
Thanks
Sas
|
|
|
|
|
I'm assuming that you want to keep supporting some of the functionalities of IString - but want to start moving to STL? I had a quick look at the documentation of IString, it seems to have a conversion operator to char*, so you should be able to directly construct a std::string from an IString, provided your IString's will never have embedded nulls.
What follows is a (hack) way of extracting the data in a way similar to what you are doing, because the stream extraction operators will read until they reach whitespace (and AFAIK, you can't change the definition of whitespace). One function which gets around this limitation is getline, which (optionally) stops at a delimiting character. This won't work without modification under VC6 (requires an STL patch from dinkumware)
#include <iostream>
#include <sstream>
int main()
{
std::istringstream iss("12#34#56#78#90#ab");
std::string I1,I2,I3,I4,I5,I6;
std::getline(iss,I1,'#');
std::getline(iss,I2,'#');
std::getline(iss,I3,'#');
std::getline(iss,I4,'#');
std::getline(iss,I5,'#');
std::getline(iss,I6,'#');
return 0;
}
'The Standard C++ Library' by Josuttis is a good reference if you get stuck, it covers all of this and more in depth.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Thanks Andrew..i am enlightened by this..
I went by another approach by writing a new class to over load the extraction operator
Sas
|
|
|
|
|
What is the interface against which one typically queries
IID_ITableCreation ? IID_IDBInitialize ? IID_IDBCreateSession ? I'm a bit lost
here.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
I've sorted this one out: one has to query for ITableDefinitionWithConstraints ...
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Among 256 colors in palette, 16 are allocated for
graphics and 240 are for grey-scale video.
I use same palette for selecting into hDC and for
making bitmap.
256 was returned by RealizePalette(hdc).
However, video quality under 8-bit display is worse
than 16-bit display.
Can you give me some clue ?
|
|
|
|
|
I am not sure what you are asking. When you are using the windows api in 8 bit mode you can only display 240 different colors no matter what palette you try to use. This restriction does not exist if you use full screen directdraw. As in full screen directdraw you can use 254 colors + white + black. In 16 bit mode you have 65K colors so it can and will look better.
John
|
|
|
|