|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
This makes me very puzzled and angry.Please have a look at :
....... ....... _hSelf=::CreateWindowEx( WS_EX_ACCEPTFILES, (LPCWSTR)_className,\ (LPCWSTR)"Web Studio 2008",\ WS_OVERLAPPEDWINDOW,\ CW_USEDEFAULT,\ CW_USEDEFAULT,\ CW_USEDEFAULT,\ CW_USEDEFAULT,\ _hParent,\ NULL,\ _hInst,\ (LPVOID)this); ........ ........ The code is compiled and linked successly under VS2005.But ever time it runs to "(LPVOID)this" in the function "CreateWindowEx" ,an exception occurs which say 0x00000000 Department untreated anomaly: 0xC0000005: reading position 0 x00000000 visit when conflict in the VS 2005. Why?Why?WWWWW? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Young wrote:
> This makes me very puzzled and angry.Please have a look at : > ...... > ...... > _hSelf=::CreateWindowEx( > WS_EX_ACCEPTFILES, > (LPCWSTR)_className,\ > (LPCWSTR)"Web Studio 2008",\ > WS_OVERLAPPEDWINDOW,\ > CW_USEDEFAULT,\ > CW_USEDEFAULT,\ > CW_USEDEFAULT,\ > CW_USEDEFAULT,\ > _hParent,\ > NULL,\ > _hInst,\ > (LPVOID)this); > ....... > ....... > The code is compiled and linked successly under VS2005.But ever time > it runs to "(LPVOID)this" in the function "CreateWindowEx" ,an > exception occurs which say > 0x00000000 Department untreated anomaly: 0xC0000005: reading position > 0 x00000000 visit when conflict > in the VS 2005. Your code is not detailed enough, what kind of class object does "this" points to? And I suspect that this is off-topic, better post it to windows programming NG. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Oh,I'm sorry I'm new to this usernet.I think the bug concerned with
cpp,so...And if it can't be solved here ,I will go windows programming NG. But please do me a favor, thanks. ...... class WebStudio:public Window { public: WebStudio():Window(){}; //,_mainWindowStatus(0),_pMainSplitter(NULL),_hTabPo pupMenu(NULL),_hTabPopupDropMenu(NULL),_pEditView( NULL),_pDocTab(NULL) {}; void init(HINSTANCE,HWND,const char*); bool doOpen(const char *fileName); static const char * getClassName() { return _className; }; private: static const char _className[32]; }; ..... class Window { public: Window():_hSelf(NULL),_hParent(NULL),_hInst(NULL){ }; virtual ~Window(){}; virtual void init(HINSTANCE hInst, HWND parent) { _hInst = hInst; _hParent = parent; } protected: HINSTANCE _hInst; HWND _hParent; HWND _hSelf; }; ..... |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Young wrote:
> Oh,I'm sorry I'm new to this usernet.I think the bug concerned with > cpp,so...And if it can't be solved here ,I will go windows programming > NG. But please do me a favor, thanks. > ..... > class WebStudio:public Window > { > public: > WebStudio():Window(){}; > //,_mainWindowStatus(0),_pMainSplitter(NULL),_hTabPo pupMenu(NULL),_hTabPopupDropMenu(NULL),_pEditView( NULL),_pDocTab(NULL) > {}; > > void init(HINSTANCE,HWND,const char*); > bool doOpen(const char *fileName); > static const char * getClassName() { > return _className; > }; > private: > static const char _className[32]; > }; > .... > class Window > { > public: > Window():_hSelf(NULL),_hParent(NULL),_hInst(NULL){ }; > virtual ~Window(){}; > virtual void init(HINSTANCE hInst, HWND parent) > { > _hInst = hInst; > _hParent = parent; > } > > protected: > HINSTANCE _hInst; > HWND _hParent; > HWND _hSelf; > }; > .... Well, after I looked at the CreateWindowEx API on MSDN, the last parameter requires a pointer to "CREATESTRUCT", "this " is absolutely not typeof(CREATESTRUCT*). |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Mm,after I send the last message,I suddenly notice that the last param
in CreateWindowEx should point to a CREATESTRUCT struct.But if so, I have no idea to make it point to the CREATESTRUCT struct.How to do that? |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Dec 23, 9:23 pm, Young <myfriend...@gmail.com> wrote:
> Mm,after I send the last message,I suddenly notice that the last param > in CreateWindowEx should point to a CREATESTRUCT struct.But if so, I > have no idea to make it point to the CREATESTRUCT struct.How to do > that? Declare a struct like so: CREATESTRUCT cs; then fill in the members of cs like: cs.x = y; cs.a = b; .... then pass "&cs" as the last param. |
|
![]() |
| Outils de la discussion | |
|
|