|
Please use the 'Preview' button to check for problems before posting your messages. It'll make it much easier to answer your questions. Thanks
- Mike
|
|
|
|
|
|
You're missing the '<' in your for header. I had to look at the page source to see what your code for that line was.
I'm assuming that RemoveCharacter() is just supposed to remove amount entries from the end of the CharacterPos vector. There are a number of problems with your code:
First, you're using vector::pop_back() which decreases the size of the vector each time, but you're always getting the item at numCharacter - 1 . After one iteration, that index no longer exists. I think you want CharacterPos[CharacterPos.size()-1] instead. Note that you can get the last element with CharacterPos.back() , which is equivalent.
Second, what type is CharacterPos ? Is it a vector<CharacterCoordinate> or a vector<CharacterCoordinate*> ? We need to know. Please include the error you're getting as well.
As an aside, if CharacterPos is of type vector<CharacterCoordinate> , then you don't need a for-loop. Look up the vector::resize function.
- Mike
|
|
|
|
|
I get the following error when I build my atl project.
"myProductLookup error PRJ0019: A tool returned an error code: "Performing registration""
The catch is I am attempting to use a c api call. I have setup the project properties the same as for creating a regular cpp dll with the api calls. Any ideas how I can incorporate the api's into my project?
Overall goal is to execute a query in my api against a legacy system from a web application. Kind of like cgi. Thoughs?
Thanks.
Courtney
|
|
|
|
|
Well, didn't got it clearly, but the Performing registration stuff happened, when the Visual Studio tries to register your DLL (through calling the from-your-dll-exported function DllRegister or how it is exactly). If there's not such a method or if it failed inside, you'll get this message.
Then, if you have some COM enabled library that should be registered, you have to correct the registration code.
If it is old plain DLL, then you have to switch off the project settings that tries to register the library after building it.
|
|
|
|
|
I would like to write a wrapper around the deque implementation whereby the user cannot access the original deque implementation and I'm wondering if it would be best to derive a new template class from deque eg.
<br />
template <class T><br />
class CMyClass : private deque<T><br />
{<br />
};<br />
or just have a private workarea within my new class eg.
<br />
template <class T><br />
class CMyClass<br />
{<br />
private:<br />
deque d;<br />
<br />
public:<br />
};<br />
Can anybody offer a suggestion as to which is 'more correct' and why. The main problem I am having with deriving my class from deque is how to handle the use of the overloaded [] (subscript) operator. If I do nothing the compiler gives an error due to private inheritance.
Any suggestions will be gratefully received.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Being inaccesible due to private inheritance is tantamount, from the user point of view, to not having this particular member present. If you find the error message annoying nevertheless (I also think it can be misleading), your only alternative is to have a private member. None solution is in principle preferred over the other, though private inheritance simplifies a little the process of publicizing private member functions:
struct A
{
void f();
void g();
};
struct B: private A
{
using A::f;
};
struct BB
{
void f(){a.f();}
private:
A a;
};
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I finally worked out how to call the overloaded subscript operator for the base class as follows...
<br />
template <class T><br />
class CMyClass : private deque<T><br />
{<br />
<pre><br />
T& operator[](DWORD subscript)<br />
{<br />
return((*(dynamic_cast<deque<T>*>(this)))[dwSubscript]);<br />
}<br />
</pre><br />
}<br />
Its very ugly but it works and thats good enough for me. Thanks for taking the time to help me out. Very much appreciated.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
|
Thanks for the info. Very much appreciated.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Hi,
I'm using this libary to convert PNG's to dibs. When i use a function in this lib, however, when i try to compile it, it gives me errors like this.
error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
And it gives them for a lot of functions. I do know what they mean i just don't know what to do about it....
I can compile it when i use Debug Multitread DLL.
I already contacted the auther of this project by mail but he doesn't seem to respond.
Thanks in advance
|
|
|
|
|
This happens if you use one setting for which runtime to use, and the lib was built using another. If it works when you use 'Debug Multithread DLL' but not when you use 'Debug Multithread', guess which one they used ?
Steve S
[This signature space available for rent]
|
|
|
|
|
Hi,
I need the solution or design where I should write the data strcut like this -
MyStruct{
string1 ;
string2;
float[ ]
}s;
s[ ];
I have written string1 and string2 using vector as these are dynamic arrays but I am not able to write dynamic arrays of float. I am planning to use something like vector here again.
Can somebody help me in this regard?
Regards,
MB
|
|
|
|
|
Use std::vector? It should work.
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
This is same structure I am looking to store or read
Name1, Name2
Surname1, Surmane2
MiddleName1,MiddleName2 //This structure has been stored in vector successfully
12, 12, 13
15, 14, 12
12, 34, 45 //Marks
// Marks in some test and these tests can grow up to 100 or 200
// and this arrays are not able to store in above vector
Please suggest me code or design for this problem.
Regards,
MB
|
|
|
|
|
Here's my suggestion:
typedef struct
{
string s1,
string s2;
vector <float> FloatVec;
} MyStruct;
and then:
vector <MyStruct> MyStructVector;
Best regards,
Alexandru Savescu
<small>P.S. Interested in art? Visit <a href="http://www.geocities.com/mirunadutescu" target="_blank"> this! </a></small>
|
|
|
|
|
I'm developing a kind of embeddable dialog window with all business functionality (as Composite Control)
There is an additional requirement: this control will be embedded into different applications (mostly written in VB) with different GUI layout rules. So it would be great to have possibility to rearrange and resize controls inside the Composite Control in design time.
How it could be implemented?
|
|
|
|
|
Hi All,
I am writing an ActiveX control and it have to work on VBA form (just my cool edit control). The problem is that the default implementation of ATL ActiveX full control refused to work with MS office VBA. (It works in any other containers like MSIE and so on)
Does anybody has an idea what's I am doing wrong? Or may be you can show me an example of the ActiveX control that can work with MS Office VBA
PS: Sorry for my poor English
Uladzimir
|
|
|
|
|
I hope you people can perhaps help me out here. I've inserted a ATL object into a MFC project and now i want to access that object through a console application that sets certain values. My question is: What kind of ATL/COM server is created when inserting an ATL object into a MFC project. Is it a ATL Server (Exe)? or Dll?
I can't find the object in the VC++ COM/DCOM object viewer, nor is the type library registered? How can i access this interface through COM?
Any help would be appriciated.
P.S. if the question is not clear, please specify which part, so can still hope for an answer.
|
|
|
|
|
A COM server under ATL can be in-proc, local, or remote given that it is non-ActiveX. An ActiveX server must be in-proc.
Is the COM server registered?
Kuphryn
|
|
|
|
|
Well yeah...i know that, but what kind of COM Server is it when i add it to a MFC project. I think, by the way, that's it's custom to use automation support for a MFC project, if you want to have server capibilites, but i'm still looking into that.
|
|
|
|
|
Abebe wrote:
What kind of ATL/COM server is created when inserting an ATL object into a MFC project
The type of COM server has nothing to do with ATL or MFC. If it's a DLL, then it's in-proc. If it's an EXE, it's an out-of-proc server.
--Mike--
Latest blog entry: *drool* (Alyson) [May 10]
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
I have a problem with the ATL counter type "PERF_AVERAGE_TIMER".
I use the following code to define and increment the value of the counter. It displays always the value 1200 at the Performance monitor.
DEFINE_COUNTER(m_nAvRequestTime, "Average Time", "Help.", PERF_AVERAGE_TIMER, 0)
DEFINE_COUNTER(m_nAvRequestTimeBase, "Average Time Base", "Base Help", PERF_AVERAGE_BASE, 0)
ULONG m_nAvRequestTime;
ULONG m_nAvRequestTimeBase;
InterlockedExchangeAdd((LPLONG)&m_nAvRequestTime, nT2minusT1);
InterlockedIncrement((LPLONG)&m_nAvRequestTimeBase);
The same logic, works fine if I use C#.
Do you know if there is any problem related with AVERAGE counters in ATL?
Thanks.
Paula
|
|
|
|
|
Hai all,
Can u plz tell me where can I getb the complete documentation with examples on MSflexGrid using VC++.This is very urgent !!!
ThomasKennedyBose
|
|
|
|
|
Hi, I need to create a new Activex control by sub classing another Activex control. This will retain all the old functionality plus some other functions can also be added, i have tried doing it through the MFC ATL wizard, but that only create a wrapper araound it. Also MFC's ActiveX control wizard does seem to support sub classing of some MS standard controls only.
if you have a way to acheive this then please do help.
Mayank Goyal
|
|
|
|