|
shfinfrock wrote:
I am trying to put a button on the main window of a simple SDI project. The button appears ok but it doesn't respond to the mouse. I am declaring the button in the CMainFrame class and creating it in OnCreate (see below). The same code works fine for a dialog but not for the main window.
[...]
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
m_wndPushButton.Create(_T("test"),WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, rect, this, 1);
In an SDI app, you'll always have a CView covering the entire client area. You see the button in the screen, because the view is painted before the button. However, the button is actually behind the view in the z-order, so it's not receiving any mouse message.
If you add the WS_CLIPSIBLINGS style to the button, you won't even see it. If you add the following line after the button creation, you'll see it and it will start receiving (and reacting to) mouse messages:
m_wndPushButton.SetWindowPos(&wndTop, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
However, you should note this button will actually overlap with the view, obscuring some part of it. I'm not sure if that's what you want... Consider placing the button in a toolbar or dialog bar so that it doesn't overlap with the view.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
hi!
how can i send a GET, POST request to a HTTPS server?
is it easy to do that with c# und System.Web Namespace?
do anybody know the cURL lib? http://curl.haxx.se/
ps.: i want to do that to do that as easy as possible!
cu+thx
|
|
|
|
|
Hello
You can try to make it using CHttpConnection with MFC. Or you can use API functions: WinHttpOpen , WinHttpConnect , WinHttpOpenRequest .
Andrew
|
|
|
|
|
hi, but can i use a socketlib instead? i need it for windows and linux!! i dont want to use OpenSSL because the docu ist bad!!
such a socket lib i search:
<br />
Socket *socket = new Socket();<br />
socket->connectSSL("google.com", 443);<br />
socket->sends("GET / HTTP/1.0\n\n");<br />
const char *response = socket->reads();<br />
cout << response;<br />
socket->close();<br />
cu+thx
|
|
|
|
|
The thread 0xE9C has exited with code 0 (0x0).
The thread 0x50C has exited with code -1073741819 (0xC0000005).
The program 'C:\Program Files\Microsoft Visual Studio\MyProjects\wordlist\Debug\wordlist.exe' has exited with code -1073741819 (0xC0000005).
can someone please tell me what that means i cant figure it out
|
|
|
|
|
I don't recognize 0xC0000005 as a Windows error code, but it is the number you see for an access violation exception. If that's the case, you've got a bad pointer value somewhere (using an uninitialized pointer, dereferencing NULL , using memory after it's freed, etc.).
Software Zen: delete this;
|
|
|
|
|
0xC0000005 is a windows error code!!!
To be precisely, it is an exception code (EXCEPTION_ACCESS_VIOLATION).
Don't try it, just do it!
|
|
|
|
|
Hey there.
Can someone provide me with a few examples of how to handle exceptions? Below is some code I used in an application. p->ShowWindow(SW_SHOW) is used to display a dialog containing an ActiveX Control. If the control is not registered I should get an exception, but it is not working. I must have something set up wrong. I have many places in my application where I need to do exception handling, thought I should start with this example.
Jerry
/////Not sure if I need these 2 lines of code???
#include <new>
using std::bad_alloc;
///////
try
{
p->ShowWindow(SW_SHOW);
}
catch(bad_alloc exception)
{
MessageBox("Data", "Memory Allocation Error", _OK);
}
//////
|
|
|
|
|
I left out: #include <new>
|
|
|
|
|
First off, you really should be catching exceptions by reference, as catching them by value will create two copies, instead of one.
That apart, IIRC, bad_alloc is thrown only when the new operator fails to allocate memory. AFAIK, the CRT that comes with VC++ doesn't do that, it instead returns NULL. Your code is most probably throwing some other exception. If you *really* want to catch all exceptions, your code should look like
try
{
...
}
catch(...)
{
}
This is not recommended though, I'd suggest figuring out the exact exception thrown and catching it.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I tried catch(...), it didnt catch any exceptions either.
Something else must be wrong with the code.
Thanks,
Jerry
|
|
|
|
|
S. Senthil Kumar wrote:
bad_alloc is thrown only when the new operator fails to allocate memory. AFAIK, the CRT that comes with VC++ doesn't do that, it instead returns NULL.
It depends on compiler settings.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
hello,
just like we can tile the MDI child windows in our application can we write code for tiling the dialog boxes opened in parent dialog boxes?I thought of deriving our child dialog class from CFrameWnd.But then we have to tile them on clicking a menu option which then has to written in OnInitDialog() of CDialogDlgi.e the parent class.
please guide if i am proceeding in proper way?
thanks
|
|
|
|
|
|
Hi!
I am a college student.I wrote a filter demux the DVB-s mpeg-2 TS.Now it can render more than one audio streams But it can only render one video stream.It will be dead lock when rendering more than one video stream at the same time.
I dont know the reason.
I sincerely wait for the master's help!
please dont laugh at my poor english,I am a chinses student.
|
|
|
|
|
I have a question concerning your demultiplexer.
What kind of error corrections did you use?
I've also written a demux, but when there are many bitstream errors, the video and audio playback will get asynchron, although the media samples are all timestamped.
Now to your question:
You should trace where exactly the deadlock occurs (which filter, which routine...).
Don't try it, just do it!
|
|
|
|
|
Alexander:
I have no error correcttion,because the data source is DVB-S there is few error in the sattelite channle. Do you exactly know the wrong data ? whether you can drop the data,drop the audio and video data at the same time.
how do you process with the two video out put pin ?
|
|
|
|
|
|
I have no idea yet.
|
|
|
|
|
I resovled this problem.The sample number of output pin is not enough!
I increased the number from 100 to 4000,and the COutputQueue object's list cache from 10 to 1024*1024.Now everything runs well.
|
|
|
|
|
Question: In my Edit Control i want the users to input HEX Values (I know they dont except HEX values so I can only use them in a CString as Characters). They would input something like "AA BB". What i want to do is take those 2 values ("AA" being 1 value and "BB" being the other value) and put them into a UINT array. i am just not sure how to go about extracting characters from a string.
Anyone have any suggestions on how I could do this?
Thanks
|
|
|
|
|
CNewbie wrote:
am just not sure how to go about extracting characters from a string.
You can use the function
WCHAR <code>GetAt</code>(int nIndex)
"Success is the ability of going from one failure to another with no loss of enthusiasm" - W.Churchill
|
|
|
|
|
It seems that a webbrowser control doesn't pass any referer info to a visited website, but does pass browser and version info.
How can I get a webbrowser control (dialog-based app, VC++6)to pass a referer of, say, http://www.mybrowser.com ?
|
|
|
|
|
is it possable to change the name of a .txt file when writing to it? file1.txt file2.txt and so on if so how?
|
|
|
|
|
of course you can, just use sprintf to specify the file name.
like this:
char fname[256];
for (int i=0; i
|
|
|
|