|
HockeyDude wrote:
but SetWindowLong doesn't exist for CListCtrl....what am I doing wrong...?
That's simple SetWindowLong doesn't exist in MFC. You can use ModifyStyle as Nish pointed out, or call 'raw' SetWindowLong:
::SetWindowLong(GetListCtrl(), GWL_STYLE, whatever);
BTW: you don't need GetListCtrl() call to change style - your view *is* a list control - at the API level, of course.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Of course.
I knew that...
Thanx though!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
If my 32-bit DLL is being called from a 16-bit app. I cannot call
CreateThread(). I want to use a multimendia timer in this DLL, but it "runs
on its own thread" according to MSDN. Does this mean that it cannot be used
in a 32-bit DLL that is called by a 16-bit app?
Many thanks.
|
|
|
|
|
I programmed with Wininet Library.
I know "How to Access authentified resouce ( for example,
Webpage which Can not be Accessed Directly , but requires 'Id and Password' ) ".
HttpRequest the page with "GET" command, and sendRequest "ID = & PassWord= "
"POST" command, the Webpage, is available..
But Usually , Explorer , Authentified the WepPage, accessing another WepPage
in the Session . is NOT required Authentification.
but, I don't know How to HttpRequest in the "Authentified Session".
Please give me some advice about this problem.
sdsa
|
|
|
|
|
I'm going to create a form designer like application. However, I know not much about it. Can someone tell me some hints ?
For creation of components, should i create them by derived from CWnd, and let them "paint" themselves, then handle mouse events in creation, moving, selection ?
However, for "connector component" of the components. Is it I should create the window as width and height of the "connector", and darw "ifself" as transparent besides the linking line?
|
|
|
|
|
Hi
When I create a new ATL project, my DllMan looks like
// DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
hInstance;
return _AtlModule.DllMain(dwReason, lpReserved);
}
What does the statement "hInstance;" do?
|
|
|
|
|
Anonymous wrote:
What does the statement "hInstance;" do?
It's there only to avoid the compiler warning about 'hInstance' parameter being unused. The statement generates no code.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
How can I find which application
open a port (socket communication)
on my computer? More generally, having
a socket handle, how can I find which process
use it?
The same problem for a open file: how can I
know from my programm who opened this file?
Thanks.
|
|
|
|
|
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????
|
|
|
|