|
xxhimanshu wrote:
hi all,
i want to write data to a text file...i am using ATL..and i dont have any idea about this..any help or pointers are higly welcome..please help me out..
thanks in advance..
Why not use the regular fstream object of C++?
-Nick Parker
|
|
|
|
|
Hello,
My code looks like this:
struct CButton
{
COLORREF color;
BOOL select;
tagDRAWITEMSTRUCT pditag;
}MyCButton;
[helpstring("method DoOwnerButton")] HRESULT DoOwnerButton([in]DRAWITEMSTRUCT pstruct,int IID_BUTTON, TCHAR * Caption,int Wmessage,MyCButton pnew);
I am getting error:
error MIDL2025 : syntax error : expecting a type specification near "tagDRAWITEMSTRUCT"
Is that mean that I can not use Windows structure in idl file?
PLease answer as soon as you can
Tahnks in advance
Nena
Nena
|
|
|
|
|
Hello,
I want to use the latest collection classes from VC .NET so I chose hash_set . The collection is storing custom objects (not just plain int s) that have operator < . Can anyone show my how do define the hash_set and its corresponding hash_compare correctly?
Thanks
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
You only have to define operator < for your class:
class MyClass
{
public:
...
bool operator<(const MyClass& x)const
{
}
};
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I wish it were that easy....
I get C2440 error (cannot convert from const MyClass to size_t ). I think I must derive from hash_compare and implement custom hash method as the compiler does not know how to get a hash code for my objects...
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
This sounds strange. Could you post the code to see how you're using hash_set ? I think it should work once you defined operator < .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Here's the code:
#include <iostream>
#include <hash_set>
using namespace std;
class MyClass
{
public:
int x;
MyClass (int a) : x (a)
{
}
bool operator < (const MyClass& OB) const
{
return x < OB.x;
}
};
int main ()
{
hash_set <MyClass> MySet;
MySet.insert (MyClass (2));
}
Best regards,
Alexandru Savescu
<small>P.S. Interested in art? Visit <a href="http://www.geocities.com/mirunadutescu" target="_blank"> this! </a></small>
|
|
|
|
|
I write a control for script, but I can't return more then one parameters:
[out] VARIANT param1,
[out] VARIANT param2,
[out,retval] VARIANT *pret
now only one parameter will return well, is that script can't accept method that have more output parameters?
|
|
|
|
|
First I have to say, I like WTL so far and have decided to create a control instead of using MFC, my only question is this...actually i think i know the answer, but i'm not sure how...
How do I include an WTL control (mycontrol.h) in an MFC project???
What steps are required...?
Thanks...
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
My project compiles and builds and runs fine for debugging but when I try to build the release version I get the following error. Anyone ever seen this before?
error C2065: '_AtlModule' : undeclared identifier
I should mention that I was able to build the release before without a problem, then one day this showed up. I'm not sure what is going on. TIA for any assistance.
Matt (Padawan Learner)
|
|
|
|
|
Hi all,
I have an application written in C++ using win32, it creates a few windows, has a menu etc. Nothing fancy. But it's becomming a major pain to add new windows, fancy controls and whatnot so I thought about using WTL instead of the raw API's.
Is that feasible? The app works fine right now so I would like to create the new windows using WTL, the existing may be converted in the future.
.Henrik
---
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
Yep, it's pretty easy.- Remove your include of windows.h; instead, include atlbase.h, atlapp.h, then whatever other ATL/WTL headers you need.
- Right after the atlapp.h include, add
extern CAppModule _Module; - In one of your CPP files, declare the global
CAppModule _Module; - At the beginning of
WinMain() , call _Module.Init(NULL, hInstance); (where hInstance is the 1st param to WinMain() ).
--Mike--
Eh! Steve!
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Great, I'll give it a try.
Thanks for the info.
---
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
Hi All,
I am working on a Windows browser sort of a thing and building it in ATL domain. The problem I am facing is that I can't "Cut" a file from a given location. I have "Copied" a file and "Pasted" it but I don't know how to "Cut" a file.
Can anybody help me????
Best regards,
Pious.
|
|
|
|
|
Cut/Paste == Copy + Delete.
Copy from old location to new, then delete from the old location.
-Sean
----
Shag a Lizard
|
|
|
|
|
Is this a MS specific library?
For instance could I use WTL in say Bloodshed C++? I'm not sure if the ming(??) compiler supports templates or not?
Anyways, if I can use WTL in VC++ and bloodshed...that would be super...
Thanks
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
I believe ATL is MS-specific - I think it uses some MS extensions, such as __uuidof , in places. Looking at the WTL code, the only thing I can see (in a small sample of the code) is the use of #pragma once .
Best thing to do is to try compiling some WTL code and see what happens!!!!
If you're not tied to GCC, you could try the Borland or Watcom C++ compilers - they're both freely downloadable....
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
How can I shift all the items on a stack up by one?
Item1
Item2
Item3
Item4
After shifting up by one you would have
Item2
Item3
Item4
Item5
Do I have to create a temp stack? Or is there any way I can access each item in the stack like vector? A quick hack maybe...I just think swapping the values (except index 0 which would overwritten) would be more efficient the creating a temp stack (or popping the values off into a vector, then copying the vector values over to the new stack)
Anyways...if I made myself clear and you understand what i'm trying to do...can this be accomplished???
Thanks
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
One solution is to use a list or a deque container that way you can add elements from both ends.
Kuphryn
|
|
|
|
|
You can use a stack::iterator and iterate through elements in the stack.
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
i find CArry class in mfc quite convenient to use, then can we use it in wtl?
modified 1-May-21 21:01pm.
|
|
|
|
|
I am not sure if you can without MFC, but I suggest that it is better to learn STL. I have a lot of old code that uses the MFC template classes and I wish I would have switched to STL sooner. The only problem is STL is a lot harder to learn to use, however it is worth the extra time because STL is way more powerful than MFC template classes and also more portable.
John
|
|
|
|
|
|
Michael Dunn wrote:
You can use the STL equivalent, std::vector
:-DI can use CAtlArray instead.
modified 1-May-21 21:01pm.
|
|
|
|
|
Yes, but why would you ? Seriously, why are people so scared of learning STL, when it's so much better ?
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|