|
Jörgen Sigvardsson wrote: I don't see how boost comes into the picture..?
Boost has different jam configs when building for VC + STLPort, so I think it must be relevanr somehow...
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
Jörgen Sigvardsson wrote: It's also a pain because you'd have to put the DLL next to your binary. You never know which app will overwrite that file.
What do you mean by this?
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
If you rebuild the crt dll, and install it in say Windows\System32, it could be overwritten by another program. Overwritten with the "original" crt dll which has the memory leaks.
If you put the dll alongside the binary, the chances of another application overwriting it is virtually zero.
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Jörgen Sigvardsson wrote: If you rebuild the crt dll, and install it in say Windows\System32,
Shudder. Never even cross my mind to install anything in System32, but you are right - many people actually do that
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Uh huh. I've stopped doing that as well. It used to be "correct practice" once I believe, but it's just asking for headaches. I do DLLs only these days, but I put them side by side with the executable. It won't be much better than .libs from an optimization point of view (shared code, etc). But it is easier from a maintainence point of view, as I only have to patch affected DLLs, and not the entire app.
Another great benefit with DLLs is that it's very easy to debug code on site, as it's just a matter of replacing the DLLs which contains TRACE messages, and/or similar debugging I/O.
I like DLLs. Does it show?
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Jörgen Sigvardsson wrote: I like DLLs
Me too. Although it wouldn't hurt if we got some standard C++ module/component system on top of them. The .NET component system is one of the rare things where .NET is really a better development environment than C++. I know there is COM, but a) it is bloated and b) it is not portable.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I'd ask on the Boost Users mailing list - that's probably more likely to get a useful (or at least definitive) reply...
|
|
|
|
|
Robert Edward Caldecott wrote: The fix is to rebuild the MSVCRT80.DLL, which is a major undertaking and, IMHO, not worth the pain.
Apparently, there is another "unofficial" way: Look at the third reply from the bottom of this page:[^]
Steps:
1) Open up istream in \Program Files\Microsoft Visual Studio 8\VC\Include
2) Before line 29, insert the following code
explicit __CLR_OR_THIS_CALL basic_istream(_Mysb *_Strbuf, bool _Isstd, bool _Noinit)
: _Chcount(0)
{ // construct from stream buffer pointer
if (!_Noinit)
_Myios::init(_Strbuf, _Isstd);
}
3) In the same file (istream), look for the following line:
: basic_istream<_Elem, _Traits>(_Strbuf, false),
and change it to:
: basic_istream<_Elem, _Traits>(_Strbuf, false, true),
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Much appreciated Nemanja.
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
Hi all,
Does aNy body know how we can pass strucutres ( types in VB ) as parameters of function defined in COM DLL interface ?
For e.g. I have one interface called IDatabase and i want to add method like
"HRESULT SetData([in]USER userData)".
In this case the DLL is compiled successfully, but when it is used in the Visual Basic, it gives error
"user defined object can not be passed by value". The DLL should be used in both VB and VC++ client applicaitons.
Karnav Zaveri
|
|
|
|
|
It's not a simple task to pass structures in COM/DCOM.
1. A structure must be of the type VT_RECORD.
2. All the structure's fields must be of an automation-compatible type.
3. The structure must be described in a TLB.
4. The structure must have a GUID (assigned in the IDL file).
5. A special structure-oriented interface IRecordInfo must be used to manipulate structures (IRecordInfo::RecordCreate(), IRecordInfo::RecordDestroy(), etc.).
|
|
|
|
|
Anyone use this product? If so, did you update it for VC7+? If so...I need to talk to you!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Dear all,
I am new to ATL COM programming and the question may be silly, but pls help.
In the COM, I have defined one Simple Object Add with the inferface IAdd. Then in the client program I try to get the COM interface using following:
CComPtr<iadd> pAdd;
HRESULT hr = pAdd.CoCreateInstance(CLSID_Add);
here got problem, the following ASSERT failed;
ASSERT(hr==S_OK);
Then I define the connection Container pointer,
IConnectionPointContainer * pCPC;
hr = pAdd->QueryInterface(IID_IConnectionPointContainer, (void **) &pCPC;
Then I got the assertion failure again and it is atlbase.h line 758 assertion failed.
The program is quite simple, but I just don't know where is the problem. Please help!
|
|
|
|
|
Hello hardworkboy,
The assertion failure after the call to CoCreateInstance() could be due to one of many reasons. It is important at this stage to determine what is the value of "hr". We can then proceed to diagnose the problem.
Best Regards,
Bio.
|
|
|
|
|
Dear Bio Liong,
Thank you for your reply.
The hr value is -2147221008. Actually I am using WCE ATL COM AppWizard to create a COM. Then on the class view panel, I "New ATL Object", then I got the interface like "IAdd". In the testing program, I write the following:
CComPtr<iadd> pAdd;
hr = pAdd.CoCreateInstance(CLSID_Add);
here I got the problem.
I am quite unfamiliar with COM creation with ATL. So I may make silly mistakes. I am sorry for that.
Sincerely,
HWB
HWB
|
|
|
|
|
You haven't called CoInitialize for the thread making the call to CoCreateInstance.
If anyone here says they've never made that mistake, I wouldn't necessaraily believe them...
Steve S
Developer for hire
|
|
|
|
|
Hello hardworkboy,
I'm echoing Steve. Yes, the error indicates that CoInitialize() has not been called in the thread that invoked "pAdd.CoCreateInstance(CLSID_Add);".
You can easily determine the meanings of HRESULT error codes using the "Error Lookup" tool (this is included in the "Tools" menu of Visual Studio).
By the way, it is important to call CoInitialize() as it determines the apartment in which the calling thread will live in throughout its lifetime. Every thread in an application needs to reside in an apartment.
Apartments are used to control cross-thread access to COM objects.
Best Regards,
Bio.
|
|
|
|
|
I would also like to point out that you should look at HRESULT values in hexadecimal format. That way they will be much easier to remember, trust me on that one! (But then again, I think that when you start to recognize the HRESULT values by heart, you're probably way too deep into it )
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Thank you, all!
I have add the CoInitialize(NULL) function but this time I got the LNK2019 error which complains __Imp_Coinitialize unreolved symbol. I have tried to add the "Ole32.lib" and the "Objbase.h", still got the same link error.
I am sorry I still need your help.
|
|
|
|
|
At a guess:
First assert (in your code) happened because the object isn't registered properly. Second because object creation failed but you're using "pAdd" anyway.
Steve
|
|
|
|
|
Ok. So I have a web service that supports session state between client calls. Now I'm writing an ATL client that must also support those session. Right now the code that was generated for me via "add web reference" doesn't preserve sessions between calls. I know that a client in C#.NET for the same web service works fine if you give it CookieContainer. How to tell ATL C++ cleint to support sessions?
Please help! Urgent! Very urgent!
Thanks a lot in advance!
|
|
|
|
|
hi all,
I have a ATL ActiveX Control object. In a html page using Object Tag I am able to receive events fired from this ActiveX object.
Now I am trying to instantiate the ActiveX control in a javascript file using the function ActiveXObject(ComponetName.ClassName) but cannot receive any events to the javascript.
pls advise.
Thank you,
Elza
|
|
|
|
|
help, Given
CString=
"key1: value1\r\n
key2: value2\r\n
key3: value3\r\n"
what would be the best way to be able to randomly access it like a map, eg in one call I want to know the value assigned to key3, and another call I want to know the value assigned to key1.
Thanks!
|
|
|
|
|
if you expect a map behavior, why not using one ?
std::map<CString, CString> mapKeyValue;
<font color=green>
mapKeyValue[<font color=gray>"key1"</font>] = <font color=gray>"value1\r\n"</font>;
mapKeyValue[<font color=gray>"key2"</font>] = <font color=gray>"value2\r\n"</font>;
mapKeyValue[<font color=gray>"key3"</font>] = <font color=gray>"value3\r\n"</font>;
<font color=green>
<font color=blue>int</font> iChoice = Rand123(); <font color=green>
CString strRandomValue;
strRandomValue.Format(<font color=gray>"key%d"</font>, iChoice);
strRandomValue = mapKeyValue[strRandomValue];
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
-- modified at 9:31 Monday 5th December, 2005
|
|
|
|
|
Hello everybody,
Could anybody let me know how to use unique member function of list template class in STL? My problem is, I have a C++ class, Complex, which has two data members, real and imaginary numbers. I am using Complex class in creating a list. How can I use unique member function of list class when I have created a list using Complex class?
Grateful to you,
Thanks,
Software Developer
Sanjay Khapre
|
|
|
|