|
Dear Steve and Mark,
For the m_hWnd ,the value is NULL. When I inspect the variable, I have the following value.
CXX0030: Error: expression cannot be evaluated
Please advice.
|
|
|
|
|
Looks like you haven't created the window yet (as Mark said). See the CWnd::Create[^] function and its friends.
Steve
|
|
|
|
|
Dear Steve,
I am creating a Window from my own class like below. The window is created properly. I can see the window also. Please advice.
m_pWnd1 = new CMywnd1;
if(!m_pWnd1->CreateEx(NULL,
AfxRegisterWndClass(NULL,0,
(HBRUSH)::GetStockObject(BLACK_BRUSH),0),
LPCTSTR(""), WS_POPUP | WS_VISIBLE | WS_SYSMENU ,
115,51,600,405,my_hWnd1,NULL,NULL))
return;
my_hWnd1 = m_pWnd1->GetSafeHwnd();
|
|
|
|
|
Dear Steve and Mark,
I had overcome the issue in a tricky way (dont know the exact problem). I called the SetTimer in OnInitDialog() and it seems to be working fine. Actually, I am creating a popup dialog after creating the main dialog in my program. But I tried giving the SetTimer() before creating the popup window but the same error presists. When I give in OnInitDialog() I dont have any assertion error.
Please advice. Anyhow, I solve the problem without knowing what is actually happening.
Thank you very much for your kind responses.
Many thanks.
|
|
|
|
|
bhanu_8509 wrote: When I give in OnInitDialog() I dont have any assertion error.
That's because that's the first place you can use a CWnd object where its
HWND is valid
That's a perfectly acceptable place to call SetTimer(). Any time before the
WM_INITDIALOG message is received, the HWND isn't set yet, causing the error.
Any time AFTER your CreateEx() call should be fine too, as long as the create
succeeded. WM_INITDIALOG is just one of the messages sent DURING creation.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey I was wondering what the best way to communicate my high scores to my website. I have a highscores.bin file and I need a way to open a socket on port 80 and upload/grab it from the server. Is this even possible and if not whats an easier way.
|
|
|
|
|
Look for a HTTP client or FTP client class. A FTP client is probably easier... with an HTTP client you need to install a CGI/script that allows uploading files to the web server.
Hope it helps!
/M
|
|
|
|
|
Hi,
I am creating a binary file in my application and i need to copy this binary file to another location using the CFileDialog class. how do i do that.
|
|
|
|
|
Get the path where you have to copy the file from CFileDialog and use CopyFile(/*params*/) or see SHFileOperation
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi there people.
I'm trying to redirect the stderr of a process let's say cmd.exe to a raw socket.
I have completed this task by setting the sterr parameter = my socket handle.
I was looking for a function that can take this handle and encrypt the stderr before
sending it to the socket. I could use CreateFile for exampe in order to cache the data
to a file and encrypt it here but it's a bad ugly solution.
In fact I was looking something like CreateBuffer or CreateByte array or MemoryStream of C#.
In other words an intermediate function with a HANDLE input that can return the bytes or something
in order to encrypt them.
Thanx
|
|
|
|
|
hi
how can i read entries from a specified section in the registry while i don't know the entries names? i need to read them all, whatever they might be.
i know that a way is to put a key in the section with a specified name valued with the number of entries and specify retrievable names for the others.
but is there any way other than this? i like to enumerate all of them without having to know the names exactly.
i hope i could describe my question
thx
|
|
|
|
|
Does RegEnumKey [^] fit your needs?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I began in 1984 with a ZX Spectrum, learning BASIC and Z80 Assembly, then I sleept for a while before returning to programming.
It is very unfair of you to have sleepted.
My troll needs to be attended here[^]
|
|
|
|
|
Rajesh R Subramanian wrote: I began in 1984 with a ZX Spectrum, learning BASIC and Z80 Assembly, then I sleept for a while before returning to programming.
Thank you for pointing out.
Rajesh R Subramanian wrote: My troll needs to be attended here[^]
Fixed. (Being so recent, in this morning patrol I didn't catch it).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Some lardass downvoted this[^] too.
|
|
|
|
|
[military tone]
Fixed Sir!
[/military tone]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks pal. But why is your profile standing not corrected? Still shows "Sleept".
May be I am receiving a copy from some local server's cache.
|
|
|
|
|
Rajesh R Subramanian wrote: May be I am receiving a copy from some local server's cache.
0r maybe someone's is just too lazy...
[again militare tone]
Sir, I'm going to fix it, Sir!
[/again militare tone]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
And see here[^] if does nay help.
|
|
|
|
|
Hey everybody!
I am looking for a while a way to disable _com_errors being thrown through COM, and only get the HRESULT (S_OK or something else...) with no luck (I don't want to catch the _com_error).
From what I understood it is an attribute to the #import directive, but I can't really find one that causes that action.
So, is there a way to #import a dll and the prevent _com_error, so I can simply check the HRESULT alone?
Thanks!
|
|
|
|
|
raw_native_types perhaps?
|
|
|
|
|
First, Thanks for your help!
but that attribute forces BSTR and VARIANT instead of _bstr_t and _variant_t.
It still throws _com_errors...
|
|
|
|
|
Hey,
I had a little mistake when before I wrote the other thread.
It Works! , cause it simply disables the smart pointers...
But with it, it takes the _bstr_t and _variant_t and and all the other good things of smart pointer...
Oh well, at least I know what to do!!!
Thanks again!
|
|
|
|
|
Hi all,
My project requires TFTP server implementation in vc++.
If anybody is having the article or any info please share it.
Thanks in advance.
Sunil.
Regards,
Sunil Kumar
|
|
|
|
|
sunilkumar.d wrote: TFTP
Do you mean T errorist F inance T racking P rogram [^]?
BTW: Have a look at this page .
BTW2: You don't know we've also an article search engine, do you [^], [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Tuesday, July 22, 2008 4:30 AM
|
|
|
|