|
try this:
http://www.sysinternals.com/ntw2k/source/tcpview.shtml
|
|
|
|
|
How do I get the dialog help context button to show on dialogs...?
i've tried both context help checkboxes in dialog editor and they never show...what am I doing wrong...?
Do they workd with only certian dialog types...like resizable and not dialogframe...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
When you create your project did you check "Context-sensitive Help" at step 5 I think?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Not the effect i'm after i'm afraid.
I want the little question mark inside the caption bar.
However now that you mention it...i've just looked through all my apps and haven't seen one with it...?
Could I have been dreaming of a button that didn't exist...?
What the heck I swear i've seen one...weird...
thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
In the dialog resource editor, right click, select 'properties', on the 'extended styles' tab, select 'context help'. The 'context help' in the 'more styles' tab does not seem to work
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|
I've tried that, but nothing...?
Unless maybe by having both clicked it won't work.
I dunno what i'm doing wrong...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Well that is the one I use.
You can, in your dialog's OnInitDialog :
BOOL HelpDialog::OnInitDialog()
{
ModifyStyleEx(0, WS_EX_CONTEXTHELP);
return CDialog::OnInitDialog();
}
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|
I'll try that see what happens....i'm really curious to know what i'm doing wrong with the dialog editor...
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hello, all,
I launched an external application (ex: wordpad.exe) from my own win32 ap with ShellExecute(..) like the following:
HINSTANCE hInstExe = NULL;
hInstExe = ShellExecute
(
(HWND)NULL, // Replace this with your window handle.
(LPCTSTR)"open",
(LPCTSTR)"WordPad.exe",
(LPCTSTR)"c:\\sometext.txt", // Replace this with your specific file.
(LPCTSTR)NULL,
(INT)SW_SHOWNORMAL
);
I get an instance handle. Now, if I want to close/terminate this application launched by me (ex: wordpad.exe above ), what should I do ?
Could anybody help me ? Any response would be appreciated !
|
|
|
|
|
The foll. is an extract from MSDN, 'ShellExecute' documentation.
You cannot do anything with the HINSTANCE, better use CreateProcess,
from which you will get the process information(which contains the
correct handle to the process, and use 'TerminateProcess'.
[Return value for ShellExecute]
Returns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. The following table lists the error values. The return value is cast as an HINSTANCE for backward compatibility with 16-bit Microsoft® Windows® applications. It is not a true HINSTANCE, however. The only thing that can be done with the returned HINSTANCE is to cast it to an integer and compare it with the value 32 or one of the error codes below.
|
|
|
|
|
Yo Yo~~ wrote:
Could anybody help me ? Any response would be appreciated !
You need to use ShellExecuteEx for that.
Read my article which explains how to do so, with a code snippet :-
http://www.codeproject.com/useritems/newbiespawn.asp
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
The HINSTANCE returned by ShellExecute is not a valid handle to anything, it is there for compatibility reasons. To obtain a true handle to the launched process, use ShellExecuteEx . Nevertheless, for the purposes of closing the process, it is better to have the process ID, which you can obtain easily if you launch the program with CreateProcess (retrieving the process ID from a process handle is alas no easy task). Given the process ID of the program you wish to close, use EnumWindows to enumerate all top level windows and proceed as follows for each HWND enumerated:- Use
GetWindowThreadProcessId to retrieve the process ID of the window. - If the process ID matches the one you got, then send a
WM_CLOSE message to that window. For added robustness, you might consider using SendMessageTimeout and, if the polite way of closing the app doesn't work, getting a process handle with OpenProcess and calling TerminateProcess to force the app shut.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I got an application from my friend who got it from the net.When I opened it asked me whether to convert it to new version.I pressed "ok".I compiled succesfully but getting the error while linking.It is giving this error and saying that
Linking...
LINK : fatal error LNK1104: cannot open file "c:\devstudio\cppprojects\zip\debug\zipdbg.lib"
Error executing link.exe.
ServerWindow.exe - 1 error(s), 0 warning(s)
How can I remove this error?Do I need any project settings?
Thank you
Pathi
|
|
|
|
|
So "c:\devstudio\cppprojects\zip\debug\zipdbg.lib" is on your c: drive or not?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I am just about 1/2 way through a C++ program and have noticed a huge drop in articles in magazines. I was wondering if someone could tell me how relevant a programming degree in CPP is to the newe .NET framework. Is C# just an updated renamed version of C++? I'd really appreciate anyone making me feel better and letting me know that I'm not just wasting my time with a language that may not be around for much longer. These aren't rumors I've heard or anything, it's just my paranoia in me needing some reassurance.
Thanks
|
|
|
|
|
Garry White wrote:
Is C# just an updated renamed version of C++?
No, it's a new language which looks very much like other language which name starts with 'J'.
C++ can be used in .NET via so-called Managed C++ which produces .NET assemblies containing IL.
There's still normal, unmanaged C++ in VS.NET - it creates plain Windows exes and dlls. C++ still remains the most powerful programming language on this planet. It's going to be around for ages to come.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi All,
I'm having some problems with a some threads of mine. The thread in question is called TxThread. During this thread I create a new thread called ListRecThread. The TxThread can be closed before the ListRecThread may be finished, so from the TxThread I try to post a message to the ListRecThread to quit, which the ListRec is checking for.
The ListRecThread gets the Quit message and I return to break out of the loop. I post the quit message from the TxThread using: ListRecThread->PostThreadMessage(WM_QUIT, 0, 0);
and on the next line I have
WaitForSingleObject(ListRecThread->m_hThread, INFINITE);
but once this line executes is says Debug assertion failed followed by a message saying the thread has exited with code 0x3
If anyone has any idea as to what is wrong or if I'm doing something silly here, I'd appreciate any help!
Edit: By the way, the TxThread is in an MFC Extension DLL, could this be causing the problem????
|
|
|
|
|
Since you mention m_hThread, I assume your ListRecThread is a subclass of CWinThread ?
1. Set the m_autoDelete member variable to false in ListRecThread's constructor.
2. Then do WaitForSingleObject( ListRecThread->m_hThread,INFINITE) in TxThread
3. Perform a delete operation on m_listRecThread from TxThread. I assume you have stored a pointer to ListRecThread in TxThread
That ought to work
Hope that helps
|
|
|
|
|
I tried your suggestion but it is still giving me weird errors.
The threads are all appearing to shut down ok as I watch it in the task manager, but once the threads have all closed I am getting Debug Assert errors, memory read errors and unhandled exceptions! Using the debugger I cant find where it is going wrong either and it seems almost random as it sometimes gets a debug assert error on the waitforsingle object for the TxThread.
Oh well I think things have gotten a bit messy so I might have to go back and re-work some stuff!
Thanks anyway
|
|
|
|
|
MarkPQ wrote:
but once this line executes is says Debug assertion failed followed by a message saying the thread has exited with code 0x3
Debug assertion tells you a lot about the problem - check the stack and you'll be able to see what exactly caused the assert to fire.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for the help,
I found on the call stack that it was a GetAt() call for a CByteArray causing the assertion error. It was then that I realised that in the troublesome thread, it calls several functions that check for quit messages also and return nothing if it is the case. At one point in the thread I had a bug where I checked a CByteArray that if the Quit message was received from the function preceeding . . . would not exist and hence causing the assertion error! Silly me!
Its all fixed now! Thanks for your help! Greatly appreciated!
|
|
|
|
|
Hi,
I have a image loaded form a file through
LoadImage().I will extract the buffer & put into another file(dummy file).When i see the content of the dummy file,the image is looks as it is been fliped vertical.
I mean top portion is placed at the bottom.
Here is bit of code where i write to a dummy file.
CreateFile (the_acFile, GENERIC_READ |GENERIC_WRITE, FILE_SHARE_READ, NULL,OPEN_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL) ;
WriteFile(m_hPreviewFile, in_Buffer, lpbminfo->biSizeImage , &the_BytesWritten, NULL );
Can anyone help me..
Neha
|
|
|
|
|
How are you getting your byte values for the image into the lpbminfo structure? If you are using a function like GetDIBits , it is possible to load the image upside down.
A bottom-up DIB is specified by setting the height to a positive number, while a top-down DIB is specified by setting the height to a negative number.
|
|
|
|
|
I load the image through
where gszPreviewFile is a path to a dib file.
DIBSECTION ds;
hImage = (HBITMAP)::LoadImage (AfxGetInstanceHandle(), gszPreviewFile, IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE |LR_CREATEDIBSECTION );
GetObject(hImage, sizeof(BITMAP), &bm);
GetObject(hImage, sizeof(DIBSECTION), &ds);
lpbminfo =ds.ds.dsBmih ;
Buffer i will write to dummy file i will get it from bm.bmbits.
|
|
|
|
|
If i use
GetDIBits(NULL,hImage,1,ds.dsBm.bmHeight ,the_buffer,&bmi,DIB_RGB_COLORS);
It returns me error as 87,INVALID_PARAMETER.
Could anyone pl help me.
Neha
|
|
|
|