|
Is there any WTL way to do this?
|
|
|
|
|
Use the DECLARE_WND_CLASS() family of macros in your CWindowImpl -derived class.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I don't quite understand how to use it. I'm coverting my project from Win32 to WTL and in plain Win32 I used a wclass value which i used in the CreateWindow function. How does this work in WTL? I can't find it in my 'documentation' neither.
Thnx
|
|
|
|
|
Oh, you're asking about the class name at the time you create the window. You don't put the class name there, because CWindow takes care of it.
class CMyWnd : public CWindowImpl<CMyWnd>
{
public:
DECLARE_WND_CLASS("MY_CLASS_NAME");
...
}; Then when you make a CMyWnd object and call its create, ATL handles the class name for you.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
How I make to develop an ATL control using MFC Print Preview callingr from Visual Basic or Visual C++ 5.0/6.0 Main program.
If it's possible, the ATL control may be an ocx thax i can use from these ambients and I have only 2 Events
OnPrinting <-- This is generate at the state change
OnPrintData <-- this is generate whe the controls may print data
I would also these procedure
SettingPage (One or several function)
PreviewOrPrint
DoPreview
DoPrint
Anyone can help me??
|
|
|
|
|
I want to make a multithreaded program by using
AfxBeginThread(...). I am not getting any relevent information about it. Since I don't want to use any other method or function for threading because it is considered to the most simple one for the beginners.
Please provive me with relevent sites/simple codes using this function as on every site I am finding different methods of handling threads and am confused.
Reply me soon
|
|
|
|
|
|
Hi Thomas. In your particular case, you don't need to delete each pair, nor even delete both members: std::string s take care of cleaning up their own resources, so you only have to cope with the second member of each pair:
template <typename T>
struct delete_second
{
operator()(T& t)const
{
delete t.second;
}
};
...
for_each(mymap.begin(),mymap.end(),delete_second<map <string, Type* >::value_type >());
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hi,
I am trying to use the static library which is having 4 to 5 functions.In
project settings-link tab i gave the library name and i included the header
files also.In spite of that it is giving this linker error.
What to do next.pl help
IPAddr.obj : error LNK2001: unresolved external symbol "struct value_pair *
__cdecl get_data(char * *,int)" (?get_data@@YAPAUvalue_pair@@PAPADH@Z)
|
|
|
|
|
It might be that the static library was built with the C runtime as a DLL while your main program was built with the C runtime statically linked.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi,
since I'm not vey dedicated to GUI programming and it is in some cases necessary, I was seeking the way to make GUI in my applications faster, which I was writting directly through API, but not to use any RAD tool.
I started to learn MFC which is very (not to say hard ) opaque to me, maybe because I used to do programming in API directly or something else.
Friend of mine, suggested me to use WTL to make GUI faster, which is (in his opinion, I don have one yet ) much better in any aspect regarding MFC.
So, I've downloaded WTL 7.0 from MS site, but not to count add-in wizard in VC I don't know where to start from, for learning to do programming using this library. I've found one .chm file on this subject but it was corrupted, and nothing else.
So my question is, can anyone help to get start, firstly by informing me where can I find some good free documentation on this subject and a good tutorial to understand better WTL and to begin my programming very soon independantly.
Thanks.
|
|
|
|
|
|
Hi,
if made a MFC acticeX control and anything works fine. if got a event called myData that returns a string, no Prob (VC++ 6 wiz does the most stuff by click, nice)
but now, i need a event then will return a alt-class called clsData.
can someone help me out?
thanx a lot and please have partience, i'm new a programming vc++
yours thorsten
|
|
|
|
|
I want to access the data files in the same dir as DLL,so I need the pat name of the DLL. I use following:
GetModuleFileName(m_hInst,pszDLLpath_buffer,_MAX_DIR);
and it seems not work.
|
|
|
|
|
place the DLL in Winnt/system32 and use this path
|
|
|
|
|
Anyone has some doc/sample about this?
Thanks!
---------------
Tired of Spam? Introducing InboxShield® for Microsoft® Outlook®
http://www.edovia.com
|
|
|
|
|
|
I'm new to ATL and struggling. Forgive me if this is a really dumb question!
I've managed to put together a simple WTL/ATL app, hosting an ActiveX and picking up enents back from the ActiveX.
But now I want to write some text to the StatusBar. OK, I can do that (using a multi-pane status control as per Ed Gadziemski's excellent article), from within the Main Window.
But I want to write to it from the Child Window. Only I cannot find any method of the child window which will give me a pointer back to the main window and hence to the Status Control.
See, I said it was dumb! Thanks for any guidance.
Tony Hedge
|
|
|
|
|
This might not be the "correct" way of doing it, but this is how I have always done it. When I create an instance of my child windows, I pass a pointer of the main window to them. Then I just store that pointer for later use. It might not be "clean", but it gets the job done very simply and easy to understand.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
When I create an instance of my child windows, I pass a pointer of the main window to them.
Thanks - I was beginning to think along those lines, but thought there might be some 'intrinisic' way of doing it.
Regards
Tony
|
|
|
|
|
I'm pretty sure I'm missing something obvious, but can't CWindow::GetParent do the job?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquin
That can certainly get me an HWND, but then I get lost. I cannot see how to then get a pointer to the window, or get access to the StatusBar via the HWND.
Thank
Tony
|
|
|
|
|
CStatusBar(hParent).SomeFunctionYouCannotLiveWithout();
|
|
|
|
|
In stdafx.h, replace
extern CAppModule _Module; with
template <typename TWnd>
class CMainWindowedAppModule : public CAppModule {
TWnd* m_pWnd;
public:
void SetMainWindow(TWnd* pWnd) {
m_pWnd = pWnd;
}
TWnd* GetMainWindow() {
return m_pWnd;
}
};
extern CMainWindowedAppModule <class CMainFrame> _Module;
And in <YourAppNameHere>.cpp, replace
CAppModule _Module; with
CMainWindowedAppModule <class CMainFrame> _Module;
and don't forget to call SetMainWindow() in Run() before entering the message loop.
Nice and simple if HWND isn't enough. Plus, you can stick other stuff into that class too if you want/need.
--
There's a new game we like to play you see. A game with added reality. You treat me like a dog, get me down on my knees.
We call it master and servant.
|
|
|
|